app.h 3.2 KB

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