Split up functions in send/receive files for clarity.
[apps/agl-service-can-low-level.git] / src / isotp / send.h
1 #ifndef __ISOTP_SEND_H__
2 #define __ISOTP_SEND_H__
3
4 #include <isotp/isotp.h>
5 #include <stdint.h>
6 #include <stdbool.h>
7
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11
12 typedef struct {
13     bool success;
14     bool completed;
15     uint16_t sending_arbitration_id;
16     uint16_t receiving_arbitration_id;
17     IsoTpMessageSentHandler message_sent_callback;
18     IsoTpCanFrameSentHandler can_frame_sent_callback;
19     // TODO going to need some state here for multi frame messages
20 } IsoTpSendHandle;
21
22 bool isotp_continue_send(IsoTpShims* shims, IsoTpSendHandle* handle,
23         const uint16_t arbitration_id, const uint8_t data[],
24         const uint8_t size);
25
26 IsoTpSendHandle isotp_send(IsoTpShims* shims, const uint16_t arbitration_id,
27         const uint8_t payload[], uint16_t size,
28         IsoTpMessageSentHandler callback);
29
30 #ifdef __cplusplus
31 }
32 #endif
33
34 #endif // __ISOTP_SEND_H__