-
Notifications
You must be signed in to change notification settings - Fork 1
/
shared_defines.h
103 lines (91 loc) · 2.95 KB
/
shared_defines.h
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
//UDS Routine Control
#define START_ROUTINE 0x01
#define STOP_ROUTINE 0x02
#define REQUEST_ROUTINE_RESULT 0x03
//Reset types
#define HARD_RESET 0x01
#define IGNITION_RESET 0x02
#define SOFT_RESET 0x03
#define ENABLE_RAPID_POWER_SHUTDOWN 0x04
#define DISABLE_RAPID_POWER_SHUTDOWN 0x05
//Data Transmission
#define CLEAR_DIAGNOSTIC_INFORMATION 0x14
#define READ_DTC_INFORMATION 0x19
#define ROUTINE_CONTROL 0x31
//Upload/Download
#define REQUEST_DOWNLOAD 0x34
#define REQUEST_UPLOAD 0x35
#define TRANSFER_DATA 0x36
#define REQUEST_TRANSFER_EXIT 0x37
#define REQUEST_FILE_TRANSFER 0x38
//ACK/NAK/etc for TP2.0
#define ACK_FOLLOW 0x00
#define ACK_LAST 0x10
#define NOACK_FOLLOW 0x20
#define NOACK_LAST 0x30
#define tpACK 0xB0
#define tpNACK 0x90
//Broadcast
#define BROADCAST_REQUEST 0x23
#define BROADCAST_REQUEST_OK 0x24
#define KWP2000 0x00
//Channel setup
#define SETUP_CHANNEL 0xC0
#define SETUP_CHANNEL_OK 0xD0
#define PARAMETERS_REQUEST 0xA0
#define PARAMETER_REQUEST_OK 0xA1
#define CHANNEL_TEST 0xA3
#define CHANNEL_BREAK 0xA4
#define CHANNEL_DISCONNECT 0xA8
//Errors
#define GENERAL_ERROR 0x10
#define SERVICE_NOT_SUPPORTED 0x11
#define INVALID_FORMAT 0x12
#define MESSAGE_LENGTH_OR_FORMAT_INCORRECT 0x13
#define RESPONSE_TOO_LONG 0x14 //
#define BUSY_REPEAT_REQUEST 0x21
#define CONDITIONS_NOT_MET 0x22
#define ROUTINE_NOT_COMPLETE 0x23
#define REQUEST_SEQUENCE_ERROR 0x24 //
#define NR_FROM_SUBNET_COMPONENT 0x25 //
#define FAILURE_PREVENTS_EXECUTION 0x26 //
#define REQUEST_OUT_OF_RANGE 0x31
#define SECURITY_ACCESS_REQUIRED 0x33
#define INVALID_KEY 0x35
#define EXCEEDED_NUMBER_OF_ATTEMPTS 0x36
#define TIME_DELAY_NOT_EXPIRED 0x37
#define DOWNLOAD_NOT_ACCEPTED 0x40
#define IMPROPER_DOWNLOAD_TIME 0x41
#define CANT_DOWNLOAD_TO_SPECIFIED_ADDRESS 0x42
#define CANT_DOWNLOAD_NUMBER_OF_BYTES_REQUESTED 0x43
#define UPLOAD_NOT_ACCEPTED 0x50
#define IMPROPER_UPLOAD_TYPE 0x51
#define CANT_UPLOAD_FROM_SPECIFIED_ADDRESS 0x52
#define CANT_UPLOAD_NUMBER_OF_BYTES_REQUESTED 0x53
#define UPLOAD_DOWNLOAD_NOT_ACCEPTED 0x70 //
#define TRANSFER_SUSPENDED 0x71
#define TRANSFER_ABORTED 0x72
#define WRONG_BLOCK_SEQUENCE_COUNTER 0x73 //
#define ILLEGAL_ADDRESS_IN_BLOCK_TRANSFER 0x74
#define ILLEGAL_BYTE_COUNT_IN_BLOCK_TRANSFER 0x75
#define ILLEGAL_BLOCK_TRANSFER_TYPE 0x76
#define BLOCK_TRANSFER_DATA_CHECKSUM_ERROR 0x77
#define RESPONSE_PENDING 0x78
#define INCORRECT_BYTE_COUNT_DURING_BLOCK_TRANSFER 0x79
#define SUBFUNCTION_NOT_SUPPORTED_IN_ACTIVE_SESSION 0x7E //
#define SERVICE_NOT_SUPPORTED_IN_ACTIVE_SESSION 0x7F //
#define ERROR 0x7F
#define SERVICE_NOT_SUPPORTED_IN_ACTIVE_DIAGNOSTIC_MODE 0x80
//UDS Diagnostics sessions
#define UDS_DEFAULT_SESSION 0x01
#define UDS_PROGRAMMING_SESSION 0x02
#define UDS_EXTENDED_SESSION 0x03
#define UDS_SAFETY_SYSTEM_SESSION 0x04
//KWP Diagnostics sessions
#define KWP_DEFAULT_SESSION 0x81
#define KWP_EOL_SYSTEM_SUPPLIER 0x84
#define KWP_ECU_PROGRAMMING_MODE 0x85
#define KWP_COMPONENT_STARTING 0x89
//VAG specific
#define EOL_SESSION 0x40
#define DEVELOPMENT_SESSION 0x4F