|
isotp-c
Platform-independent ISO 15765-2 transport for embedded C
|
Functions that every application supplies to connect ISO-TP to its driver and clock. More...
Functions | |
| void | isotp_user_debug (const char *message,...) |
| Receive a diagnostic message from the library. | |
| int | isotp_user_send_can (const uint32_t arbitration_id, const uint8_t *data, const uint8_t size, const uint8_t flags, void *arg) |
| Submit one CAN or CAN FD frame to the application's driver. | |
| uint32_t | isotp_user_get_us (void) |
| Return the current 32-bit monotonic time in microseconds. | |
Functions that every application supplies to connect ISO-TP to its driver and clock.
| void isotp_user_debug | ( | const char * | message, |
| ... ) |
Receive a diagnostic message from the library.
The application may implement this as a no-op. Calls can occur from any transport API that detects an error. The library does not require the message to be retained after this function returns.
| [in] | message | Diagnostic string or printf-style format. |
| [in] | ... | Optional format arguments. |
| uint32_t isotp_user_get_us | ( | void | ) |
Return the current 32-bit monotonic time in microseconds.
The value must advance independently of call frequency. Natural wraparound at UINT32_MAX is supported.
| int isotp_user_send_can | ( | const uint32_t | arbitration_id, |
| const uint8_t * | data, | ||
| const uint8_t | size, | ||
| const uint8_t | flags, | ||
| void * | arg ) |
Submit one CAN or CAN FD frame to the application's driver.
The implementation must consume or copy data before returning. It may be called synchronously from isotp_send(), isotp_on_can_message(), isotp_receive_streaming(), or isotp_poll().
| [in] | arbitration_id | CAN identifier to transmit. |
| [in] | data | Frame payload, valid only for the duration of this call. |
| [in] | size | Frame payload length. It never exceeds ISO_TP_MAX_CAN_FRAME_SIZE. Lengths above 8 require CAN FD. |
| [in] | flags | Present only with ISO_TP_USER_SEND_CAN_FLAGS. A bitwise OR of ISOTP_CAN_FRAME_FLAG_FD and ISOTP_CAN_FRAME_FLAG_BRS; short frames on a link with TX_DL above 8 still carry the FD flag. |
| [in] | arg | Present only with ISO_TP_USER_SEND_CAN_ARG. This is the link's user_send_can_arg value. |
| ISOTP_RET_OK | The driver accepted the frame. |
| ISOTP_RET_NOSPACE | The driver is temporarily full and a polled Consecutive Frame should be retried. |
| ISOTP_RET_ERROR | The frame could not be submitted. |