yy1717
2021-02-07 cea2a94fc97e79897cdfd217be8250c075974a1a
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
//
// Created by YY on 2019/10/8.
//
 
#ifndef RTKBASESTATION_PARSE_NET_H
#define RTKBASESTATION_PARSE_NET_H
 
enum
{
    DATA_ACCESS_MCU = 0,
    DATA_ACCESS_PLATFORM,
    DATA_ACCESS_PLATFORM_2,
    DATA_ACCESS_PLATFORM_LOG,
    DATA_ACCESS_END
};
 
#define MESSAGE_VERSION_JT808          0
#define MESSAGE_VERSION_A2013          1
#define MESSAGE_VERSION_B2016          128
 
#define PROTOCOL_ENCRYPT_NONE           0
#define PROTOCOL_ENCRYPT_RSA2048        1
 
#define COMMON_RESP_SUCCESS           0
#define COMMON_RESP_FAIL           1
#define COMMON_RESP_ERROR           2
#define COMMON_RESP_NOT_SUPPORT     3
 
 
#define EX_MESSAGE_TYPE_INTERNAL       0x9A
#define EX_MESSAGE_TYPE_EXTERNAL       0x13
 
#define EX_MESSAGE_DOWNLOAD         0x8900
#define EX_MESSAGE_UPLOAD           0x0900
 
#define EX_MESSAGE_ATTRIB_RESEND        1           //是否是重传包
#define EX_MESSAGE_ATTRIB_INDICATE     2            //该包是否需要远端应答
#define EX_MESSAGE_ATTRIB_SHA1          4
#define EX_MESSAGE_ATTRIB_SHA256        8
 
void PlatformTxInit(void);
void SetPlatformTxPhoneNum(const char *phone);
void Parse(uint8_t access, const uint8_t *buff, uint16_t length);
void CommonRespend(uint8_t access, uint16_t seq, uint16_t id, uint8_t value);
 
void SendHeartBeat(uint8_t access);
void SendDeviceRegister(uint16_t province, uint16_t city, const uint8_t *device_model,
                    int device_model_length, const uint8_t *device_sn, const char *imei);
void SendDeviceLogin(const uint8_t *data, int length);
void SendRTKReport(uint8_t gps_status, uint32_t latitude, uint32_t longitude, uint16_t altitude,
               const uint8_t *bcd_time, const uint8_t *rtk, int rtk_length);
void SendRTKStart(uint32_t latitude, uint32_t longitude, uint16_t altitude,
                    const uint8_t *bcd_time, uint16_t rtk_pkt_interval);
void SendRTKStop(void);
 
#endif //RTKBASESTATION_PARSE_NET_H