yy1717
2022-12-08 f7a18ec4494b9c5c9ef3fd440bbf68ffc6425e18
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
//
// Created by Administrator on 2022/11/15.
//
 
#ifndef MYAPPLICATION3_ADA_H
#define MYAPPLICATION3_ADA_H
 
#include <cstdint>
#include <string>
 
#define ID_ADA_INFO_REQ     0x0001
#define ID_ADA_INFO_RESP     0x8001
#define ID_ADA_DFU_UPLOAD       0x0002
#define ID_ADA_DFU_RESP         0x8002
#define ID_ADA_OBD          0x800A
 
typedef struct {
    std::string version;
    std::string sn;
}ada_info_t;
 
#pragma pack(push, 1)
typedef struct {
    uint32_t total_odo;
    uint32_t this_odo;
    uint32_t this_time;
    uint16_t voltage;
    uint16_t speed;
    uint16_t rpm;
    int16_t steering_wheel;
    uint8_t key_status;
    uint8_t gear;
    uint8_t accelerator;
    uint8_t door;
    uint8_t seat_belt;
    uint8_t clutch;
    uint8_t horn;
    uint8_t wiper;
    uint8_t hand_break;
    uint8_t main_break;
    uint8_t left_sign;
    uint8_t right_sign;
    uint8_t clearance_lamp;
    uint8_t dipped_beam_lamp;
    uint8_t main_beam_lamp;
    uint8_t fog_lamp;
    uint8_t assist_break;
    uint8_t surround1;
    uint8_t surround2;
    uint8_t surround3;
    uint8_t surround4;
    uint8_t resever[3];
}car_sensor_t;
#pragma pack(pop)
 
void InitAda(void);
 
#endif //MYAPPLICATION3_ADA_H