OOBD Team | S. Koehler |
Request for Comments:6 | |
Obsoletes: - | |
Category: Draft Standard | May 2013 |
This memo provides information about how to read real time CAN data through the OOBD firmware. Distribution of this memo is unlimited.
Copyright (C) OOBD Team (2012). All Rights Reserved.
To surround several constrains like bus speed, real time capabilities and memory size when recording real time data in OOBD, the following concept will be followed
Select the CAN RTD protocol
p 1 1 3 0
Open the CAN filters
p 8 10 1 0 p 8 11 1 0
This activates the CAN Real Time Protocol, clears the internal PID list and sets the CAN bus into “invisible listen” mode
The data to listen to is defined by the application to the firmware with an 27- command:
27 CanID Type [Length [cPos [cStart]]]
Values not given use 0 as default value
where the data byte meanings are as follows:
Block | Length in Bytes | Meaning | Comment |
---|---|---|---|
CanID | 4 | CAN- ID to listen to (MSB ..LSB) | |
Type | 1 | Multi frame message type | 0: Single Frame 1: Custom 2: ISO-TP |
Length | 2 | total length of data telegram | in case of ISO-TP, data length is dynamically taken out of the First Frame header if not given, assumed as 8 (=single frame length) |
cPos | 1 | Position of Sequence counter | -preliminary- If telegram type is custom, than this position (0-7) is used to identify the sequence counter inside the CAN frame. |
cStar | 1 | start value of Sequence counter | -preliminary- If telegram type is custom, than this value is used to identify the first frame by its sequence counter inside the CAN frame. |
Error Code | Meaning |
---|---|
1 | Command too long: there are more bytes gives as specified by the command format |
2 | out of Memory: Not enough memory to store the requested data buffer |
3 | CAN ID already exist: The requested CAN ID is already requested before |
Request Single frame with ID 0400
27 00000400
Request Single frame (=type 00) with ID 0400 and length 3
27 00000400 00 0003
Request custom multi frame (=type 01) with ID 400 , length 20, sequence counter position at Byte 3 and starting value of 2
27 00000400 01 0014 03 02
Request ISO-TP multiframe (=type 02) with ID 400 (length is taken dynamically out of first frame info)
27 00000400 02
The request to the firmware to send received data to the application is done with an 22- command:
22 AA BB CC DD
where the data byte meanings are as follows:
Bytes | Meaning | Comment |
---|---|---|
AA BB CC DD | CAN- ID to listen to (MSB ..LSB) |
As result the firmware first repeats the command + 40H (=0x62) , a four byte timestamp (AABBCCDD, FreeRTOS ticks), a one byte flag (FL) and the received data bytes after that:
62 AA BB CC DD FL 00 11 22 ..
In the moment only bit 0 of the flag is used. If set, the data output is new and has not been printed before. After printed, the flag is set to 0 by the firmware. So when bit 0 is set, this is fresh data. By that the application software don't need to control by itself (by the time stamps) if this data has already been received before or if its new data.
the error messages are designed as General Response Code Errors, means they are coded as received bytes, not as clear text error messages. The byte sequence always starts with 7F 00, followed by the error code byte:
Error Code | Meaning |
---|---|
01 | unknown CAN ID (not configured yet) |
02 | no valid data received until now |
Command | Function |
---|---|
p 6 1 | clear the internal data buffer list, releases all used memory buffers |
This RFC raises security issues. It's need to make sure that the firmware only listens on the bus in invisible mode without creating any active (re)action on the bus.
Steffen Koehler
Phone: +49 172 410 35 98
EMail:steffen@koehlers.de
Copyright (C) OOBD Team (2012). All Rights Reserved.
This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the OOBD Team organizations, except as needed for the purpose of developing standards in which case the procedures for copyrights defined in the Standards process must be followed, or as required to translate it into languages other than English.
The limited permissions granted above are perpetual and will not be revoked by the OOBD Team or its successors or assigns.
This document and the information contained herein is provided on an “AS IS” basis and THE OOBD TEAM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.“ Relation to other RFCs
The OOBD-RFC announcements are distributed via the oobd-commit-messages@googlegroups.com mailing list.
To join (or quit) the list goto https://groups.google.com/forum/?hl=de&fromgroups=#!forum/oobd-commit-messages