diff options
author | Christopher Peplin <chris.peplin@rhubarbtech.com> | 2014-01-01 16:08:10 -0500 |
---|---|---|
committer | Christopher Peplin <chris.peplin@rhubarbtech.com> | 2014-01-01 16:10:57 -0500 |
commit | 482c7eafcb35a4031ab6f2241b14ac495735b7cd (patch) | |
tree | 8fdff5d9e5ae49df5ed0909dfdb8fc628674ed80 /src/isotp/isotp.h | |
parent | 8702b34a8ffdf220c9b054d8f1950a82c9387d6a (diff) |
Return completed rx messages instead of relying on callbacks.
Diffstat (limited to 'src/isotp/isotp.h')
-rw-r--r-- | src/isotp/isotp.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/isotp/isotp.h b/src/isotp/isotp.h index 4f58dac4..103c402d 100644 --- a/src/isotp/isotp.h +++ b/src/isotp/isotp.h @@ -18,8 +18,9 @@ const bool ISO_TP_DEFAULT_FRAME_PADDING_STATUS; typedef struct { const uint16_t arbitration_id; - const uint8_t* payload; - const uint16_t size; + uint8_t* payload; + uint16_t size; + bool completed; } IsoTpMessage; typedef void (*LogShim)(const char* message, ...); @@ -95,11 +96,8 @@ IsoTpShims isotp_init_shims(LogShim log, /* Public: * - * Returns true if a complete ISO-TP message was sent or received as of - * processing this CAN frame. Check the 'success' and 'completed' flag on the - * handle to make sure. */ -bool isotp_receive_can_frame(IsoTpShims* shims, IsoTpHandle* handle, +IsoTpMessage isotp_receive_can_frame(IsoTpShims* shims, IsoTpHandle* handle, const uint16_t arbitration_id, const uint8_t data[], const uint8_t size); @@ -121,8 +119,8 @@ IsoTpHandle isotp_send(IsoTpShims* shims, const uint16_t arbitration_id, const uint8_t* payload, uint16_t size, IsoTpMessageSentHandler callback); -IsoTpHandle isotp_receive(IsoTpShims* shims, const uint16_t arbitration_id, - IsoTpMessageReceivedHandler callback); +IsoTpHandle isotp_receive(IsoTpShims* shims, + const uint16_t arbitration_id, IsoTpMessageReceivedHandler callback); #ifdef __cplusplus } |