From: Christopher Peplin Date: Sat, 27 Sep 2014 20:11:07 +0000 (-0400) Subject: Propagate errors from isotp-c when sending requests. X-Git-Tag: 3.99.1~101^2~4 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=b2033dd734c689701d0e1c8518a04a3304a3c6c3;p=apps%2Flow-level-can-service.git Propagate errors from isotp-c when sending requests. --- diff --git a/src/uds/uds.c b/src/uds/uds.c index d5a40bc..636bbfc 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,