1 #ifndef J1939TP_PACKETS_INTERNAL_H_
\r
2 #define J1939TP_PACKETS_INTERNAL_H_
\r
4 #define DIRECT_TRANSMIT_SIZE 8
\r
6 #define CM_PGN_VALUE_1 0x00
\r
7 #define CM_PGN_VALUE_2 0xCE
\r
8 #define CM_PGN_VALUE_3 0x00
\r
9 #define CM_PGN_BYTE_1 5
\r
10 #define CM_PGN_BYTE_2 6
\r
11 #define CM_PGN_BYTE_3 7
\r
12 #define CM_BYTE_CONTROL 0
\r
17 #define CTS_BYTE_CONTROL CM_BYTE_CONTROL
\r
18 #define CTS_BYTE_NUM_PACKETS 1
\r
19 #define CTS_BYTE_NEXT_PACKET 2
\r
20 #define CTS_BYTE_SAE_ASSIGN_1 3
\r
21 #define CTS_BYTE_SAE_ASSIGN_2 4
\r
22 #define CTS_BYTE_PGN_1 CM_PGN_BYTE_1
\r
23 #define CTS_BYTE_PGN_2 CM_PGN_BYTE_2
\r
24 #define CTS_BYTE_PGN_3 CM_PGN_BYTE_3
\r
25 #define CTS_START_SEQ_NUM 1
\r
26 #define CTS_CONTROL_VALUE 17
\r
28 #define BAM_RTS_SIZE 8
\r
29 #define BAM_RTS_BYTE_CONTROL CM_BYTE_CONTROL
\r
30 #define BAM_RTS_BYTE_LENGTH_1 1
\r
31 #define BAM_RTS_BYTE_LENGTH_2 2
\r
32 #define BAM_RTS_BYTE_NUM_PACKETS 3
\r
33 #define BAM_RTS_BYTE_SAE_ASSIGN 4
\r
34 #define BAM_RTS_BYTE_PGN_1 CM_PGN_BYTE_1
\r
35 #define BAM_RTS_BYTE_PGN_2 CM_PGN_BYTE_2
\r
36 #define BAM_RTS_BYTE_PGN_3 CM_PGN_BYTE_3
\r
37 #define BAM_CONTROL_VALUE 32
\r
38 #define RTS_CONTROL_VALUE 16
\r
42 #define DT_DATA_SIZE 7
\r
43 #define DT_BYTE_SEQ_NUM 0
\r
44 #define DT_BYTE_DATA_1 1
\r
45 #define DT_BYTE_DATA_2 2
\r
46 #define DT_BYTE_DATA_3 3
\r
47 #define DT_BYTE_DATA_4 4
\r
48 #define DT_BYTE_DATA_5 5
\r
49 #define DT_BYTE_DATA_6 6
\r
50 #define DT_BYTE_DATA_7 7
\r
52 #define DT_PGN_VALUE_1 0x00
\r
53 #define DT_PGN_VALUE_2 0xEB
\r
54 #define DT_PGN_VALUE_3 0x00
\r
56 /* EndOfMsgAck message */
\r
57 #define ENDOFMSGACK_SIZE 8
\r
58 #define ENDOFMSGACK_BYTE_CONTROL CM_BYTE_CONTROL
\r
59 #define ENDOFMSGACK_BYTE_TOTAL_MSG_SIZE_1 1
\r
60 #define ENDOFMSGACK_BYTE_TOTAL_MSG_SIZE_2 2
\r
61 #define ENDOFMSGACK_BYTE_NUM_PACKETS 3
\r
62 #define ENDOFMSGACK_BYTE_SAE_ASSIGN 4
\r
63 #define ENDOFMSGACK_BYTE_PGN_1 CM_PGN_BYTE_1
\r
64 #define ENDOFMSGACK_BYTE_PGN_2 CM_PGN_BYTE_2
\r
65 #define ENDOFMSGACK_BYTE_PGN_3 CM_PGN_BYTE_3
\r
66 #define ENDOFMSGACK_CONTROL_VALUE 19
\r
68 #define CONNABORT_SIZE 8
\r
69 #define CONNABORT_BYTE_CONTROL 0
\r
70 #define CONNABORT_BYTE_SAE_ASSIGN_1 1
\r
71 #define CONNABORT_BYTE_SAE_ASSIGN_2 2
\r
72 #define CONNABORT_BYTE_SAE_ASSIGN_3 3
\r
73 #define CONNABORT_BYTE_SAE_ASSIGN_4 4
\r
74 #define CONNABORT_BYTE_PGN_1 CM_PGN_BYTE_1
\r
75 #define CONNABORT_BYTE_PGN_2 CM_PGN_BYTE_2
\r
76 #define CONNABORT_BYTE_PGN_3 CM_PGN_BYTE_3
\r
78 #define CONNABORT_CONTROL_VALUE 255
\r
80 #define J1939TP_T4_TIMEOUT_MS 1050
\r
81 #define J1939TP_T3_TIMEOUT_MS 1250
\r
82 #define J1939TP_T2_TIMEOUT_MS 1250
\r
83 #define J1939TP_T1_TIMEOUT_MS 750
\r