diff options
Diffstat (limited to 'README.mkd')
-rw-r--r-- | README.mkd | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -58,7 +58,7 @@ With your shims in hand, send an ISO-TP message: // You received the message! Do something with it. } - IsoTpHandle handle = isotp_send(&shims, 0x100, NULL, 0, message_sent); + IsoTpSendHandle handle = isotp_send(&shims, 0x100, NULL, 0, message_sent); if(handle.completed) { if(!handle.success) { @@ -72,7 +72,10 @@ With your shims in hand, send 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); + // this will return true when the message is completely sent (which + // may take more than one call if it was multi frame and we're waiting + // on flow control responses from the receiver) + bool complete = isotp_continue_send(&shims, &handle, 0x100, data, size); if(complete && handle.completed) { if(handle.success) { @@ -90,19 +93,19 @@ Finally, receive an ISO-TP message: // Optional: This is your callback for when a complete ISO-TP message is // received at the arbitration ID you specify. The completed message is - // also returned by isotp_receive_can_frame, which can sometimes be more + // also returned by isotp_continue_receive, which can sometimes be more // useful since you have more context. void message_received(const IsoTpMessage* message) { } - IsoTpHandle handle = isotp_receive(&shims, 0x100, message_received); + IsoTpReceiveHandle handle = isotp_receive(&shims, 0x100, message_received); if(!handle.success) { // something happened and it already failed - possibly we aren't able to // send CAN messages } else { while(true) { // Continue to read from CAN, passing off each message to the handle - IsoTp message = isotp_receive_can_frame(&shims, &handle, 0x100, data, size); + IsoTpMessage message = isotp_continue_receive(&shims, &handle, 0x100, data, size); if(message.completed && handle.completed) { if(handle.success) { |