18
19
20
21
37
38
52
53
59
60
61
62
63
64
65
66
67
69 uint8_t *sendbuf, uint16_t sendbufsize,
70 uint8_t *recvbuf, uint16_t recvbufsize);
73
74
75
76
80
81
82
83
84
85
86
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105int isotp_send(IsoTpLink *link,
const uint8_t payload[], uint16_t size);
108
109
110int isotp_send_with_id(IsoTpLink *link, uint32_t id,
const uint8_t payload[], uint16_t size);
113
114
115
116
117
118
119
120
121
122
123int isotp_receive(IsoTpLink *link, uint8_t *payload,
const uint16_t payload_size, uint16_t *out_size);
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