ISO transport protocol over CAN (ISO15765)
More...
ISO transport protocol over CAN (ISO15765)
|
file | isotp.h |
| ISO TP high level interface.
|
|
◆ CAN_ISOTP_BS
#define CAN_ISOTP_BS (10) |
Default Block Size for RX Flow Control frames.
Definition at line 38 of file isotp.h.
◆ CAN_ISOTP_DEFAULT_EXT_ADDRESS
#define CAN_ISOTP_DEFAULT_EXT_ADDRESS 0x00 |
◆ CAN_ISOTP_DEFAULT_FLAGS
#define CAN_ISOTP_DEFAULT_FLAGS 0 |
◆ CAN_ISOTP_DEFAULT_FRAME_TXTIME
#define CAN_ISOTP_DEFAULT_FRAME_TXTIME 0 |
◆ CAN_ISOTP_DEFAULT_PAD_CONTENT
#define CAN_ISOTP_DEFAULT_PAD_CONTENT 0xCC /* prevent bit-stuffing */ |
◆ CAN_ISOTP_DEFAULT_RECV_BS
#define CAN_ISOTP_DEFAULT_RECV_BS 0 |
◆ CAN_ISOTP_DEFAULT_RECV_STMIN
#define CAN_ISOTP_DEFAULT_RECV_STMIN 0x00 |
◆ CAN_ISOTP_DEFAULT_RECV_WFTMAX
#define CAN_ISOTP_DEFAULT_RECV_WFTMAX 0 |
◆ CAN_ISOTP_EXTEND_ADDR
#define CAN_ISOTP_EXTEND_ADDR 0x0002 |
enable extended addressing
Definition at line 127 of file isotp.h.
◆ CAN_ISOTP_HALF_DUPLEX
#define CAN_ISOTP_HALF_DUPLEX 0x0040 |
half duplex error state handling
Definition at line 129 of file isotp.h.
◆ CAN_ISOTP_LISTEN_MODE
#define CAN_ISOTP_LISTEN_MODE 0x0001 |
listen only flag (do not send FC)
Definition at line 126 of file isotp.h.
◆ CAN_ISOTP_RX_EXT_ADDR
#define CAN_ISOTP_RX_EXT_ADDR 0x0200 |
different rx extended addressing
Definition at line 130 of file isotp.h.
◆ CAN_ISOTP_RX_FLAGS_MASK
#define CAN_ISOTP_RX_FLAGS_MASK 0x0000FFFF |
rx flags mask
Definition at line 125 of file isotp.h.
◆ CAN_ISOTP_STMIN
#define CAN_ISOTP_STMIN (5) |
Default STmin for RX Flow Control frames.
Definition at line 45 of file isotp.h.
◆ CAN_ISOTP_TX_DONT_WAIT
#define CAN_ISOTP_TX_DONT_WAIT 0x00010000 |
do not send a tx confirmation msg
Definition at line 133 of file isotp.h.
◆ CAN_ISOTP_TX_FLAGS_MASK
#define CAN_ISOTP_TX_FLAGS_MASK 0xFFFF0000 |
tx flags mask
Definition at line 132 of file isotp.h.
◆ CAN_ISOTP_TX_PADDING
#define CAN_ISOTP_TX_PADDING 0x0004 |
enable CAN frame padding tx path
Definition at line 128 of file isotp.h.
◆ CAN_ISOTP_WFTMAX
#define CAN_ISOTP_WFTMAX (1) |
Default maximum WFT for TX Flow Control.
Definition at line 52 of file isotp.h.
◆ isotp_bind()
Bind an isotp channel.
Initialize the channel, set the filter on the DLL and add the channel to the list of bound channels
- Parameters
-
isotp | the channel to bind |
entry | entry identifying the CAN ifnum and the upper layer either by its pid or its mailbox |
fc_options | flow control parameters, bs and stmin for rx, wftmax for tx, if NULL, default values will be used |
arg | upper layer private parameter |
- Returns
- 0 on success, < 0 on error
◆ isotp_free_rx()
Free a received buffer.
This MUST be called by the upper layer when the received data are read
- Parameters
-
◆ isotp_init()
kernel_pid_t isotp_init |
( |
char * |
stack, |
|
|
int |
stacksize, |
|
|
char |
priority, |
|
|
const char * |
name |
|
) |
| |
Initialize the isotp layer.
- Parameters
-
stack | stack for the isotp thread |
stacksize | size of stack |
priority | priority of the isotp thread |
name | name of the isotp thread |
- Returns
- the pid of the isotp thread
◆ isotp_release()
int isotp_release |
( |
struct isotp * |
isotp | ) |
|
Release a bound isotp channel.
Unset the filter on the DLL and remove the channel from the list of bound channels
- Parameters
-
isotp | the channel to release |
- Returns
- 0 on success, < 0 on error
◆ isotp_send()
int isotp_send |
( |
struct isotp * |
isotp, |
|
|
const void * |
buf, |
|
|
int |
len, |
|
|
int |
flags |
|
) |
| |
Send data through an isotp channel.
- Parameters
-
isotp | the channel to use |
buf | the data to send |
len | length of the data to send |
flags | flags for sending |
- Returns
- the number of bytes sent
-
< 0 if an error occurred (-EBUSY, -ENOMEM)