Code Review
/
apps
/
agl-service-can-low-level.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
|
inline
| side by side (parent:
14dc82b
)
Only include PID in log output if request has one.
author
Christopher Peplin
<chris.peplin@rhubarbtech.com>
Sat, 15 Feb 2014 03:43:05 +0000
(22:43 -0500)
committer
Christopher Peplin
<chris.peplin@rhubarbtech.com>
Sat, 15 Feb 2014 03:43:05 +0000
(22:43 -0500)
src/uds/uds.c
patch
|
blob
|
history
diff --git
a/src/uds/uds.c
b/src/uds/uds.c
index
5a45c0c
..
88d56bc
100644
(file)
--- a/
src/uds/uds.c
+++ b/
src/uds/uds.c
@@
-342,10
+342,17
@@
void diagnostic_response_to_string(const DiagnosticResponse* response,
void diagnostic_request_to_string(const DiagnosticRequest* request,
char* destination, size_t destination_length) {
int bytes_used = snprintf(destination, destination_length,
void diagnostic_request_to_string(const DiagnosticRequest* request,
char* destination, size_t destination_length) {
int bytes_used = snprintf(destination, destination_length,
- "arb_id: 0x%02x, mode: 0x%x,
pid: 0x%x,
",
+ "arb_id: 0x%02x, mode: 0x%x, ",
request->arbitration_id,
request->arbitration_id,
- request->mode,
- request->pid);
+ request->mode);
+
+ if(request->has_pid) {
+ bytes_used += snprintf(destination + bytes_used,
+ destination_length - bytes_used,
+ "pid: 0x%x, ",
+ request->pid);
+ }
+
int remaining_space = destination_length - bytes_used;
if(request->payload_length > 0) {
snprintf(destination + bytes_used, remaining_space,
int remaining_space = destination_length - bytes_used;
if(request->payload_length > 0) {
snprintf(destination + bytes_used, remaining_space,