1#ifndef __ISOTP_USER_H__
2#define __ISOTP_USER_H__
14
15
16
17
18
20 const uint8_t* data,
const uint8_t size);
23
24
void isotp_on_can_message(IsoTpLink *link, uint8_t *data, uint8_t len)
Handles incoming CAN messages. Determines whether an incoming message is a valid ISO-TP frame or not ...
static int isotp_send_single_frame(IsoTpLink *link, uint32_t id)
static int isotp_send_consecutive_frame(IsoTpLink *link)
static int isotp_receive_first_frame(IsoTpLink *link, IsoTpCanMessage *message, uint8_t len)
int isotp_receive(IsoTpLink *link, uint8_t *payload, const uint16_t payload_size, uint16_t *out_size)
Receives and parses the received data and copies the parsed data in to the internal buffer.
static int isotp_receive_consecutive_frame(IsoTpLink *link, IsoTpCanMessage *message, uint8_t len)
static int isotp_receive_flow_control_frame(IsoTpLink *link, IsoTpCanMessage *message, uint8_t len)
static int isotp_send_flow_control(IsoTpLink *link, uint8_t flow_status, uint8_t block_size, uint32_t st_min_us)
void isotp_init_link(IsoTpLink *link, uint32_t sendid, uint8_t *sendbuf, uint16_t sendbufsize, uint8_t *recvbuf, uint16_t recvbufsize)
Initialises the ISO-TP library.
void isotp_poll(IsoTpLink *link)
Polling function; call this function periodically to handle timeouts, send consecutive frames,...
static uint8_t isotp_us_to_st_min(uint32_t us)
STATIC FUNCTIONS ///.
int isotp_send_with_id(IsoTpLink *link, uint32_t id, const uint8_t payload[], uint16_t size)
See isotp_send, with the exception that this function is used only for functional addressing.
static uint32_t isotp_st_min_to_us(uint8_t st_min)
static int isotp_send_first_frame(IsoTpLink *link, uint32_t id)
int isotp_send(IsoTpLink *link, const uint8_t payload[], uint16_t size)
PUBLIC FUNCTIONS ///.
static int isotp_receive_single_frame(IsoTpLink *link, IsoTpCanMessage *message, uint8_t len)
#define ISO_TP_MAX_WFT_NUMBER
#define ISO_TP_DEFAULT_ST_MIN_US
#define ISO_TP_DEFAULT_RESPONSE_TIMEOUT_US
#define ISO_TP_DEFAULT_BLOCK_SIZE
@ ISOTP_RECEIVE_STATUS_FULL
@ ISOTP_RECEIVE_STATUS_IDLE
@ ISOTP_RECEIVE_STATUS_INPROGRESS
#define ISOTP_RET_NOSPACE
#define ISOTP_PROTOCOL_RESULT_BUFFER_OVFLW
#define ISOTP_PROTOCOL_RESULT_UNEXP_PDU
#define ISOTP_RET_NO_DATA
#define ISOTP_PROTOCOL_RESULT_OK
#define ISOTP_RET_OVERFLOW
#define ISOTP_PROTOCOL_RESULT_TIMEOUT_CR
@ ISOTP_SEND_STATUS_ERROR
@ ISOTP_SEND_STATUS_INPROGRESS
#define ISOTP_PROTOCOL_RESULT_TIMEOUT_BS
#define ISOTP_RET_WRONG_SN
#define ISOTP_PROTOCOL_RESULT_WFT_OVRN
#define ISOTP_RET_INPROGRESS
@ PCI_FLOW_STATUS_OVERFLOW
@ PCI_FLOW_STATUS_CONTINUE
@ TSOTP_PCI_TYPE_CONSECUTIVE_FRAME
@ ISOTP_PCI_TYPE_FIRST_FRAME
@ ISOTP_PCI_TYPE_FLOW_CONTROL_FRAME
#define IsoTpTimeAfter(a, b)
#define ISOTP_PROTOCOL_RESULT_WRONG_SN
void isotp_user_debug(const char *message,...)
user implemented, print debug message
int isotp_user_send_can(const uint32_t arbitration_id, const uint8_t *data, const uint8_t size)
user implemented, send can message. should return ISOTP_RET_OK when success.
uint32_t isotp_user_get_us(void)
user implemented, gets the amount of time passed since the last call in microseconds
IsoTpDataArray data_array
IsoTpFirstFrame first_frame
IsoTpConsecutiveFrame consecutive_frame
IsoTpSingleFrame single_frame
IsoTpFlowControl flow_control
Struct containing the data for linking an application to a CAN instance. The data stored in this stru...
uint32_t receive_timer_cr
uint32_t receive_arbitration_id
uint16_t receive_buf_size
int receive_protocol_result
uint32_t send_arbitration_id