app.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #ifndef __APP_H_
  2. #define __APP_H_
  3. #include "lsapi_os.h"
  4. #define APP_TASK_SLEEP_TIME 10
  5. #define APP_SUB_DIV_TIME (APP_TASK_SLEEP_TIME*2) //暂时未明白
  6. typedef enum{
  7. ENCODE_USER_GBK=1,
  8. ENCODE_USER_UNICODE_BE=2,
  9. ENCODE_USER_ASCII=3,
  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. // unsigned char tnet;//4 显示4G,5 显示5G
  27. //}ACCOUNT_DEF;
  28. typedef struct{
  29. char psn[20];
  30. unsigned char OtherId[16];
  31. unsigned char OtherPassWord[20];
  32. unsigned char platform[20];
  33. unsigned char pFormatMark[20];
  34. unsigned char tnet;
  35. }USER_STOR_INFO;
  36. typedef struct{
  37. unsigned char guiStatus:1;//gui是否初始化完成
  38. unsigned char pocInitStatus:1;//poc是否启动完成
  39. unsigned char appStatus:1;//app是否休眠
  40. unsigned char pocParaDone:2;//poc参数是否检测完成
  41. unsigned char cardStatus:1;//
  42. unsigned char gtMode:1;//GT模式
  43. unsigned char gtTMode:1;//TM模式
  44. unsigned char pocPpp:1;
  45. unsigned char pwrLock:1;//电源是否锁定,只有在电源未锁定时,开机了才关机
  46. unsigned char enableKey:1;//延时界面是否完成,用于阻止延时期间禁止按键操作
  47. unsigned char keyLock:1;//键盘是否被锁了
  48. unsigned char lockShow:1;//显示一下解锁提示信息
  49. unsigned char groupTTSEnable:1;//收到86可以播放
  50. unsigned char earLev:1;
  51. unsigned char earPttReady:1;
  52. unsigned char lowPwrWarn:1;
  53. unsigned char lowPwrMsg:1;
  54. unsigned char forceUiFlash:1;//休眠醒来是,强制UI更新一下
  55. unsigned char authReady:1;
  56. unsigned char lcdDlyLightUp:1;//LCD唤醒后,初始化完再点亮
  57. unsigned char reloginTts:1;
  58. unsigned char reloginStatus:1;
  59. unsigned char waitEscReleased:1;//进入关机页面要等释放关机键再次按下才能退出关机键
  60. unsigned char chargeStatus:1;
  61. unsigned char updateStatusBar:1;//重新刷新状态栏
  62. unsigned char pttReq:1;//是否发了请麦指令
  63. unsigned char voluemUpdate;
  64. unsigned int lowPwrCnt;
  65. unsigned char earCnt;
  66. unsigned char pcant;
  67. unsigned int appSleepStatus;//APP是否可以休眠
  68. USER_STOR_INFO UserInfo;
  69. //ACCOUNT_DEF account;
  70. int g_iCSQ;
  71. int g_iBAT;
  72. char fotaVersion[10];
  73. char pocVersion[10];
  74. unsigned char simSel;//卡用的是哪个:0,1
  75. char modemVer[30];
  76. unsigned char key_f1_cnt;
  77. unsigned char key_f2_cnt;
  78. int copstype;
  79. unsigned char volLev;
  80. unsigned short timeOutCnt;
  81. unsigned char fotaStatus;
  82. unsigned int mic_ana;
  83. unsigned int mic_adc;
  84. unsigned char startPoc;
  85. }APP_DEF;
  86. #pragma pack(pop)
  87. extern APP_DEF sutApp;
  88. void appRun(void);
  89. void dataInit(void);
  90. void keyCheck(unsigned short keyStatus);
  91. void threadSendEvent(LSAPI_OSI_Thread_t *threadID, unsigned int id, unsigned int param1,unsigned int param2,unsigned int param3);
  92. void usbCmdHandler(const char *data,unsigned int length);
  93. void subTask(void *param);
  94. void ttsPlay(ENCODE_USER_ENUM type, char *tts);
  95. void backLightReset(void);
  96. void backLightCb(void *param);
  97. void StrAsciiToHex(char *src, unsigned char *des);
  98. void lcdBackLightApi(char value);
  99. #define MIC_GAIN_NUM 7
  100. #define MIC_GAIN_DEFAULT 4
  101. #define SPK_GAIN_NUM 8
  102. #define SPK_GAIN_DEFAULT 4
  103. void VolSpkUpdate(void);
  104. #endif