summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Peplin <chris.peplin@rhubarbtech.com>2014-09-27 16:11:07 -0400
committerChristopher Peplin <chris.peplin@rhubarbtech.com>2014-09-27 16:13:11 -0400
commitb2033dd734c689701d0e1c8518a04a3304a3c6c3 (patch)
tree3a694a529a8400f901d3d775311001f721759635
parentf83e53554021a93e280c3faa9a6e6d436b0e1572 (diff)
Propagate errors from isotp-c when sending requests.
-rw-r--r--src/uds/uds.c13
1 files changed, 11 insertions, 2 deletions
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,