File syn_isotp.c¶
FileList > proto > syn_isotp.c
Go to the source code of this file
ISO 15765-2 (ISO-TP) Multi-Frame CAN Transport implementation.
#include "../util/syn_assert.h"#include "../util/syn_pack.h"#include "syn_isotp.h"#include <string.h>
Public Functions¶
| Type | Name |
|---|---|
| bool | syn_isotp_get_tx_frame (SYN_ISOTP_Link * link, SYN_CAN_Frame * frame) Retrieve next pending outgoing CAN frame from ISO-TP engine. |
| void | syn_isotp_init (SYN_ISOTP_Link * link, uint32_t rx_id, uint32_t tx_id, uint8_t * rx_buf, size_t rx_buf_size, uint8_t * tx_buf, size_t tx_buf_size) Initialize ISO-TP Link in Classic CAN mode (8-byte frames). |
| void | syn_isotp_process_rx_frame (SYN_ISOTP_Link * link, const SYN_CAN_Frame * frame) Process an incoming CAN frame into the ISO-TP engine. |
| ssize_t | syn_isotp_receive (SYN_ISOTP_Link * link, uint8_t * out_buf, size_t max_len) Read completed assembled message from ISO-TP receiver. |
| SYN_Status | syn_isotp_send (SYN_ISOTP_Link * link, const uint8_t * payload, size_t payload_len) Initiate transmission of a multi-byte payload. |
| void | syn_isotp_set_timeouts (SYN_ISOTP_Link * link, uint32_t n_bs_ms, uint32_t n_cr_ms) Configure custom ISO 15765-2 network layer timeouts. |
| void | syn_isotp_step (SYN_ISOTP_Link * link, uint32_t dt_ms) Step ISO-TP timers (milliseconds). |
| void | syn_isotp_step_us (SYN_ISOTP_Link * link, uint32_t dt_us) Step ISO-TP timers (microseconds for fine STmin pacing). |
Public Static Functions¶
| Type | Name |
|---|---|
| uint32_t | syn_isotp_decode_stmin_us (uint8_t st_min) |
Public Functions Documentation¶
function syn_isotp_get_tx_frame¶
Retrieve next pending outgoing CAN frame from ISO-TP engine.
Parameters:
linkLink handle.frameOutput CAN frame buffer.
Returns:
true if a frame was generated, false otherwise.
function syn_isotp_init¶
Initialize ISO-TP Link in Classic CAN mode (8-byte frames).
void syn_isotp_init (
SYN_ISOTP_Link * link,
uint32_t rx_id,
uint32_t tx_id,
uint8_t * rx_buf,
size_t rx_buf_size,
uint8_t * tx_buf,
size_t tx_buf_size
)
Parameters:
linkLink handle.rx_idIncoming CAN identifier.tx_idOutgoing CAN identifier.rx_bufReceive assembly buffer.rx_buf_sizeReceive buffer capacity.tx_bufTransmit buffer.tx_buf_sizeTransmit buffer capacity.
function syn_isotp_process_rx_frame¶
Process an incoming CAN frame into the ISO-TP engine.
Parameters:
linkLink handle.frameIncoming CAN frame.
function syn_isotp_receive¶
Read completed assembled message from ISO-TP receiver.
Parameters:
linkLink handle.out_bufOutput buffer.max_lenCapacity of out_buf.
Returns:
Number of bytes copied, or -1 if no message ready.
function syn_isotp_send¶
Initiate transmission of a multi-byte payload.
Parameters:
linkLink handle.payloadPayload buffer.payload_lenLength of payload (1 to max buffer capacity).
Returns:
SYN_OK on success, error code on busy/invalid params.
function syn_isotp_set_timeouts¶
Configure custom ISO 15765-2 network layer timeouts.
Parameters:
linkLink handle.n_bs_msN_Bs max timeout in milliseconds (0 = use default 1000ms).n_cr_msN_Cr max timeout in milliseconds (0 = use default 1000ms).
function syn_isotp_step¶
Step ISO-TP timers (milliseconds).
Parameters:
linkLink handle.dt_msElapsed time in milliseconds.
function syn_isotp_step_us¶
Step ISO-TP timers (microseconds for fine STmin pacing).
Parameters:
linkLink handle.dt_usElapsed time in microseconds.
Public Static Functions Documentation¶
function syn_isotp_decode_stmin_us¶
The documentation for this class was generated from the following file src/syntropic/proto/syn_isotp.c