app.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #ifndef __APP_H_
  2. #define __APP_H_
  3. #include "lsapi_os.h"
  4. #include "lsapi_network.h"
  5. #define APP_TASK_SLEEP_TIME 10
  6. #define APP_SUB_DIV_TIME (APP_TASK_SLEEP_TIME*2) //鏆傛椂鏈�槑鐧?
  7. typedef enum{
  8. ENCODE_USER_GBK=1,
  9. ENCODE_USER_UNICODE_BE=2,
  10. ENCODE_USER_ASCII=3,
  11. }ENCODE_USER_ENUM;
  12. typedef enum{
  13. ASLEEP_POC,//POC鏄�惁浼戠湢
  14. ASLEEP_ADC,//闊抽噺鏃嬮挳鏄�惁蹇?
  15. ASLEEP_KEY,//鏅�€欿EY鏄�惁鍙�互浼戠湢锛屾棤鎸夐敭鍙�互浼戠湢(鎸佺画鎸変笅涓嶄紤鐪?
  16. ASLEEP_MKEY,//鐭╅樀KEY
  17. ASLEEP_PWR,//鐢垫簮鏄�惁鎵ц�浜嗗叧闂?
  18. ASLEEP_LCD,//LCD鏄�惁浼戠湢
  19. ASLEEP_GGROUP,//鐢ㄤ簬鑾峰彇缇ょ粍鍒楄〃鏃朵笉瑕佷紤鐪?
  20. ASLEEP_GUSER,//鐢ㄤ簬鑾峰彇鎴愬憳鍒楄〃鏃朵笉瑕佷紤鐪?
  21. }ASLEEP_ENUM;
  22. #pragma pack(push)
  23. #pragma pack(1)
  24. typedef struct{
  25. unsigned int psn;
  26. char password[30];
  27. char tnet;
  28. }ACCOUNT_DEF;
  29. typedef struct{
  30. unsigned char guiStatus:1;//gui鏄�惁鍒濆�鍖栧畬鎴?
  31. unsigned char pocInitStatus:1;//poc鏄�惁鍚�姩瀹屾垚
  32. unsigned char appStatus:1;//app鏄�惁浼戠湢
  33. unsigned char pocParaDone:1;//poc鍙傛暟鏄�惁妫€娴嬪畬鎴?
  34. unsigned char bndPocDone:1;//博纳德初始化完成
  35. unsigned char cardStatus:1;//
  36. unsigned char gtMode:1;//GT妯″紡
  37. unsigned char gtTMode:1;//TM妯″紡
  38. unsigned char pocPpp:1;
  39. unsigned char pwrLock:1;//鐢垫簮鏄�惁閿佸畾锛屽彧鏈夊湪鐢垫簮鏈�攣瀹氭椂锛屽紑鏈轰簡鎵嶅叧鏈?
  40. unsigned char enableKey:1;//寤舵椂鐣岄潰鏄�惁瀹屾垚锛岀敤浜庨樆姝㈠欢鏃舵湡闂寸�姝㈡寜閿�搷浣?
  41. unsigned char keyLock:1;//閿�洏鏄�惁琚�攣浜?
  42. unsigned char lockShow:1;//鏄剧ず涓€涓嬭В閿佹彁绀轰俊鎭?
  43. unsigned char groupTTSEnable:1;//鏀跺埌86鍙�互鎾�斁
  44. unsigned char earLev:1;
  45. unsigned char earPttReady:1;
  46. unsigned char lowPwrWarn:1;
  47. unsigned char lowPwrMsg:1;
  48. unsigned char forceUiFlash:1;//浼戠湢閱掓潵鏄�紝寮哄埗UI鏇存柊涓€涓?
  49. unsigned char authReady:1;
  50. unsigned char lcdDlyLightUp:1;//LCD鍞ら啋鍚庯紝鍒濆�鍖栧畬鍐嶇偣浜?
  51. unsigned int lowPwrCnt;
  52. unsigned char earCnt;
  53. unsigned char pcant;
  54. unsigned int appSleepStatus;//APP鏄�惁鍙�互浼戠湢
  55. ACCOUNT_DEF account;
  56. int g_iCSQ;
  57. int g_iBAT;
  58. char fotaVersion[10];
  59. char pocVersion[10];
  60. unsigned char simSel;//鍗$敤鐨勬槸鍝�釜:0,1
  61. char modemVer[30];
  62. unsigned char key_f2_cnt;
  63. int copstype;
  64. unsigned char volLev;
  65. unsigned char ICCID[21];
  66. unsigned short VailDay;
  67. unsigned char voluemUpdate;
  68. unsigned short timeOutCnt;//UI 超时返回
  69. unsigned char RegNetOK;// 鍗″凡娉ㄥ唽
  70. unsigned char weather[150];
  71. unsigned char platfrom_err;
  72. unsigned char apnCopyDone;
  73. }APP_DEF;
  74. #pragma pack(pop)
  75. extern APP_DEF sutApp;
  76. #define max_neighbor_cellbun 6
  77. extern LSAPI_CellLocation_t nCellInfo[max_neighbor_cellbun];
  78. void appRun(void);
  79. void dataInit(void);
  80. void keyCheck(unsigned short keyStatus);
  81. void threadSendEvent(LSAPI_OSI_Thread_t *threadID, unsigned int id, unsigned int param1,unsigned int param2,unsigned int param3);
  82. void usbCmdHandler(const char *data,unsigned int length);
  83. void subTask(void *param);
  84. void ttsPlay(ENCODE_USER_ENUM type, char *tts);
  85. void backLightReset(void);
  86. void backLightCb(void *param);
  87. void StrAsciiToHex(char *src, unsigned char *des);
  88. void lcdBackLightApi(char value);
  89. #endif