diff options
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; } |