fctom1215
2020-03-10 e5e41dec2d41651c7160662ecf43325d49b07b66
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
//
// Created by YY on 2019/12/27.
//
 
#ifndef RTKDRIVERTEST_PLATFORM_H
#define RTKDRIVERTEST_PLATFORM_H
 
#include "../rtk_module/rtk.h"
 
#define PLATFORM_CONNECT_EVT                         0x0001
#define PLATFORM_DISCONNECT_EVT                      0x0002
#define PLATFORM_REGISTER_EVT                        0x0004
#define PLATFORM_LOGIN_EVT                           0x0008
#define RTK_UPDATE_EVT                               0x0010
#define GPS_UPDATE_EVT                              0x0020
#define MCU_UPDATE_EVT                              0x0040
#define CARD_UPDATE_EVT                             0x0080
#define PLAY_TTS_DONE_EVT                           0x0100
 
typedef struct {
    char domain_name[32];
    int port;
    uint16_t province;
    uint16_t city;
    char device_model[21];
    char device_sn[17];
    char imei[17];
    char phone[17];
    char password[17];
    int registered;
    int rtk_interval;
} rtk_platform_cfg_t;
 
void InitPlatform(const uint8_t *phone, const char *domain_name, int port);
void ConfigPlatform(const rtk_platform_cfg_t *p);
 
void PlatformStatusChanged(uint32_t event, const uint8_t *data, int length);
int WritePlatform(const uint8_t * buf, uint32_t len);
void DeviceRegisterCallback(uint8_t res, const uint8_t *data, int length);
void DeviceLoginCallback(uint8_t res);
void ReceivedRtk(const uint8_t *data, int length);
 
void RequestRtkDownload(const gpsStatus_t *gps, uint16_t rtk_pkt_interval);
void StopRtkDownload(void);
 
#endif //RTKDRIVERTEST_PLATFORM_H