app.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #ifndef __APP_H__
  2. #define __APP_H__
  3. #include "board.h"
  4. #include "nwy_osi_api.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
  10. }ENCODE_USER_ENUM;
  11. typedef enum{
  12. ASLEEP_POC,//POC是否休眠
  13. ASLEEP_ADC,//音量旋钮是否忙
  14. ASLEEP_KEY,//普通KEY是否可以休眠,无按键可以休眠(持续按下不休眠)
  15. ASLEEP_MKEY,//矩阵KEY
  16. ASLEEP_PWR,//电源是否执行了关闭
  17. ASLEEP_LCD,//LCD是否休眠
  18. ASLEEP_GGROUP,//用于获取群组列表时不要休眠
  19. ASLEEP_GUSER,//用于获取成员列表时不要休眠
  20. }ASLEEP_ENUM;
  21. #pragma pack(push)
  22. #pragma pack(1)
  23. typedef struct{
  24. unsigned int psn;
  25. char password[30];
  26. }ACCOUNT_DEF;
  27. typedef struct{
  28. unsigned char guiStatus:1;//gui是否初始化完成
  29. unsigned char pocInitStatus:1;//poc是否启动完成
  30. unsigned char appStatus:1;//app是否休眠
  31. unsigned char pocParaDone:1;//poc参数是否检测完成
  32. unsigned char cardStatus:1;//
  33. unsigned char gtMode:1;//GT模式
  34. unsigned char gtTMode:1;//TM模式
  35. unsigned char pocPpp:1;
  36. unsigned char pwrLock:1;//电源是否锁定,只有在电源未锁定时,开机了才关机
  37. unsigned char enableKey:1;//延时界面是否完成,用于阻止延时期间禁止按键操作
  38. unsigned char keyLock:1;//键盘是否被锁了
  39. unsigned char lockShow:1;//显示一下解锁提示信息
  40. unsigned char groupTTSEnable:1;//收到86可以播放
  41. unsigned char earLev:1;
  42. unsigned char earPttReady:1;
  43. unsigned char lowPwrWarn:1;
  44. unsigned char lowPwrMsg:1;
  45. unsigned char forceUiFlash:1;//休眠醒来是,强制UI更新一下
  46. unsigned char authReady:1;
  47. unsigned char earStatus:1;
  48. unsigned int lowPwrCnt;
  49. unsigned char earCnt;
  50. unsigned char pcant;
  51. unsigned int appSleepStatus;//APP是否可以休眠
  52. ACCOUNT_DEF account;
  53. int g_iCSQ;
  54. int g_iBAT;
  55. char fotaVersion[10];
  56. char pocVersion[10];
  57. unsigned char simSel;//卡用的是哪个:0,1
  58. char modemVer[30];
  59. unsigned char key_f2_cnt;
  60. int copstype;
  61. unsigned char volLev;
  62. }APP_DEF;
  63. #pragma pack(pop)
  64. extern APP_DEF sutApp;
  65. extern nwy_osiThread_t *mainThreadPtr;
  66. extern int keyNum;
  67. char isKeyPress(void);
  68. void dataInit(void);
  69. void appRun(void);
  70. void usbCmdHandler(const char *data,uint32 length);
  71. void keyHandler(unsigned short key,unsigned char status);
  72. void hpDetStatusChanged(unsigned char hpStatus);
  73. void subTask(void *param);
  74. void threadSendEvent(nwy_osiThread_t *threadID, uint32 id, uint32 param1,uint32 param2,uint32 param3);
  75. void tryWakeupApp(void);
  76. void keyStatusCtlAll(char high_low);
  77. void keyCheck(unsigned short);
  78. void mKeyCheck(void);
  79. unsigned short getKeyValue(void);
  80. void volAdjAction(char direction);
  81. void ttsPlay(ENCODE_USER_ENUM type, char *tts);
  82. void backLightCb(void *param);
  83. void StrAsciiToHex(char *src, unsigned char *des);
  84. char getAppObjStatus(ASLEEP_ENUM ctlType);
  85. void splVolumeSet(unsigned char level);
  86. #endif