Group isotp_defs¶
Protocol constants of ISO 15765-2 and the library result codes. More...
Public Static Functions¶
| Type | Name |
|---|---|
| uint32_t | isotp_get_u32_be (const uint8_t * data) Read a big-endian 32-bit value. |
| void | isotp_put_u32_be (uint8_t * data, uint32_t value) Write a 32-bit value in big-endian byte order. |
Macros¶
| Type | Name |
|---|---|
| define | ISOTP_BUSY -2Try again later: transmission in progress or CAN driver busy. |
| define | ISOTP_CAN_DL 8UData bytes of a classical CAN frame. |
| define | ISOTP_CF_MAX_DATA 7UPayload bytes in a full Consecutive Frame. |
| define | ISOTP_ERROR -1Invalid argument, malformed frame or insufficient capacity. |
| define | ISOTP_FC_DL 3UBytes of a Flow Control frame without padding. |
| define | ISOTP_FF_DL_12BIT_MAX 4095ULargest length in the 12-bit FF_DL field. |
| define | ISOTP_FF_LONG_DATA 2UPayload bytes in a First Frame with 32-bit FF_DL. |
| define | ISOTP_FF_SHORT_DATA 6UPayload bytes in a First Frame with 12-bit FF_DL. |
| define | ISOTP_FIRST_SN 1USN of the first Consecutive Frame. |
| define | ISOTP_FS_CONTINUE 0x0UCTS: continue to send. |
| define | ISOTP_FS_OVERFLOW 0x2UOVFLW: message longer than the receiver buffer. |
| define | ISOTP_FS_WAIT 0x1UWAIT: wait for the next Flow Control frame. |
| define | ISOTP_N_BUFFER_OVFLW -8Message longer than the receiver buffer. |
| define | ISOTP_N_ERROR -9CAN driver error while sending a frame. |
| define | ISOTP_N_INVALID_FS -5Sender: Flow Control with an unknown flow status. |
| define | ISOTP_N_OK 0Completed successfully. |
| define | ISOTP_N_TIMEOUT_A -1N_As/N_Ar expired (not produced: writes are synchronous). |
| define | ISOTP_N_TIMEOUT_BS -2Sender: no Flow Control within N_Bs. |
| define | ISOTP_N_TIMEOUT_CR -3Receiver: no Consecutive Frame within N_Cr. |
| define | ISOTP_N_UNEXP_PDU -6Receiver: new SF/FF interrupted a reception. |
| define | ISOTP_N_WFT_OVRN -7Sender: more than N_WFTmax Wait frames. |
| define | ISOTP_N_WRONG_SN -4Receiver: Consecutive Frame with an unexpected SN. |
| define | ISOTP_OK 0Success. |
| define | ISOTP_PCI_CONSECUTIVE_FRAME 0x2UCF: next segment of a message. |
| define | ISOTP_PCI_FIRST_FRAME 0x1UFF: start of a segmented message. |
| define | ISOTP_PCI_FLOW_CONTROL 0x3UFC: receiver tells the sender how to continue. |
| define | ISOTP_PCI_SINGLE_FRAME 0x0USF: complete message of up to 7 bytes. |
| define | ISOTP_SF_MAX_DL 7ULargest Single Frame payload. |
| define | ISOTP_SN_MASK 0x0FUSequence numbers count 0..15 and wrap. |
| define | ISOTP_ST_MIN_MAX_US 127000ULargest STmin, 0x7F = 127 ms. |
Detailed Description¶
Wire values (frame types, flow status, field limits) are taken from ISO 15765-2 for classical CAN (8 data bytes) with normal addressing. The result codes are library values: the standard defines the N_Result names, not their numbers.
** **
- Function return codes: ISOTP_OK, ISOTP_ERROR, ISOTP_BUSY.
- Frame types (N_PCItype) and flow status values.
- Frame layout limits: ISOTP_CAN_DL, ISOTP_SF_MAX_DL, ...
- N_Result codes reported by the link: ISOTP_N_OK, ...
- Big-endian helpers: isotp_get_u32_be, isotp_put_u32_be.
Public Static Functions Documentation¶
function isotp_get_u32_be¶
Read a big-endian 32-bit value.
Parameters:
dataAt least four bytes.
Returns:
The value.
function isotp_put_u32_be¶
Write a 32-bit value in big-endian byte order.
Parameters:
dataAt least four bytes.valueValue to write.
Macro Definition Documentation¶
define ISOTP_BUSY¶
Try again later: transmission in progress or CAN driver busy.
define ISOTP_CAN_DL¶
Data bytes of a classical CAN frame.
define ISOTP_CF_MAX_DATA¶
Payload bytes in a full Consecutive Frame.
define ISOTP_ERROR¶
Invalid argument, malformed frame or insufficient capacity.
define ISOTP_FC_DL¶
Bytes of a Flow Control frame without padding.
define ISOTP_FF_DL_12BIT_MAX¶
Largest length in the 12-bit FF_DL field.
define ISOTP_FF_LONG_DATA¶
Payload bytes in a First Frame with 32-bit FF_DL.
define ISOTP_FF_SHORT_DATA¶
Payload bytes in a First Frame with 12-bit FF_DL.
define ISOTP_FIRST_SN¶
SN of the first Consecutive Frame.
define ISOTP_FS_CONTINUE¶
CTS: continue to send.
define ISOTP_FS_OVERFLOW¶
OVFLW: message longer than the receiver buffer.
define ISOTP_FS_WAIT¶
WAIT: wait for the next Flow Control frame.
define ISOTP_N_BUFFER_OVFLW¶
Message longer than the receiver buffer.
define ISOTP_N_ERROR¶
CAN driver error while sending a frame.
define ISOTP_N_INVALID_FS¶
Sender: Flow Control with an unknown flow status.
define ISOTP_N_OK¶
Completed successfully.
define ISOTP_N_TIMEOUT_A¶
N_As/N_Ar expired (not produced: writes are synchronous).
define ISOTP_N_TIMEOUT_BS¶
Sender: no Flow Control within N_Bs.
define ISOTP_N_TIMEOUT_CR¶
Receiver: no Consecutive Frame within N_Cr.
define ISOTP_N_UNEXP_PDU¶
Receiver: new SF/FF interrupted a reception.
define ISOTP_N_WFT_OVRN¶
Sender: more than N_WFTmax Wait frames.
define ISOTP_N_WRONG_SN¶
Receiver: Consecutive Frame with an unexpected SN.
define ISOTP_OK¶
Success.
define ISOTP_PCI_CONSECUTIVE_FRAME¶
CF: next segment of a message.
define ISOTP_PCI_FIRST_FRAME¶
FF: start of a segmented message.
define ISOTP_PCI_FLOW_CONTROL¶
FC: receiver tells the sender how to continue.
define ISOTP_PCI_SINGLE_FRAME¶
SF: complete message of up to 7 bytes.
define ISOTP_SF_MAX_DL¶
Largest Single Frame payload.
define ISOTP_SN_MASK¶
Sequence numbers count 0..15 and wrap.
define ISOTP_ST_MIN_MAX_US¶
Largest STmin, 0x7F = 127 ms.