-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtl-parser.h
135 lines (116 loc) · 6.19 KB
/
tl-parser.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
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
129
130
131
132
133
134
135
#ifndef TLPARSER_H
#define TLPARSER_H
#include <glib.h>
typedef struct _TLParserSignalData
{
int id;
gchar *name;
gboolean endian;
guint firstbyte;
guint firstbit;
guint bitlength;
gdouble unit;
int offset;
guint listindex;
gchar *listparent;
int source;
}TLParserSignalData;
#define TL_PARSER_VEHICLE_STATE "VCU01_PTReady"
#define TL_PARSER_BATTERY_STATE "BMS01_BatState"
#define TL_PARSER_RUNNING_MODE "BMS01_PTMode"
#define TL_PARSER_VEHICLE_SPEED "VCU08_VehicleSpeed"
#define TL_PARSER_TOTAL_MILEAGE "DPU01_ODO"
#define TL_PARSER_TOTAL_VOLTAGE "BMS01_actVoltage"
#define TL_PARSER_TOTAL_CURRENT "BMS01_actCurrent"
#define TL_PARSER_SOC_STATE "BMS01_actSOC"
#define TL_PARSER_DC2DC_STATE "VCU09_StOpMode"
#define TL_PARSER_GEAR_SHIFT_STATE "VCU01_StGear"
#define TL_PARSER_INSULATION_RESISTANCE "BMS02_IsoResistance"
#define TL_PARSER_ACCELERATOR_LEVEL "VCU03_GasNrm"
#define TL_PARSER_BRAKE_LEVEL "VCU01_bBrk"
#define TL_PARSER_DRIVE_MOTOR_NUMBER "VCU08_EMNumber"
#define TL_PARSER_DRIVE_MOTOR_INDEX "VCU08_EMIndex"
#define TL_PARSER_DRIVE_MOTOR_STATE "VCU01_EMMode"
#define TL_PARSER_DRIVE_MOTOR_CONTROLLER_TEMPERATURE "VCU03_MCUTemp"
#define TL_PARSER_DRIVE_MOTOR_SPIN_SPEED "VCU01_EMSpeed"
#define TL_PARSER_DRIVE_MOTOR_TORQUE "VCU02_EMTrq"
#define TL_PARSER_DRIVE_MOTOR_TEMPERATURE "VCU03_EMTemp"
#define TL_PARSER_DRIVE_MOTOR_CONTROLLER_VOLTAGE "VCU05_CapVoltage"
#define TL_PARSER_DRIVE_MOTOR_CONTROLLER_CURRENT "VCU05_PTCurrent"
#define TL_PARSER_BATTERY_SUBSYSTEM_MAX_VOLTAGE_ID "BMS08_BatIndex"
#define TL_PARSER_BATTERY_CELL_MAX_VOLTAGE_ID "BMS05_MaxVoltCellID"
#define TL_PARSER_BATTERY_CELL_MAX_VOLTAGE "BMS05_MaxCellVolt"
#define TL_PARSER_BATTERY_SUBSYSTEM_MIN_VOLTAGE_ID "BMS08_BatIndex"
#define TL_PARSER_BATTERY_CELL_MIN_VOLTAGE_ID "BMS05_MinVoltCellID"
#define TL_PARSER_BATTERY_CELL_MIN_VOLTAGE "BMS05_MinCellVolt"
#define TL_PARSER_BATTERY_SUBSYSTEM_MAX_TEMPERATURE_ID "BMS08_BatIndex"
#define TL_PARSER_BATTERY_CELL_MAX_TEMPERATURE_ID "BMS06_MaxTempCellID"
#define TL_PARSER_BATTERY_CELL_MAX_TEMPERATURE "BMS06_MaxTemp"
#define TL_PARSER_BATTERY_SUBSYSTEM_MIN_TEMPERATURE_ID "BMS08_BatIndex"
#define TL_PARSER_BATTERY_CELL_MIN_TEMPERATURE_ID "BMS06_MinTempCellID"
#define TL_PARSER_BATTERY_CELL_MIN_TEMPERATURE "BMS06_MinTemp"
#define TL_PARSER_VEHICLE_FAULT_LEVEL "VCU01_VehicleFaultLevel"
#define TL_PARSER_ALARM_TEMPERATURE_DIFF "BMS02_FaultTempDiff"
#define TL_PARSER_ALARM_BATTERY_OVERHEAT "BMS02_FaultOverTemp"
#define TL_PARSER_ALARM_BATTERY_OVERVOLTAGE "BMS02_FaultOverVolt"
#define TL_PARSER_ALARM_BATTERY_UNDERVOLTAGE "BMS02_FaultUnderVolt"
#define TL_PARSER_ALARM_SOC_LOW "BMS02_FaultSOCLow"
#define TL_PARSER_ALARM_BATTERY_CELL_OVERVOLTAGE "BMS02_FaultCellOverVolt"
#define TL_PARSER_ALARM_BATTERY_CELL_UNDERVOLTAGE "BMS02_FaultCellUnderVolt"
#define TL_PARSER_ALARM_SOC_HIGH "BMS02_FaultSOCHigh"
#define TL_PARSER_ALARM_SOC_JUMP "VCU01_FaultSOCJump"
#define TL_PARSER_ALARM_BATTERY_MISMATCH "BMS02_FaultMismatch"
#define TL_PARSER_ALARM_BATTERY_CONSIST "BMS02_FaultConsist"
#define TL_PARSER_ALARM_BAD_INSULATION "BMS02_FaultIsoLow"
#define TL_PARSER_ALARM_DC2DC_OVERHEAT "VCU09_bOverTemp"
#define TL_PARSER_ALARM_EVP "VCU01_FaultEVP"
#define TL_PARSER_ALARM_DC2DC "VCU01_FaultDCDC"
#define TL_PARSER_ALARM_DRIVE_MOTOR_CONTROLLER_TEMPERATURE "VCU01_bVPUOverTemp"
#define TL_PARSER_ALARM_EMERGENCY_OFF_PILOT "BMS01_EmgcyOff_Pilot"
#define TL_PARSER_ALARM_DRIVE_MOTOR_TEMPERATURE "VCU01_bEMOverTemp"
#define TL_PARSER_ALARM_SOC_OVERCHARGE "BMS02_FaultSOCHigh"
#define TL_PARSER_BATTERY_NUMBER "BMS08_BatNumber"
#define TL_PARSER_BATTERY_VOLTAGE_SUBSYSTEM_INDEX \
"BMS08_BatSubSystemVoltageIndex"
#define TL_PARSER_BATTERY_CELL_NUMBER "BMS08_CellNumber"
#define TL_PARSER_BATTERY_G0_CELL_START_ID "CSC00_StartCellID"
#define TL_PARSER_BATTERY_G0_CELL_P0_VOLTAGE "CSC00_StartCellIdPlus0Voltage"
#define TL_PARSER_BATTERY_G0_CELL_P1_VOLTAGE "CSC00_StartCellIdPlus1Voltage"
#define TL_PARSER_BATTERY_G0_CELL_P2_VOLTAGE "CSC00_StartCellIdPlus2Voltage"
#define TL_PARSER_BATTERY_G0_CELL_P3_VOLTAGE "CSC00_StartCellIdPlus3Voltage"
#define TL_PARSER_BATTERY_G1_CELL_START_ID "CSC01_StartCellID"
#define TL_PARSER_BATTERY_G1_CELL_P0_VOLTAGE "CSC01_StartCellIdPlus0Voltage"
#define TL_PARSER_BATTERY_G1_CELL_P1_VOLTAGE "CSC01_StartCellIdPlus1Voltage"
#define TL_PARSER_BATTERY_G1_CELL_P2_VOLTAGE "CSC01_StartCellIdPlus2Voltage"
#define TL_PARSER_BATTERY_G1_CELL_P3_VOLTAGE "CSC01_StartCellIdPlus3Voltage"
#define TL_PARSER_BATTERY_G2_CELL_START_ID "CSC02_StartCellID"
#define TL_PARSER_BATTERY_G2_CELL_P0_VOLTAGE "CSC02_StartCellIdPlus0Voltage"
#define TL_PARSER_BATTERY_G2_CELL_P1_VOLTAGE "CSC02_StartCellIdPlus1Voltage"
#define TL_PARSER_BATTERY_G2_CELL_P2_VOLTAGE "CSC02_StartCellIdPlus2Voltage"
#define TL_PARSER_BATTERY_G2_CELL_P3_VOLTAGE "CSC02_StartCellIdPlus3Voltage"
#define TL_PARSER_BATTERY_TEMPERATURE_SUBSYSTEM_INDEX \
"BMS08_BatSubSystemTempIndex"
#define TL_PARSER_BATTERY_TEMPERATURE_SENSOR_NUMBER "BMS08_TSensorNumber"
#define TL_PARSER_BATTERY_G0_TS_START_ID "CSC00_TempStartId"
#define TL_PARSER_BATTERY_G0_TS_P0_VALUE "CSC00_TempStartIdPlus0"
#define TL_PARSER_BATTERY_G0_TS_P1_VALUE "CSC00_TempStartIdPlus1"
#define TL_PARSER_BATTERY_G0_TS_P2_VALUE "CSC00_TempStartIdPlus2"
#define TL_PARSER_BATTERY_G0_TS_P3_VALUE "CSC00_TempStartIdPlus3"
#define TL_PARSER_BATTERY_G1_TS_START_ID "CSC01_TempStartId"
#define TL_PARSER_BATTERY_G1_TS_P0_VALUE "CSC01_TempStartIdPlus0"
#define TL_PARSER_BATTERY_G1_TS_P1_VALUE "CSC01_TempStartIdPlus1"
#define TL_PARSER_BATTERY_G1_TS_P2_VALUE "CSC01_TempStartIdPlus2"
#define TL_PARSER_BATTERY_G1_TS_P3_VALUE "CSC01_TempStartIdPlus3"
#define TL_PARSER_BATTERY_G2_TS_START_ID "CSC02_TempStartId"
#define TL_PARSER_BATTERY_G2_TS_P0_VALUE "CSC02_TempStartIdPlus0"
#define TL_PARSER_BATTERY_G2_TS_P1_VALUE "CSC02_TempStartIdPlus1"
#define TL_PARSER_BATTERY_G2_TS_P2_VALUE "CSC02_TempStartIdPlus2"
#define TL_PARSER_BATTERY_G2_TS_P3_VALUE "CSC02_TempStartIdPlus3"
gboolean tl_parser_init();
void tl_parser_uninit();
gboolean tl_parser_load_parse_file(const gchar *file);
gboolean tl_parser_parse_can_data(const gchar *device,
int can_id, const guint8 *data, gsize len);
const gchar *tl_parser_battery_code_get(guint8 *single_bat_code_len,
guint *bat_code_total_len);
#endif // TLPARSER_H