12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- #ifndef __GPS_DATA_H_
- #define __GPS_DATA_H_
- #include "stdint.h"
- #include "pt.h"
- #include "message.h"
- #define GPS_PWREN_PIN GPIO_Pin_9
- #define GPS_PWREN_PORT GPIOC
- #define GPS_PWREN_HIGH GPS_PWREN_PORT->BRR = GPS_PWREN_PIN
- #define GPS_PWREN_LOW GPS_PWREN_PORT->BSRR = GPS_PWREN_PIN
-
- typedef struct SUT_GPS_INF
- {
- unsigned char isGpsWork:1;//GPS模块工作标志
- unsigned char isGpsValid:1;//GPS定位标志 0 GPS未定位 1 GPS已定位
- unsigned char isServerLogin:1; //GPS 服务器连接成功标志
- unsigned char isAutoSend:1;//自动发送标志
- unsigned char isGpsAuthOk:1;//GPS是否鉴权成功
- // unsigned char isFirstLocationSend:1;//is location package send and get ack or not after ath ok
- unsigned char GpsInactiveCt;//串口没反应计数器 ,当串口接收到消息则清零 ,否则持续时间长将复位模块
-
- unsigned char HostCmd;//主机下发的命令
- //unsigned short SendTime;//发送到服务器的时间间隔 秒为单位
- //unsigned short GPSSendTime;
- unsigned int GPS_SecondCnt;
- unsigned short GPS_UploadTime;
- unsigned char GPS_TimeIndexBackup;
-
- unsigned char year;
- unsigned char month;
- unsigned char day;
- unsigned char hour;
- unsigned char minu;
- unsigned char sec;
-
- uint32_t longitue;//经度
- uint32_t latitue;//纬度
-
- uint32_t speed;//速度
- uint32_t aspect;//方位
- uint32_t AvgSpeed;//平均速度
- uint32_t speedbuf[5];
- uint32_t StatisticsMile ;//历程统计
- //----------
- unsigned char Status;
- unsigned char Location[16];
- unsigned char Speed[8];
- unsigned char Time[8];
-
- uint32_t testJD;
- uint32_t testWD;
-
- char NSFlag;//N 北纬 S 南纬
- char EWFlag;//E 东经 W 西经
- // unsigned char reAthCnt;//resend ath time max 5
- }SUT_GPS_INF;
- #define GPS_TABLE_NUM 8
- /****************************************************
- 此处定义的长度很重要,如果长度不是与Message定义的长度一致会出现短信处显示全0满状态,添加不进短信的状态
- *****************************************************/
- typedef struct SUT_MESS{
- unsigned char Update;
- unsigned char forcePullGroupOn;//强拉动作开启
- unsigned char startCntFlag;
- unsigned char skipCnt;
- unsigned char GBKMess1[SMS_SIGNAL_LEN+1];//最后一个用来补作结尾
- unsigned short len;
- unsigned char codeType;
- }SUT_MESS;
- extern SUT_MESS sutMess;
- extern SUT_GPS_INF sutGpsInfo;
- extern const unsigned short GPS_TimeTable[GPS_TABLE_NUM];
- void GPSRestart(void);
- void GPSStop(void);
- void process_gps_data(char *buf,uint32_t size);
- void GpsInternalChange();
- PT_THREAD (ptGpsTask(struct pt *pt));
- #endif
|