-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
332 lines (295 loc) · 7.68 KB
/
mainwindow.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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
QString output_data;
private slots:
void on_btn_parse_clicked();
void on_pushButton_clicked();
private:
Ui::MainWindow *ui;
QString dealVC(quint8 cmdtype, QStringList Sldata);
//CX帧解析
void dealC0(QStringList Sl_data);
void dealC1(QStringList Sl_data);
void dealC2(QStringList Sl_data);
void dealC4(QStringList Sl_data);
void dealC6(QStringList Sl_data);
void dealC7(QStringList Sl_data);
void dealC8(QStringList Sl_data);
void dealCA(QStringList Sl_data);
void dealCB(QStringList Sl_data);
void dealCF(QStringList Sl_data);
void dealFA(QStringList Sl_data);
void dealFB(QStringList Sl_data);
void dealFC(QStringList Sl_data);
//BX帧解析
void dealB0(QStringList Sl_data);
void dealB1(QStringList Sl_data);
void dealB2(QStringList Sl_data);
void dealB4(QStringList Sl_data);
void dealB5(QStringList Sl_data);
void dealB7(QStringList Sl_data);
void dealB8(QStringList Sl_data);
void dealBA(QStringList Sl_data);
void dealBB(QStringList Sl_data);
void dealEA(QStringList Sl_data);
void dealEB(QStringList Sl_data);
void dealEC(QStringList Sl_data);
void dealcheck(QStringList Sl_data); //一键检查帧解析
void dealcheck2(QString input_data);
//DSRC帧解析
QString dealDSRC(QStringList* data);
void dealBST(QStringList* data);
void dealVST(QStringList* data);
void dealGetSecure_rq(QStringList* data);
void dealGetSecure_rs(QStringList* data);
void dealTransferChannel_rq(QStringList* data);
void dealTransferChannel_rs(QStringList* Sl_data);
void dealSetMMI_rq(QStringList* Sl_data);
void dealSetMMI_rs(QStringList* Sl_data);
void dealEventReport_rq(QStringList* Sl_data);
QString dealB0StatusCode(quint8 Status);
QString dealB2StatusCode(quint8 DeviceType, quint8 Status);
QString dealB4ErrorCode(quint8 ErrorCode);
QString dealB4ErrorCode35(quint8 ErrorCode);
QString dealB5ErrorCode(quint8 ErrorCode);
QString dealB7ErrorCode(quint8 ErrorCode);
QString dealB8ErrorCode(quint8 ErrorCode);
QString dealBAErrorCode(quint8 ErrorCode);
QString dealBBErrorCode(quint8 ErrorCode);
QString dealRSUControlStatus(quint8 RSUControlStatus);
QString dealRSUPSAMStatus(quint8 PsamStatus);
};
// 初始化指令
typedef struct{
quint8 cmd_type;
uint unix_time;
quint8 datetime[7];
quint8 lanemode;
quint8 bstinterval;
quint8 txpower;
quint8 pllchannelid;
quint8 transmode;
uint flagid;
quint16 reserced;
}C0_CMD_STRTYPE;
//继续交易指令
typedef struct{
quint8 cmd_type;
uint obuid;
ulong OBUDivFactor;
}C1_CMD_STRTYPE;
//停止交易指令
typedef struct{
quint8 cmd_type;
uint obuid;
quint8 stoptype;
int unix_time;
}C2_CMD_STRTYPE;
//开关路侧单元指令
typedef struct{
quint8 cmd_type;
quint8 ControlType;
}C4_CMD_STRTYPE;
//消费交易指令
typedef struct{
quint8 cmd_type;
uint obuid;
ulong OBUDivFactor;
quint8 OBUTradeType;
uint ConsumeMoney;
quint8 PurchaseTime[7];
quint8 Station[43];
quint8 EF04Info[91];
quint8 EF04Info2[5];
}C6_CMD_STRTYPE;
//更新过站信息指令
typedef struct{
quint8 cmd_type;
int cpc_mac;
ulong CPCDivFactor;
quint8 UpdateType;
}C7_CMD_STRTYPE;
//重取 TAC 指令
typedef struct{
quint8 cmd_type;
uint obuid;
quint16 Epserial;
quint8 EF04CmdType;
quint8 EF04Info[91];
quint8 EF04Info2[5];
}C8_CMD_STRTYPE;
//指示路侧单元完成 PSAM 上电初始化功能
typedef struct{
quint8 cmd_type;
uint PSAMChannel;
}CA_CMD_STRTYPE;
//指示路侧单元完成 PSAM 在线授权功能
typedef struct{
quint8 cmd_type;
quint8 PSAMCount;
quint8 *AuthInfo;
}CB_CMD_STRTYPE;
//心跳应答指令
typedef struct{
quint8 cmd_type;
quint8 Status;
}CF_CMD_STRTYPE;
//指示路侧单元进入射频信号发射测试模式
typedef struct{
quint8 cmd_type;
quint8 RSUID;
quint8 TxStatus;
quint8 TxType;
}FA_CMD_STRTYPE;
//指示路侧单元进入射频信号接收测试模式
typedef struct{
quint8 cmd_type;
quint8 RSUID;
quint8 RxStatus;
quint8 IfRevDataDiff;
}FB_CMD_STRTYPE;
//指示路侧单元进入 BeaconID 查询、 配置模式
typedef struct{
quint8 cmd_type;
quint8 BeaconIDStatus;
uint BeaconID;
}FC_CMD_STRTYPE;
//设备状态信息帧
typedef struct{
quint8 FrameType;
quint8 RSUStatus;
quint8 PSAMNum1;
quint8 *PSAMInfo1;
quint8 RSUAlgId;
quint8 RSUManuID;
quint8 RSUID[3];
quint16 RSUVersion;
quint8 workstatus;
quint8 FlagID[3];
uint Reserved;
}B0_CMD_STRTYPE;
//心跳信息帧
typedef struct{
quint8 FrameType;
quint8 RSUControlStatus1;
quint8 RSUControlStatus2;
quint8 RSUControlStatus3;
quint8 PSAMNum1;
quint8 *PSAMStatus1;
quint8 PSAMNum2;
quint8 *PSAMStatus2;
quint8 RSUAntennaNum;
quint8 RSUAntennaNum2;
uint *AntennaStatus;
}B1_CMD_STRTYPE;
//车载单元信息帧
typedef struct{
quint8 FrameType;
uint OBUID_CPCMAC;
quint8 ErrorCode;
quint8 AntennaID;
quint8 DeviceType;
quint8 IssuerIdentifier[8];
quint8 ContractType;
quint8 ContractVersion;
quint8 SerialNumber[8];
quint8 DateofIssue[4];
quint8 DateofExpire[4];
quint8 EquitmentCV;
quint16 OBU_CPCStatus;
}B2_CMD_STRTYPE;
//用户信息帧
typedef struct{
quint8 FrameType;
uint OBUID_CPCMAC;
quint8 ErrorCode;
quint8 TransType;
quint8 VehicleInfo[79];
uint CardRestMoney;
quint8 EF04Info[91];
quint8 IssuerInfo[50];
quint8 LastStation[43];
quint8 EF02_Station[4];
quint8 EF04_CostMoney[10];
}B4_CMD_STRTYPE;
//交易信息帧
typedef struct{
quint8 FrameType;
uint OBUID_CPCMAC;
quint8 ErrorCode;
quint8 PSAMNo[6];
quint8 TransTime[7];
uint TransType;
quint8 AlgFlag;
quint8 KeyVersion;
quint8 TAC[4];
quint16 ICCPayserial;
quint8 PSAMTransSerial[4];
uint CardBalance;
}B5_CMD_STRTYPE;
// 过站信息帧
typedef struct{
quint8 FrameType;
uint CPCMAC;
quint8 ErrorCode;
quint8 WritedFlags;
quint8 LastFalgID[3];
quint8 *FlagID;
}B7_CMD_STRTYPE;
// TAC 信息帧
typedef struct{
quint8 FrameType;
uint OBUID_CPCMAC;
quint8 ErrorCode;
quint8 TAC[4];
quint8 MAC[4];
uint CardRestMoney;
}B8_CMD_STRTYPE;
//PSAM 初始化信息帧
typedef struct{
quint8 FrameType;
quint8 ErrorCode;
quint8 Datetime[7];
quint8 PSAMCount;
quint8 *PSAMInfo;
}BA_CMD_STRTYPE;
//PSAM 授权信息帧
typedef struct{
quint8 FrameType;
quint8 ErrorCode;
quint8 PSAMCount;
quint8 *AuthResult;
}BB_CMD_STRTYPE;
//测试信号发送信息帧
typedef struct{
quint8 FrameType;
quint8 Status;
}EA_CMD_STRTYPE;
//测试信号接收信息帧
typedef struct{
quint8 FrameType;
quint8 Status;
quint16 RevNum;
quint8 Primitive;
quint16 DiffRevNum;
quint16 RevNum_CRCErr;
}EB_CMD_STRTYPE;
//BeaconID 设置信息帧
typedef struct{
quint8 FrameType;
quint8 Status;
quint8 BeaconIDStatus;
quint8 Primitive;
quint8 BeaconID[4];
}EC_CMD_STRTYPE;
#endif // MAINWINDOW_H