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 /README.mkd | |
parent | 8702b34a8ffdf220c9b054d8f1950a82c9387d6a (diff) |
Return completed rx messages instead of relying on callbacks.
Diffstat (limited to 'README.mkd')
-rw-r--r-- | README.mkd | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -58,7 +58,8 @@ Then, set up a callback and send an ISO-TP message: Finally, receive an ISO-TP message: // This is your callback for when a complete ISO-TP message is received at - // the arbitration ID you specify + // the arbitration ID you specify - it's optional. The completed message is + // also returned by isotp_receive_can_frame void message_received(const IsoTpMessage* message) { } @@ -69,9 +70,9 @@ Finally, receive an ISO-TP message: } else { while(true) { // Continue to read from CAN, passing off each message to the handle - bool complete = isotp_receive_can_frame(&shims, &handle, 0x100, data, size); + IsoTp message = isotp_receive_can_frame(&shims, &handle, 0x100, data, size); - if(complete && handle.completed) { + if(message.completed && handle.completed) { if(handle.success) { // A message has been received successfully } else { |