10 void* message_received_callback;
11 void* message_sent_callback;
12 void* can_frame_sent_callback;
17 uint8_t* receive_buffer;
18 uint16_t received_buffer_size;
19 uint16_t incoming_message_size;
27 PCI_CONSECUTIVE_FRAME,
28 PCI_FLOW_CONTROL_FRAME
29 } IsoTpProtocolControlInformation;
32 PCI_FLOW_STATUS_CONTINUE,
34 PCI_FLOW_STATUS_OVERFLOW
37 const uint16_t MAX_ISO_TP_MESSAGE_SIZE = 4096;
38 const uint16_t MAX_CAN_FRAME_SIZE = 8;
39 const uint8_t ISO_TP_DEFAULT_RESPONSE_TIMEOUT = 100;
40 const bool ISO_TP_DEFAULT_FRAME_PADDING_STATUS = true;
42 IsoTpHandler isotp_init(uint16_t arbitration_id,
43 IsoTpMessageReceivedHandler* message_received_callback,
44 IsoTpMessageSentHandler* message_sent_callback,
45 IsoTpCanFrameSentHandler* can_frame_sent_callback);
47 void isotp_set_timeout(uint16_t timeout);
49 // TODO we have to make sure to copy the payload internall if it's more than 1
50 // frame, the soure could go out of scope
51 bool isotp_send(const uint8_t* payload, uint16_t payload_size);
53 void isotp_receive_can_frame(const uint16_t arbitration_id, const uint8_t* data,
54 const uint8_t length);
56 void isotp_destroy(IsoTpHandler* handler);