7 typedef unsigned char BAP_OpCode;
8 typedef unsigned char BAP_Node;
9 typedef unsigned char BAP_Port;
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" port, or "status register" ID.
37 * BAP's equivalent of a "UDP port".
41 /* Payload length, up to 2^12-1 = 4095 bytes. */
52 /* Temporary storage for incomplete frames */
53 struct BAP_Frame *mfchannel[8];
55 /* How many bytes have we already received on each channel? */
56 BAP_FrameLen len_done[8];
61 /* Temporary storage for frames not yet fully sent */
62 struct BAP_Frame *slot[4];
64 /* How many bytes have we already sent on each channel? */
65 BAP_FrameLen slot_done[4];
70 /* BAP frame struct handling */
71 struct BAP_Frame* vw_bap_frame_alloc(void);
72 void vw_bap_frame_free(struct BAP_Frame *bap_frame);
74 int vw_bap_frame_is_valid(struct BAP_Frame *bap_frame);
76 struct BAP_Frame* vw_bap_frame_clone(struct BAP_Frame *bap_frame);
78 void vw_bap_frame_dump(struct BAP_Frame *bap_frame);
82 struct BAP_Frame* vw_bap_handle_can_frame(struct BAP_RXer *bap, struct can_frame *frame);
83 struct BAP_RXer* vw_bap_rxer_alloc();
84 void vw_bap_rxer_free(struct BAP_RXer *bap);
87 /* BAP transmission */
88 int vw_bap_txer_queue(struct BAP_TXer* bap, struct BAP_Frame *bap_frame, struct can_frame *frame);
89 struct BAP_TXer* vw_bap_txer_alloc();
90 void vw_bap_txer_free(struct BAP_TXer *bap);