GpsTask.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. extern int g_iCSQ;
  15. extern unsigned char TimeFlag;
  16. typedef struct SUTDL
  17. {
  18. union {
  19. struct { unsigned char b1,b2,b3,b4; }ucData;
  20. unsigned long ulData;
  21. }Data;
  22. }SUTDL;
  23. typedef struct SUTDS
  24. {
  25. union {
  26. struct { unsigned char b1,b2; }ucData;
  27. unsigned short usData;
  28. }Data;
  29. }SUTDS;
  30. typedef enum {INVALID=0,OPEN=1,CLOSE=2,SYN_SENT=3} STATUE;
  31. typedef struct SUT_GPS_STATUS
  32. {
  33. STATUE ServerStatus;
  34. STATUE PPPStatus;
  35. STATUE IPStatus;
  36. unsigned char CheckCnt;//超过一段时间还是没检测到GPS,则认为是此机型没GPS,播报时只播报鉴权状态
  37. unsigned char cregStatus;
  38. }SUT_GPS_STATUS;
  39. extern SUT_GPS_STATUS sutGpsStatus;
  40. /****************************************************
  41. 此处定义的长度很重要,如果长度不是与Message定义的长度一致会出现短信处显示全0满状态,添加不进短信的状态
  42. *****************************************************/
  43. typedef struct SUT_MESS
  44. {
  45. #if 1
  46. unsigned char Update;
  47. unsigned char forcePullGroupOn;//强拉动作开启
  48. unsigned char startCntFlag;
  49. unsigned char skipCnt;
  50. unsigned char GBKMess1[SMS_SIGNAL_LEN+1];//最后一个用来补作结尾
  51. unsigned short len;
  52. unsigned char codeType;
  53. #else
  54. char GBKMess[SMS_SIGNAL_LEN+1];
  55. char GBKMess1[SMS_SIGNAL_LEN+1];//最后一个用来补作结尾
  56. unsigned short len;
  57. unsigned short flag;
  58. #endif
  59. }SUT_MESS;
  60. extern SUT_MESS sutMess;
  61. extern const unsigned char GPS_TimeTable[5];
  62. extern unsigned char sucGpsSentTcpCt;//从启动发送到收到计数器
  63. extern unsigned int heartTickCt;
  64. void GpsTaskTick(unsigned char reset);
  65. void AtHandle(char *pMsg);
  66. void GpsCtrlSendPos(void);
  67. int GetCSQ(char* msg);
  68. STATUE GetIPStatus(char *msg);
  69. //__task void GpsTask(void);
  70. STATUE GetIPNewStatus(char *msg, unsigned char socketNum);
  71. void StartFeedBack(void);
  72. /************************************file end ******************************************/
  73. #endif