File syn_lintp.c¶
FileList > proto > syn_lintp.c
Go to the source code of this file
ISO 17987-2 (LIN Transport Layer & Network Layer Services / UDSonLIN). More...
#include "syn_lintp.h"#include <string.h>
Public Functions¶
| Type | Name |
|---|---|
| bool | syn_lintp_get_tx_frame (SYN_LINTP_Link * link, uint8_t out_frame) Retrieve next queued 8-byte LIN diagnostic payload to transmit on bus (0x3C / 0x3D). |
| void | syn_lintp_init (SYN_LINTP_Link * link, uint8_t nad, uint8_t * rx_buf, size_t rx_size, uint8_t * tx_buf, size_t tx_size) Initialize LIN TP Link context. |
| bool | syn_lintp_is_tx_idle (const SYN_LINTP_Link * link) Check if LIN TP TX engine is idle and ready for new message. |
| void | syn_lintp_process_rx_frame (SYN_LINTP_Link * link, const uint8_t frame) Process an incoming 8-byte LIN diagnostic frame received from bus (0x3C / 0x3D). |
| ssize_t | syn_lintp_receive (SYN_LINTP_Link * link, uint8_t * out_buf, size_t max_len) Read a fully reassembled message payload from the LIN TP receiver. |
| SYN_Status | syn_lintp_send (SYN_LINTP_Link * link, uint8_t nad, const uint8_t * payload, size_t len) Queue a message for multi-frame or single-frame LIN TP transmission. |
| void | syn_lintp_set_padding (SYN_LINTP_Link * link, uint8_t pad_byte) Configure padding byte value for unused frame bytes. |
| void | syn_lintp_set_timeouts (SYN_LINTP_Link * link, uint32_t n_as_ms, uint32_t n_cr_ms) Configure LIN TP timeouts in milliseconds. |
| void | syn_lintp_step (SYN_LINTP_Link * link, uint32_t dt_ms) Step LIN TP timers by dt_ms. |
Detailed Description¶
Implements non-blocking, zero-allocation ISO 17987-2 LIN TP segmentation and reassembly state machine.
Public Functions Documentation¶
function syn_lintp_get_tx_frame¶
Retrieve next queued 8-byte LIN diagnostic payload to transmit on bus (0x3C / 0x3D).
Parameters:
linkPointer to LIN TP link context.out_frameArray of 8 bytes to receive frame data.
Returns:
true if a frame was ready and copied, false otherwise.
function syn_lintp_init¶
Initialize LIN TP Link context.
void syn_lintp_init (
SYN_LINTP_Link * link,
uint8_t nad,
uint8_t * rx_buf,
size_t rx_size,
uint8_t * tx_buf,
size_t tx_size
)
Parameters:
linkPointer to LIN TP link structure.nadNode Address (NAD) for this device (0x01..0x7D).rx_bufPointer to buffer for storing received payloads.rx_sizeSize of RX buffer.tx_bufPointer to buffer reserved for TX (optional context pointer).tx_sizeSize of TX buffer.
function syn_lintp_is_tx_idle¶
Check if LIN TP TX engine is idle and ready for new message.
Parameters:
linkPointer to LIN TP link context.
Returns:
true if idle, false if actively transmitting a message.
function syn_lintp_process_rx_frame¶
Process an incoming 8-byte LIN diagnostic frame received from bus (0x3C / 0x3D).
Parameters:
linkPointer to LIN TP link context.framePointer to 8-byte received LIN frame payload.
function syn_lintp_receive¶
Read a fully reassembled message payload from the LIN TP receiver.
Parameters:
linkPointer to LIN TP link context.out_bufBuffer to receive assembled payload.max_lenMaximum bytes to copy.
Returns:
Number of payload bytes read, 0 if no complete message ready, or negative error code.
function syn_lintp_send¶
Queue a message for multi-frame or single-frame LIN TP transmission.
SYN_Status syn_lintp_send (
SYN_LINTP_Link * link,
uint8_t nad,
const uint8_t * payload,
size_t len
)
Parameters:
linkPointer to LIN TP link context.nadDestination NAD.payloadPointer to payload bytes to send.lenPayload length in bytes (1..4095).
Returns:
SYN_OK on success, or error status code.
function syn_lintp_set_padding¶
Configure padding byte value for unused frame bytes.
Parameters:
linkPointer to LIN TP link context.pad_byteFill byte value (default 0xFF).
function syn_lintp_set_timeouts¶
Configure LIN TP timeouts in milliseconds.
Parameters:
linkPointer to LIN TP link context.n_as_msMax frame TX time (default 1000ms).n_cr_msMax time between consecutive RX frames (default 1000ms).
function syn_lintp_step¶
Step LIN TP timers by dt_ms.
Parameters:
linkPointer to LIN TP link context.dt_msMilliseconds elapsed since last step call.
The documentation for this class was generated from the following file src/syntropic/proto/syn_lintp.c