From 8ca422e95dce9349afbdc399215c9c4d28c89f1a Mon Sep 17 00:00:00 2001 From: Christopher Peplin Date: Sun, 5 Jan 2014 18:56:31 -0500 Subject: Log when sending a new diagnositc request. --- src/obd2/obd2.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src') 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, -- cgit 1.2.3-korg