LIN Middleware
Raw Transport Layer

General Description

Functions

void ld_put_raw (l_ifc_handle iii, const l_u8 *const ld_data, mtb_stc_lin_context_t *context)
 This function is used to allow the application code to send data using the Transport Layer. More...
 
void ld_get_raw (l_ifc_handle iii, l_u8 *const ld_data, mtb_stc_lin_context_t *context)
 This function is used to allow the application code to receive data using the Transport Layer. More...
 
l_u8 ld_raw_tx_status (l_ifc_handle iii, const mtb_stc_lin_context_t *context)
 This call returns the status of the last performed frame transmission on the bus when a raw API was used. More...
 
l_u8 ld_raw_rx_status (l_ifc_handle iii, const mtb_stc_lin_context_t *context)
 The call returns the status of the raw frame receive function. More...
 

Function Documentation

◆ ld_put_raw()

void ld_put_raw ( l_ifc_handle  iii,
const l_u8 *const  ld_data,
mtb_stc_lin_context_t context 
)

This function is used to allow the application code to send data using the Transport Layer.

It essentially copies 8 bytes of data from a user application array to a frame buffer array. The data is sent in the next suitable frame (Slave response frame).

The data area will be copied in the call, the pointer will not be memorized.

This function is used to send one frame of a complete message at a time. Therefore, a multiframe message requires multiple calls to this function.

Always check ld_raw_tx_status() to see if there is a place for the frame in the buffer before calling this function. If no more queue resources are available, the data may be jettisoned and the appropriate error status will be set.

Note
In J2602 compliance mode, the J2602 Status is sent in the first byte of each frame when:
  • using 0x3C messages with NADs in the User reserved range of 0x80 - 0xFF
  • using 0x3E messages with any NAD, so only 7 bytes of the data can be sent. There is no need to place NAD as first byte of user data.
Parameters
iiiThe name of the interface handle. The parameter is not used within the middleware as the interface is defined by the context parameter. See l_ifc_handle.
ld_dataThe array of data to be sent.
contextThe pointer to the context structure mtb_stc_lin_context_t allocated by the user. This structure is used during LIN Slave operation for internal configuration and data retention. The user must not modify anything in this structure.

◆ ld_get_raw()

void ld_get_raw ( l_ifc_handle  iii,
l_u8 *const  ld_data,
mtb_stc_lin_context_t context 
)

This function is used to allow the application code to receive data using the Transport Layer.

It essentially copies some data from a frame buffer array to a user application array.

This function is used to receive one frame of a complete Transport Layer message at a time. Therefore, a multiframe Transport Layer message requires multiple calls to this API function.

If the receive queue is empty, no data will be copied. Always check ld_raw_rx_status() to ensure there is data in the queue before calling this function.

Parameters
iiiThe interface handle. See l_ifc_handle.
ld_dataThe array to which the oldest received diagnostic frame data is copied.
contextThe pointer to the context structure mtb_stc_lin_context_t allocated by the user. This structure is used during LIN Slave operation for internal configuration and data retention. The user must not modify anything in this structure.

◆ ld_raw_tx_status()

l_u8 ld_raw_tx_status ( l_ifc_handle  iii,
const mtb_stc_lin_context_t context 
)

This call returns the status of the last performed frame transmission on the bus when a raw API was used.

Parameters
iiiThe interface handle. See l_ifc_handle.
contextThe pointer to the context structure mtb_stc_lin_context_t allocated by the user. This structure is used during LIN Slave operation for internal configuration and data retention. The user must not modify anything in this structure.
Returns
Transport Layer Status

◆ ld_raw_rx_status()

l_u8 ld_raw_rx_status ( l_ifc_handle  iii,
const mtb_stc_lin_context_t context 
)

The call returns the status of the raw frame receive function.

Parameters
iiiThe name of the interface handle. The parameter is not used within the middleware as the interface is defined by the context parameter. See l_ifc_handle.
contextThe pointer to the context structure mtb_stc_lin_context_t allocated by the user. This structure is used during LIN Slave operation for internal configuration and data retention. The user must not modify anything in this structure.
Returns
Transport Layer Status