Group isotp_user¶
User-implemented callbacks and platform hooks. More...
Public Functions¶
| Type | Name |
|---|---|
| void | isotp_user_debug (const char * message, ...) User implemented, print debug message. |
| uint32_t | isotp_user_get_us (void) User implemented, return a monotonically increasing timebase in microseconds. |
| int | isotp_user_send_can (const uint32_t arbitration_id, const uint8_t * data, const uint8_t size) User implemented, send CAN message. |
Detailed Description¶
This group defines the platform abstraction points required by the ISO-TP core. Applications must provide these functions to integrate with their CAN driver, timing source, and optional debug output.
** **
- Debug output hook: isotp_user_debug.
- CAN transmit hook: isotp_user_send_can (optionally with ISO_TP_USER_SEND_CAN_ARG).
- Time source hook: isotp_user_get_us.
Public Functions Documentation¶
function isotp_user_debug¶
User implemented, print debug message.
void isotp_user_debug (
const char * message,
...
)
Parameters:
messageDebug message format string.
User implemented, print debug message.
Parameters:
messageThe message to print.
User implemented, print debug message.
function isotp_user_get_us¶
User implemented, return a monotonically increasing timebase in microseconds.
uint32_t isotp_user_get_us (
void
)
This function must provide a free-running timestamp in microseconds that increases monotonically over time. The ISO-TP core uses this value for timeout and delay calculations by performing arithmetic on the returned timestamp (for example, adding a timeout interval to it).
Natural wrap-around of the 32-bit counter is allowed and will be handled by the ISO-TP core, but the value must not jump backwards except for such wrap-around.
Returns:
Current timebase value in microseconds.
User implemented, return a monotonically increasing timebase in microseconds.
Returns:
uint32_t Current time in microseconds
User implemented, return a monotonically increasing timebase in microseconds.
function isotp_user_send_can¶
User implemented, send CAN message.
int isotp_user_send_can (
const uint32_t arbitration_id,
const uint8_t * data,
const uint8_t size
)
Should return ISOTP_RET_OK on success.
Parameters:
arbitration_idCAN message arbitration ID.dataPointer to message data buffer.sizeSize of message data in bytes.
Returns:
ISOTP_RET_OK on success, ISOTP_RET_NOSPACE if transfer should be retried later, or ISOTP_RET_ERROR on failure.
User implemented, send CAN message.
Parameters:
arbitration_idThe CAN ID to send with.dataPointer to the data buffer to send.sizeSize of the data buffer (max 8 bytes).
Returns:
int ISOTP_RET_OK on success, ISOTP_RET_ERROR on failure.
User implemented, send CAN message.