summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristopher Peplin <chris.peplin@rhubarbtech.com>2014-01-05 18:56:31 -0500
committerChristopher Peplin <chris.peplin@rhubarbtech.com>2014-01-05 18:56:31 -0500
commit8ca422e95dce9349afbdc399215c9c4d28c89f1a (patch)
treed314aedadaa50d8264a50c25877fa52892dc04a0 /src
parent1fef0b137e38df2f23dc5e98262422ac33e354ee (diff)
Log when sending a new diagnositc request.
Diffstat (limited to 'src')
-rw-r--r--src/obd2/obd2.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/obd2/obd2.c b/src/obd2/obd2.c
index 83aa1fda..f8b4a372 100644
--- a/src/obd2/obd2.c
+++ b/src/obd2/obd2.c
@@ -49,10 +49,26 @@ DiagnosticRequestHandle diagnostic_request(DiagnosticShims* shims,
handle.isotp_shims = isotp_init_shims(shims->log,
shims->send_can_message,
shims->set_timer);
+
handle.isotp_send_handle = isotp_send(&handle.isotp_shims,
request->arbitration_id, payload,
1 + request->payload_length + request->pid_length,
NULL);
+ if(shims->log != NULL) {
+ shims->log("Sending diagnostic request: arb_id: 0x%02x, mode: 0x%x, pid: 0x%x, payload: 0x%02x%02x%02x%02x%02x%02x%02x%02x, size: %d\r\n",
+ request->arbitration_id,
+ request->mode,
+ request->pid,
+ request->payload[0],
+ request->payload[1],
+ request->payload[2],
+ request->payload[3],
+ request->payload[4],
+ request->payload[5],
+ request->payload[6],
+ request->payload[7],
+ request->payload_length);
+ }
handle.isotp_receive_handle = isotp_receive(&handle.isotp_shims,
request->arbitration_id + ARBITRATION_ID_OFFSET,