7 typedef unsigned char BAP_OpCode;
8 typedef unsigned char BAP_Node;
9 typedef unsigned char BAP_Function;
10 typedef unsigned short BAP_FrameLen;
13 /* A BAP frame at the BCL (BAP communication layer) as defined in
14 * http://www.itwissen.info/BCL-BAP-communication-layer.html
16 * This is basically BAP's equivalent of IP and TCP.
19 /* True if frame was/will be transmitted in multi-frame syntax */
23 /* Request/reply, kind of */
26 /* LSG = Logisches Steuergeraet
27 * https://www.springerprofessional.de/technische-informatik/eingebettete-systeme/neues-protokoll-vereinfacht-kommunikation-von-steuergeraeten/6592480
29 * BAP's equivalent of an IP address (to be confirmed).
31 * Always the same per CAN ID in the (simple) devices I looked at.
35 /* The "RPC" function, or "status register" ID.
37 * BAP's equivalent of a "TCP port".
39 BAP_Function function;
41 /* Payload length, up to 2^12 = 4096 bytes.
43 * 4095 bytes according to:
44 * http://www.itwissen.info/BCL-BAP-communication-layer.html
56 /* Temporary storage for incomplete frames */
57 struct BAP_Frame *mfchannel[8];
59 /* How many bytes have we already received on each channel? */
60 BAP_FrameLen len_done[8];
65 /* BAP frame struct handling */
66 struct BAP_Frame* vw_bap_frame_alloc(void);
67 void vw_bap_frame_free(struct BAP_Frame *bap_frame);
69 int vw_bap_frame_is_valid(struct BAP_Frame *bap_frame);
71 void vw_bap_frame_dump(struct BAP_Frame *bap_frame);
75 struct BAP_Frame* vw_bap_handle_can_frame(struct BAP_RXer *bap, struct can_frame *frame);
76 struct BAP_RXer* vw_bap_rxer_alloc();
77 void vw_bap_rxer_free(struct BAP_RXer *bap);