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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
| from enum import Enum, IntEnum
|
| Security_dic = {"0x01请求种子": 1, "0x02发送密钥": 2}
| DTCGroup_dic = {"排放相关": 0, "动力组": 0x100000, "所有组": 0xFFFFFF}
| DTC_Control_dic = {"DTC开": 1, "DTC关": 2}
| ReportBymask_DTC = {'mask_0x0': 0, 'mask_0x1': 1, 'mask_0x8': 8, 'mask_0x9': 9}
| DTC_Dic = {
| "DTC_B1D0004": {
| 0: 0x009D0004
| },
| "DTC_B1D0005": {
| 1: 0x009D0005
| },
| "DTC_B1D0006": {
| 2: 0x009D0006
| },
| "DTC_B1D0007": {
| 3: 0x009D0007
| },
| "DTC_B1D0008": {
| 4: 0x009D0008
| },
| "DTC_B1D0009": {
| 5: 0x009D0009
| },
| "DTC_B1D000A": {
| 6: 0x009D000A
| },
| "DTC_B1D000B": {
| 7: 0x009D000B
| },
| "DTC_B1D000C": {
| 8: 0x009D000C
| },
| "DTC_B1D0001": {
| 9: 0x009D0001
| },
| "DTC_B1D0000": {
| 10: 0x009D0000
| },
| "DTC_U007300": {
| 11: 0x00C07300
| },
| "DTC_U010100": {
| 12: 0x00C10100
| },
| }
| DTC_DescriptionDic = {
| 0x009D0004: "hall sensor error",
| 0x009D0005: "P button short to gnd",
| 0x009D0006: "P button short to power",
| 0x009D0007: "P open",
| 0x009D0008: "P stuck",
| 0x009D0009: "Unlock short to gnd",
| 0x009D000A: "Unlock short to power",
| 0x009D000B: "Unlock OPEN",
| 0x009D000C: "Unlock stuck",
| 0x009D0001: "高电压",
| 0x009D0000: "低电压",
| 0x00C07300: "CAN BUS OFF",
| 0x00C10100: "Lost Communication With TCU1 "
| }
|
| DTC_SanpshotDescriptionDic = {
| 0xDF00: "ECU Power Voltage",
| 0xDF01: "Vehicle Speed",
| 0xDF02: "Occurrence Counter",
| 0xDF03: "The Odometer Of First Malfunction",
| 0xDF04: "The Odometer Of Last Malfunction",
| 0x1000: "EGSM sensor position"
| }
|
|
| class ShifterCANID():
|
| def __init__(self):
| self.normalid = 0
| self.phy_txId = 0
| self.phy_rxId = 0
| self.fun_rxId = 0
|
|
| class ShifterPosition(IntEnum):
| ShiftPosZero = 0
| ShiftPosX2 = 2
| ShiftPosX1 = 3
| ShiftPosY1 = 4
| ShiftPosY2 = 5
| ShiftPosNotInit = 8
| ShiftPosM_Minus = 0xc
| ShiftPosM_Plus = 0xd
| ShiftPosM = 0xe
| ShiftNotAvailable = 0xF
|
|
| DID_dic = {
| "ProgrammingCounter": 0x2100,
| "ProAtpCounter": 0x2101,
| "BackupConfig": 0x2102,
| "VehicleName": 0x2103,
| "DiagVersion": 0x2104,
| "BootSoftId": 0x2105,
| "DFLZMPartNum": 0xF187,
| "VehiclEECUSoftwareVersion": 0x2108,
| "SupplierID": 0xF18A,
| "ECUManufacturingDate": 0x210B,
| "ECUSerialNumID": 0xf18c,
| "VINDataIdentifier": 0xF190,
| "ECUHardwareVersion": 0xF193,
| "ECUSoftwareVersion": 0xF195,
| "SystemNameOrEngineType": 0x2110,
| "RepairShopCodeOrTester": 0x2111,
| "ECUProgtammingDate": 0x2111,
| "InstallDate": 0x2113,
| "NetConfig": 0xf019,
| "FunctionConfig": 0xf010,
| "ActiveDiagSession": 0x2106,
| "EGSMSensorPositon": 0x2116,
| "ReleaseButtonState": 0x2118,
| "PButtionState": 0x2119,
| "PaddleState": 0x211A,
| "ECUPowerVoltage": 0x211B,
| "VehicleSpeed": 0x211c,
| "SystemName": 0xF197,
| "WriteFingerPrint": 0xF15A,
| "ReadFingerPrint": 0xf15b,
| "IndicationLEDControl": 0x8101
| }
|
|