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/send.c | |
parent | 99dd20fc3d6c14d9e8af65264ad712ca6718dcdd (diff) |
Split up functions to rx CAN messages for rx and tx of ISO-TP.
Diffstat (limited to 'src/isotp/send.c')
-rw-r--r-- | src/isotp/send.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/isotp/send.c b/src/isotp/send.c index b87c5602..dfba1df3 100644 --- a/src/isotp/send.c +++ b/src/isotp/send.c @@ -11,12 +11,11 @@ void isotp_complete_send(IsoTpShims* shims, IsoTpMessage* message, } } -IsoTpHandle isotp_send_single_frame(IsoTpShims* shims, IsoTpMessage* message, +IsoTpSendHandle isotp_send_single_frame(IsoTpShims* shims, IsoTpMessage* message, IsoTpMessageSentHandler callback) { - IsoTpHandle handle = { + IsoTpSendHandle handle = { success: false, - completed: true, - type: ISOTP_HANDLE_SENDING + completed: true }; uint8_t can_data[CAN_MESSAGE_BYTE_SIZE] = {0}; @@ -42,21 +41,20 @@ IsoTpHandle isotp_send_single_frame(IsoTpShims* shims, IsoTpMessage* message, return handle; } -IsoTpHandle isotp_send_multi_frame(IsoTpShims* shims, IsoTpMessage* message, +IsoTpSendHandle isotp_send_multi_frame(IsoTpShims* shims, IsoTpMessage* message, IsoTpMessageSentHandler callback) { // TODO make sure to copy message into a local buffer shims->log("Only single frame messages are supported"); - IsoTpHandle handle = { + IsoTpSendHandle handle = { success: false, - completed: true, - type: ISOTP_HANDLE_SENDING + completed: true }; // TODO need to set sending and receiving arbitration IDs separately if we // can't always just add 0x8 (and I think we can't) return handle; } -IsoTpHandle isotp_send(IsoTpShims* shims, const uint16_t arbitration_id, +IsoTpSendHandle isotp_send(IsoTpShims* shims, const uint16_t arbitration_id, const uint8_t payload[], uint16_t size, IsoTpMessageSentHandler callback) { IsoTpMessage message = { |