blob: 9930cfb3862a7929604e895e21c49f5388984031 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
#ifndef __VW_BAP_H__
#define __VW_BAP_H__
#include <linux/can.h>
typedef unsigned char BAP_OpCode;
typedef unsigned char BAP_Node;
typedef unsigned char BAP_Function;
typedef unsigned short BAP_FrameLen;
/* A BAP frame at the BCL (BAP communication layer) as defined in
* http://www.itwissen.info/BCL-BAP-communication-layer.html
*
* This is basically BAP's equivalent of IP and TCP.
*/
struct BAP_Frame {
/* True if frame was/will be transmitted in multi-frame syntax */
int is_multiframe;
/* Request/reply, kind of */
BAP_OpCode opcode;
/* LSG = Logisches Steuergeraet
* https://www.springerprofessional.de/technische-informatik/eingebettete-systeme/neues-protokoll-vereinfacht-kommunikation-von-steuergeraeten/6592480
*
* BAP's equivalent of an IP address (to be confirmed).
*
* Always the same per CAN ID in the (simple) devices I looked at.
*/
BAP_Node node;
/* The "RPC" function, or "status register" ID.
*
* BAP's equivalent of a "TCP port".
*/
BAP_Function function;
/* Payload length, up to 2^12 = 4096 bytes.
*
* 4095 bytes according to:
* http://www.itwissen.info/BCL-BAP-communication-layer.html
*/
BAP_FrameLen len;
/* Payload */
char data[4096];
};
struct BAP_RXer {
/* Temporary storage for incomplete frames */
struct BAP_Frame *mfchannel[8];
/* How many bytes have we already received on each channel? */
BAP_FrameLen len_done[8];
};
void vw_bap_frame_dump(struct BAP_Frame *bap_frame);
struct BAP_Frame* vw_bap_handle_can_frame(struct BAP_RXer *bap, struct can_frame *frame);
void vw_bap_frame_free(struct BAP_Frame *bap_frame);
struct BAP_RXer* vw_bap_alloc();
void vw_bap_free(struct BAP_RXer *bap);
#endif
|