diff options
author | Christopher Peplin <chris.peplin@rhubarbtech.com> | 2014-01-02 15:28:52 -0500 |
---|---|---|
committer | Christopher Peplin <chris.peplin@rhubarbtech.com> | 2014-01-02 15:28:52 -0500 |
commit | e3637d97ecaef1768d3f9ef40cb0204a0e668ff2 (patch) | |
tree | a1f2db1c34cfde48fe8533877015556ba7309c30 /src | |
parent | fe20a273bb3979d9e806d828486633249d073ede (diff) |
Only mark handle as completed when fully received.
Diffstat (limited to 'src')
-rw-r--r-- | src/isotp/isotp.c | 2 | ||||
-rw-r--r-- | src/isotp/isotp.h | 5 | ||||
-rw-r--r-- | src/isotp/receive.c | 2 |
3 files changed, 8 insertions, 1 deletions
diff --git a/src/isotp/isotp.c b/src/isotp/isotp.c index 9aa051bc..1605d435 100644 --- a/src/isotp/isotp.c +++ b/src/isotp/isotp.c @@ -76,6 +76,8 @@ IsoTpMessage isotp_receive_can_frame(IsoTpShims* shims, IsoTpHandle* handle, message.payload = payload; message.size = payload_length; message.completed = true; + handle->success = true; + handle->completed = true; isotp_handle_single_frame(handle, &message); break; } diff --git a/src/isotp/isotp.h b/src/isotp/isotp.h index 103c402d..c0db0178 100644 --- a/src/isotp/isotp.h +++ b/src/isotp/isotp.h @@ -101,6 +101,11 @@ IsoTpMessage isotp_receive_can_frame(IsoTpShims* shims, IsoTpHandle* handle, const uint16_t arbitration_id, const uint8_t data[], const uint8_t size); +// TODO perhaps this makes more sense as 2 functions: +// bool isotp_continue_send() +// IsoTpMessage isotp_continue_receive() +// but both with the same args + /* Public: Change the timeout for waiting on an ISO-TP response frame. * * If this function is not used, the conventional 100ms is used by default. diff --git a/src/isotp/receive.c b/src/isotp/receive.c index 1692f8d3..b07950c5 100644 --- a/src/isotp/receive.c +++ b/src/isotp/receive.c @@ -20,7 +20,7 @@ IsoTpHandle isotp_receive(IsoTpShims* shims, IsoTpHandle handle = { success: false, - completed: true, + completed: false, receive_handle: receive_handle, type: ISOTP_HANDLE_RECEIVING }; |