12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- #ifndef __APP_H__
- #define __APP_H__
- #include "board.h"
- #include "nwy_osi_api.h"
- #define APP_TASK_SLEEP_TIME 10
- #define APP_SUB_DIV_TIME (APP_TASK_SLEEP_TIME*2) //暂时未明白
- typedef enum{
- ENCODE_USER_GBK=1,
- ENCODE_USER_UNICODE_BE
- }ENCODE_USER_ENUM;
- typedef enum{
- ASLEEP_POC,//POC是否休眠
- ASLEEP_ADC,//音量旋钮是否忙
- ASLEEP_KEY,//普通KEY是否可以休眠,无按键可以休眠(持续按下不休眠)
- ASLEEP_MKEY,//矩阵KEY
- ASLEEP_PWR,//电源是否执行了关闭
- ASLEEP_LCD,//LCD是否休眠
- ASLEEP_GGROUP,//用于获取群组列表时不要休眠
- ASLEEP_GUSER,//用于获取成员列表时不要休眠
- }ASLEEP_ENUM;
- #pragma pack(push)
- #pragma pack(1)
- typedef struct{
- unsigned int psn;
- char password[30];
- }ACCOUNT_DEF;
- typedef struct{
- unsigned char guiStatus:1;//gui是否初始化完成
- unsigned char pocInitStatus:1;//poc是否启动完成
- unsigned char appStatus:1;//app是否休眠
- unsigned char pocParaDone:1;//poc参数是否检测完成
- unsigned char cardStatus:1;//
- unsigned char gtMode:1;//GT模式
- unsigned char gtTMode:1;//TM模式
- unsigned char pocPpp:1;
- unsigned char pwrLock:1;//电源是否锁定,只有在电源未锁定时,开机了才关机
- unsigned char enableKey:1;//延时界面是否完成,用于阻止延时期间禁止按键操作
- unsigned char keyLock:1;//键盘是否被锁了
- unsigned char lockShow:1;//显示一下解锁提示信息
- unsigned char groupTTSEnable:1;//收到86可以播放
- unsigned char earLev:1;
- unsigned char earPttReady:1;
- unsigned char lowPwrWarn:1;
- unsigned char lowPwrMsg:1;
- unsigned char forceUiFlash:1;//休眠醒来是,强制UI更新一下
- unsigned char authReady:1;
- unsigned char earStatus:1;
- unsigned int lowPwrCnt;
- unsigned char earCnt;
- unsigned char pcant;
- unsigned int appSleepStatus;//APP是否可以休眠
- ACCOUNT_DEF account;
- int g_iCSQ;
- int g_iBAT;
- char fotaVersion[10];
- char pocVersion[10];
- unsigned char simSel;//卡用的是哪个:0,1
- char modemVer[30];
- unsigned char key_f2_cnt;
- int copstype;
- unsigned char volLev;
- }APP_DEF;
- #pragma pack(pop)
- extern APP_DEF sutApp;
- extern nwy_osiThread_t *mainThreadPtr;
- extern int keyNum;
- char isKeyPress(void);
- void dataInit(void);
- void appRun(void);
- void usbCmdHandler(const char *data,uint32 length);
- void keyHandler(unsigned short key,unsigned char status);
- void hpDetStatusChanged(unsigned char hpStatus);
- void subTask(void *param);
- void threadSendEvent(nwy_osiThread_t *threadID, uint32 id, uint32 param1,uint32 param2,uint32 param3);
- void tryWakeupApp(void);
- void keyStatusCtlAll(char high_low);
- void keyCheck(unsigned short);
- void mKeyCheck(void);
- unsigned short getKeyValue(void);
- void volAdjAction(char direction);
- void ttsPlay(ENCODE_USER_ENUM type, char *tts);
- void backLightCb(void *param);
- void StrAsciiToHex(char *src, unsigned char *des);
- char getAppObjStatus(ASLEEP_ENUM ctlType);
- void splVolumeSet(unsigned char level);
- #endif
|