summaryrefslogtreecommitdiffstats
path: root/README.mkd
diff options
context:
space:
mode:
authorChristopher Peplin <chris.peplin@rhubarbtech.com>2014-01-03 13:40:02 -0500
committerChristopher Peplin <chris.peplin@rhubarbtech.com>2014-01-03 13:40:02 -0500
commit330358c978ea3d324740a8dba884c4493fa339b8 (patch)
tree405c6f572531e5624bb15da16bc73da99035503e /README.mkd
parent99dd20fc3d6c14d9e8af65264ad712ca6718dcdd (diff)
Split up functions to rx CAN messages for rx and tx of ISO-TP.
Diffstat (limited to 'README.mkd')
-rw-r--r--README.mkd13
1 files changed, 8 insertions, 5 deletions
diff --git a/README.mkd b/README.mkd
index 1e2c29aa..6c3efa94 100644
--- a/README.mkd
+++ b/README.mkd
@@ -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) {