From b2033dd734c689701d0e1c8518a04a3304a3c6c3 Mon Sep 17 00:00:00 2001 From: Christopher Peplin Date: Sat, 27 Sep 2014 16:11:07 -0400 Subject: Propagate errors from isotp-c when sending requests. --- src/uds/uds.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/uds/uds.c b/src/uds/uds.c index d5a40bcf..636bbfca 100644 --- a/src/uds/uds.c +++ b/src/uds/uds.c @@ -84,7 +84,14 @@ static void send_diagnostic_request(DiagnosticShims* shims, handle->request.arbitration_id, payload, 1 + handle->request.payload_length + handle->request.pid_length, NULL); - if(shims->log != NULL) { + if(handle->isotp_send_handle.completed && + !handle->isotp_send_handle.success) { + handle->completed = true; + handle->success = false; + if(shims->log != NULL) { + shims->log("%s", "Diagnostic request not sent"); + } + } else if(shims->log != NULL) { char request_string[128] = {0}; diagnostic_request_to_string(&handle->request, request_string, sizeof(request_string)); @@ -101,7 +108,9 @@ void start_diagnostic_request(DiagnosticShims* shims, handle->success = false; handle->completed = false; send_diagnostic_request(shims, handle); - setup_receive_handle(handle); + if(!handle->completed) { + setup_receive_handle(handle); + } } DiagnosticRequestHandle generate_diagnostic_request(DiagnosticShims* shims, -- cgit 1.2.3-korg