diff options
author | Christopher Peplin <chris.peplin@rhubarbtech.com> | 2014-01-03 13:40:02 -0500 |
---|---|---|
committer | Christopher Peplin <chris.peplin@rhubarbtech.com> | 2014-01-03 13:40:02 -0500 |
commit | 330358c978ea3d324740a8dba884c4493fa339b8 (patch) | |
tree | 405c6f572531e5624bb15da16bc73da99035503e /src/isotp/receive.c | |
parent | 99dd20fc3d6c14d9e8af65264ad712ca6718dcdd (diff) |
Split up functions to rx CAN messages for rx and tx of ISO-TP.
Diffstat (limited to 'src/isotp/receive.c')
-rw-r--r-- | src/isotp/receive.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/isotp/receive.c b/src/isotp/receive.c index b07950c5..3eba9b53 100644 --- a/src/isotp/receive.c +++ b/src/isotp/receive.c @@ -1,28 +1,24 @@ #include <isotp/receive.h> -bool isotp_handle_single_frame(IsoTpHandle* handle, IsoTpMessage* message) { +bool isotp_handle_single_frame(IsoTpReceiveHandle* handle, IsoTpMessage* message) { isotp_complete_receive(handle, message); return true; } -void isotp_complete_receive(IsoTpHandle* handle, IsoTpMessage* message) { - if(handle->receive_handle.message_received_callback != NULL) { - handle->receive_handle.message_received_callback(message); +void isotp_complete_receive(IsoTpReceiveHandle* handle, IsoTpMessage* message) { + if(handle->message_received_callback != NULL) { + handle->message_received_callback(message); } } -IsoTpHandle isotp_receive(IsoTpShims* shims, +IsoTpReceiveHandle isotp_receive(IsoTpShims* shims, const uint16_t arbitration_id, IsoTpMessageReceivedHandler callback) { - IsoTpReceiveHandle receive_handle = { + IsoTpReceiveHandle handle = { + success: false, + completed: false, arbitration_id: arbitration_id, message_received_callback: callback }; - IsoTpHandle handle = { - success: false, - completed: false, - receive_handle: receive_handle, - type: ISOTP_HANDLE_RECEIVING - }; return handle; } |