From 330358c978ea3d324740a8dba884c4493fa339b8 Mon Sep 17 00:00:00 2001 From: Christopher Peplin Date: Fri, 3 Jan 2014 13:40:02 -0500 Subject: Split up functions to rx CAN messages for rx and tx of ISO-TP. --- src/isotp/send.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/isotp/send.c') 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 = { -- cgit 1.2.3-korg