ISO transport protocol over CAN (ISO15765)
More...
ISO transport protocol over CAN (ISO15765)
|
file | isotp.h |
| ISO TP high level interface.
|
|
|
#define | CAN_ISOTP_DEFAULT_FLAGS 0 |
|
#define | CAN_ISOTP_DEFAULT_EXT_ADDRESS 0x00 |
|
#define | CAN_ISOTP_DEFAULT_PAD_CONTENT 0xCC /* prevent bit-stuffing */ |
|
#define | CAN_ISOTP_DEFAULT_FRAME_TXTIME 0 |
|
#define | CAN_ISOTP_DEFAULT_RECV_BS 0 |
|
#define | CAN_ISOTP_DEFAULT_RECV_STMIN 0x00 |
|
#define | CAN_ISOTP_DEFAULT_RECV_WFTMAX 0 |
|
◆ 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)