app.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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_LEARN,//用于学习录音/播放时不要休眠使用
  21. ASLEEP_PWRKEY,
  22. }ASLEEP_ENUM;
  23. #define VOICE_ITEM_NUM 3
  24. #pragma pack(push)
  25. #pragma pack(1)
  26. typedef struct{
  27. unsigned int psn;
  28. char password[30];
  29. }ACCOUNT_DEF;
  30. typedef struct{
  31. unsigned char index;
  32. char info[30];//显示的信息
  33. }VOICE_INFO_DEF;
  34. typedef struct{
  35. unsigned char update;
  36. unsigned char voiceStatus;
  37. unsigned char aNum;
  38. unsigned char vNum;
  39. unsigned char voiceValidNum;
  40. VOICE_INFO_DEF info[VOICE_ITEM_NUM];
  41. }VOICE_DEF;
  42. typedef struct{
  43. unsigned char guiStatus:1;//gui是否初始化完成
  44. unsigned char pocInitStatus:1;//poc是否启动完成
  45. unsigned char appStatus:1;//app是否休眠
  46. unsigned char pocParaDone:1;//poc参数是否检测完成
  47. unsigned char cardStatus:1;//
  48. unsigned char gtMode:1;//GT模式
  49. unsigned char gtTMode:1;//TM模式
  50. unsigned char pocPpp:1;
  51. unsigned char pwrLock:1;//电源是否锁定,只有在电源未锁定时,开机了才关机
  52. unsigned char enableKey:1;//延时界面是否完成,用于阻止延时期间禁止按键操作
  53. unsigned char keyLock:1;//键盘是否被锁了
  54. unsigned char lockShow:1;//显示一下解锁提示信息
  55. unsigned char groupTTSEnable:1;//收到86可以播放
  56. unsigned char skipTTS:1;//不同时候禁止播放TTS
  57. unsigned char earStatus:1;
  58. unsigned char authReady:1;
  59. unsigned char pwrKeyStatus:1;//开关机键状态
  60. unsigned char activePwrShut:1;//是否触发了关机界面
  61. unsigned char antMode:1;
  62. unsigned int appSleepStatus;//APP是否可以休眠
  63. ACCOUNT_DEF account;
  64. int g_iCSQ;
  65. int g_iBAT;
  66. char fotaVersion[10];
  67. char pocVersion[10];
  68. unsigned char simSel;//卡用的是哪个:0,1
  69. char modemVer[30];
  70. unsigned char pcant;
  71. unsigned char lcdReconfigCnt;
  72. VOICE_DEF voiceInfo;
  73. unsigned char fotaStatus;
  74. }APP_DEF;
  75. #pragma pack(pop)
  76. extern APP_DEF sutApp;
  77. extern nwy_osiThread_t *mainThreadPtr;
  78. extern int keyNum;
  79. char isKeyPress(void);
  80. void dataInit(void);
  81. void appRun(void);
  82. void usbCmdHandler(const char *data,uint32 length);
  83. void keyHandler(unsigned short key,unsigned char status);
  84. void hpDetStatusChanged(unsigned char hpStatus);
  85. void subTask(void *param);
  86. void threadSendEvent(nwy_osiThread_t *threadID, uint32 id, uint32 param1,uint32 param2,uint32 param3);
  87. void tryWakeupApp(void);
  88. void keyStatusCtlAll(char high_low);
  89. void keyCheck(unsigned short);
  90. void mKeyCheck(void);
  91. unsigned short getKeyValue(void);
  92. void ttsPlay(ENCODE_USER_ENUM type, char *tts);
  93. void backLightCb(void *param);
  94. void StrAsciiToHex(char *src, unsigned char *des);
  95. void appSleepCtl(ASLEEP_ENUM ctlType, char status);
  96. char getAppObjStatus(ASLEEP_ENUM ctlType);
  97. void volAdjAction(char direction);
  98. void splVolumeSet(unsigned char level);
  99. void shutSysNow(void);
  100. #endif