]> git.enpas.org Git - revag-bap.git/blob - vw-bap.h
Rename SubNode -> Node
[revag-bap.git] / vw-bap.h
1 #ifndef __VW_BAP_H__
2 #define __VW_BAP_H__
3
4 #include <linux/can.h>
5
6
7 typedef unsigned char BAP_OpCode;
8 typedef unsigned char BAP_Node;
9 typedef unsigned char BAP_Function;
10 typedef unsigned short BAP_FrameLen;
11
12
13 struct BAP_Frame {
14         /* True if frame was/will be transmitted in multi-frame syntax */
15         int is_multiframe;
16
17         BAP_OpCode opcode;
18         BAP_Node node;
19         BAP_Function function;
20         BAP_FrameLen len;
21
22         char data[4096];
23 };
24
25
26 struct BAP_RXer {
27         /* Temporary storage for incomplete frames */
28         struct BAP_Frame *mfchannel[8];
29
30         /* How many bytes have we already received on each channel? */
31         BAP_FrameLen len_done[8];
32 };
33
34
35
36
37
38 void vw_bap_frame_dump(struct BAP_Frame *bap_frame);
39
40 struct BAP_Frame* vw_bap_handle_can_frame(struct BAP_RXer *bap, struct can_frame *frame);
41
42 void vw_bap_frame_free(struct BAP_Frame *bap_frame);
43
44 struct BAP_RXer* vw_bap_alloc();
45 void vw_bap_free(struct BAP_RXer *bap);
46
47
48 #endif