GpsTask.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /********************************************************************************
  2. * File Name: GpsTask.h
  3. * Function Describe: Header file for GpsTask.c
  4. * Explain:
  5. * Writer: ShiLiangWen
  6. * Date: 2015-4-12
  7. *******************************************************************************/
  8. #ifndef __GPS_TASK_H
  9. #define __GPS_TASK_H
  10. /************************************file begin*******************************/
  11. #include <rtl.h>
  12. #include "Message.h"
  13. #define NO_GPS_CHECK_TIMEOUT 10 //10秒
  14. #define GPS_TABLE_NUM 8
  15. extern int g_iCSQ;
  16. extern unsigned char TimeFlag;
  17. typedef struct SUTDL
  18. {
  19. union {
  20. struct { unsigned char b1,b2,b3,b4; }ucData;
  21. unsigned long ulData;
  22. }Data;
  23. }SUTDL;
  24. typedef struct SUTDS
  25. {
  26. union {
  27. struct { unsigned char b1,b2; }ucData;
  28. unsigned short usData;
  29. }Data;
  30. }SUTDS;
  31. typedef enum {INVALID=0,OPEN=1,CLOSE=2,SYN_SENT=3} STATUE;
  32. typedef struct SUT_GPS_STATUS
  33. {
  34. STATUE ServerStatus;
  35. STATUE PPPStatus;
  36. STATUE IPStatus;
  37. unsigned char CheckCnt;//超过一段时间还是没检测到GPS,则认为是此机型没GPS,播报时只播报鉴权状态
  38. unsigned char cregStatus;
  39. }SUT_GPS_STATUS;
  40. extern SUT_GPS_STATUS sutGpsStatus;
  41. typedef struct{
  42. unsigned char reTryPerSeconds;//重新鉴权/注册时间间隔
  43. unsigned char reTryAuthTimes;//连接鉴权多少次失败后做一次注册操作
  44. }SUT_AUTHCTL;
  45. extern SUT_AUTHCTL sutGpsCtl;
  46. /****************************************************
  47. 此处定义的长度很重要,如果长度不是与Message定义的长度一致会出现短信处显示全0满状态,添加不进短信的状态
  48. *****************************************************/
  49. typedef struct SUT_MESS
  50. {
  51. #if 1
  52. unsigned char Update;
  53. unsigned char forcePullGroupOn;//强拉动作开启
  54. unsigned char startCntFlag;
  55. unsigned char skipCnt;
  56. unsigned char GBKMess1[SMS_SIGNAL_LEN+1];//最后一个用来补作结尾
  57. unsigned short len;
  58. unsigned char codeType;
  59. #else
  60. char GBKMess[SMS_SIGNAL_LEN+1];
  61. char GBKMess1[SMS_SIGNAL_LEN+1];//最后一个用来补作结尾
  62. unsigned short len;
  63. unsigned short flag;
  64. #endif
  65. }SUT_MESS;
  66. extern SUT_MESS sutMess;
  67. extern const unsigned short GPS_TimeTable[GPS_TABLE_NUM];
  68. extern unsigned char sucGpsSentTcpCt;//从启动发送到收到计数器
  69. extern unsigned int heartTickCt;
  70. extern unsigned char TeminalInfoRevOK;
  71. void GpsTaskTick(unsigned char reset);
  72. void AtHandle(char *pMsg);
  73. void GpsCtrlSendPos(void);
  74. int GetCSQ(char* msg);
  75. STATUE GetPPPStatus(char *msg);
  76. STATUE GetIPStatus(char *msg);
  77. void RecvModemData(char *msg);
  78. //__task void GpsTask(void);
  79. STATUE GetIPNewStatus(char *msg, unsigned char socketNum);
  80. void StartFeedBack(void);
  81. void IPStatusAna(char *msg, unsigned char *socket, STATUE *status);
  82. /************************************file end ******************************************/
  83. #endif