Skip to content

Group isotp_defs

Modules > 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 -2
Try again later: transmission in progress or CAN driver busy.
define ISOTP_CAN_DL 8U
Data bytes of a classical CAN frame.
define ISOTP_CF_MAX_DATA 7U
Payload bytes in a full Consecutive Frame.
define ISOTP_ERROR -1
Invalid argument, malformed frame or insufficient capacity.
define ISOTP_FC_DL 3U
Bytes of a Flow Control frame without padding.
define ISOTP_FF_DL_12BIT_MAX 4095U
Largest length in the 12-bit FF_DL field.
define ISOTP_FF_LONG_DATA 2U
Payload bytes in a First Frame with 32-bit FF_DL.
define ISOTP_FF_SHORT_DATA 6U
Payload bytes in a First Frame with 12-bit FF_DL.
define ISOTP_FIRST_SN 1U
SN of the first Consecutive Frame.
define ISOTP_FS_CONTINUE 0x0U
CTS: continue to send.
define ISOTP_FS_OVERFLOW 0x2U
OVFLW: message longer than the receiver buffer.
define ISOTP_FS_WAIT 0x1U
WAIT: wait for the next Flow Control frame.
define ISOTP_N_BUFFER_OVFLW -8
Message longer than the receiver buffer.
define ISOTP_N_ERROR -9
CAN driver error while sending a frame.
define ISOTP_N_INVALID_FS -5
Sender: Flow Control with an unknown flow status.
define ISOTP_N_OK 0
Completed successfully.
define ISOTP_N_TIMEOUT_A -1
N_As/N_Ar expired (not produced: writes are synchronous).
define ISOTP_N_TIMEOUT_BS -2
Sender: no Flow Control within N_Bs.
define ISOTP_N_TIMEOUT_CR -3
Receiver: no Consecutive Frame within N_Cr.
define ISOTP_N_UNEXP_PDU -6
Receiver: new SF/FF interrupted a reception.
define ISOTP_N_WFT_OVRN -7
Sender: more than N_WFTmax Wait frames.
define ISOTP_N_WRONG_SN -4
Receiver: Consecutive Frame with an unexpected SN.
define ISOTP_OK 0
Success.
define ISOTP_PCI_CONSECUTIVE_FRAME 0x2U
CF: next segment of a message.
define ISOTP_PCI_FIRST_FRAME 0x1U
FF: start of a segmented message.
define ISOTP_PCI_FLOW_CONTROL 0x3U
FC: receiver tells the sender how to continue.
define ISOTP_PCI_SINGLE_FRAME 0x0U
SF: complete message of up to 7 bytes.
define ISOTP_SF_MAX_DL 7U
Largest Single Frame payload.
define ISOTP_SN_MASK 0x0FU
Sequence numbers count 0..15 and wrap.
define ISOTP_ST_MIN_MAX_US 127000U
Largest 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.

** **

Public Static Functions Documentation

function isotp_get_u32_be

Read a big-endian 32-bit value.

static inline uint32_t isotp_get_u32_be (
    const uint8_t * data
) 

Parameters:

  • data At least four bytes.

Returns:

The value.


function isotp_put_u32_be

Write a 32-bit value in big-endian byte order.

static inline void isotp_put_u32_be (
    uint8_t * data,
    uint32_t value
) 

Parameters:

  • data At least four bytes.
  • value Value to write.

Macro Definition Documentation

define ISOTP_BUSY

Try again later: transmission in progress or CAN driver busy.

#define ISOTP_BUSY `-2`


define ISOTP_CAN_DL

Data bytes of a classical CAN frame.

#define ISOTP_CAN_DL `8U`


define ISOTP_CF_MAX_DATA

Payload bytes in a full Consecutive Frame.

#define ISOTP_CF_MAX_DATA `7U`


define ISOTP_ERROR

Invalid argument, malformed frame or insufficient capacity.

#define ISOTP_ERROR `-1`


define ISOTP_FC_DL

Bytes of a Flow Control frame without padding.

#define ISOTP_FC_DL `3U`


define ISOTP_FF_DL_12BIT_MAX

Largest length in the 12-bit FF_DL field.

#define ISOTP_FF_DL_12BIT_MAX `4095U`


define ISOTP_FF_LONG_DATA

Payload bytes in a First Frame with 32-bit FF_DL.

#define ISOTP_FF_LONG_DATA `2U`


define ISOTP_FF_SHORT_DATA

Payload bytes in a First Frame with 12-bit FF_DL.

#define ISOTP_FF_SHORT_DATA `6U`


define ISOTP_FIRST_SN

SN of the first Consecutive Frame.

#define ISOTP_FIRST_SN `1U`


define ISOTP_FS_CONTINUE

CTS: continue to send.

#define ISOTP_FS_CONTINUE `0x0U`


define ISOTP_FS_OVERFLOW

OVFLW: message longer than the receiver buffer.

#define ISOTP_FS_OVERFLOW `0x2U`


define ISOTP_FS_WAIT

WAIT: wait for the next Flow Control frame.

#define ISOTP_FS_WAIT `0x1U`


define ISOTP_N_BUFFER_OVFLW

Message longer than the receiver buffer.

#define ISOTP_N_BUFFER_OVFLW `-8`


define ISOTP_N_ERROR

CAN driver error while sending a frame.

#define ISOTP_N_ERROR `-9`


define ISOTP_N_INVALID_FS

Sender: Flow Control with an unknown flow status.

#define ISOTP_N_INVALID_FS `-5`


define ISOTP_N_OK

Completed successfully.

#define ISOTP_N_OK `0`


define ISOTP_N_TIMEOUT_A

N_As/N_Ar expired (not produced: writes are synchronous).

#define ISOTP_N_TIMEOUT_A `-1`


define ISOTP_N_TIMEOUT_BS

Sender: no Flow Control within N_Bs.

#define ISOTP_N_TIMEOUT_BS `-2`


define ISOTP_N_TIMEOUT_CR

Receiver: no Consecutive Frame within N_Cr.

#define ISOTP_N_TIMEOUT_CR `-3`


define ISOTP_N_UNEXP_PDU

Receiver: new SF/FF interrupted a reception.

#define ISOTP_N_UNEXP_PDU `-6`


define ISOTP_N_WFT_OVRN

Sender: more than N_WFTmax Wait frames.

#define ISOTP_N_WFT_OVRN `-7`


define ISOTP_N_WRONG_SN

Receiver: Consecutive Frame with an unexpected SN.

#define ISOTP_N_WRONG_SN `-4`


define ISOTP_OK

Success.

#define ISOTP_OK `0`


define ISOTP_PCI_CONSECUTIVE_FRAME

CF: next segment of a message.

#define ISOTP_PCI_CONSECUTIVE_FRAME `0x2U`


define ISOTP_PCI_FIRST_FRAME

FF: start of a segmented message.

#define ISOTP_PCI_FIRST_FRAME `0x1U`


define ISOTP_PCI_FLOW_CONTROL

FC: receiver tells the sender how to continue.

#define ISOTP_PCI_FLOW_CONTROL `0x3U`


define ISOTP_PCI_SINGLE_FRAME

SF: complete message of up to 7 bytes.

#define ISOTP_PCI_SINGLE_FRAME `0x0U`


define ISOTP_SF_MAX_DL

Largest Single Frame payload.

#define ISOTP_SF_MAX_DL `7U`


define ISOTP_SN_MASK

Sequence numbers count 0..15 and wrap.

#define ISOTP_SN_MASK `0x0FU`


define ISOTP_ST_MIN_MAX_US

Largest STmin, 0x7F = 127 ms.

#define ISOTP_ST_MIN_MAX_US `127000U`