#ifndef __APP_H_ #define __APP_H_ #include "lsapi_os.h" #include "lsapi_network.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=2, ENCODE_USER_ASCII=3, }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]; char tnet; }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 bndPocDone:1;//ɵ³ʼ 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 lcdDlyLightUp:1;//LCD唤醒后,初始化完再点? 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; unsigned char ICCID[21]; unsigned short VailDay; unsigned char voluemUpdate; unsigned short timeOutCnt;//UI ʱ unsigned char RegNetOK;// 卡已注册 unsigned char weather[150]; unsigned char platfrom_err; unsigned char apnCopyDone; }APP_DEF; #pragma pack(pop) extern APP_DEF sutApp; #define max_neighbor_cellbun 6 extern LSAPI_CellLocation_t nCellInfo[max_neighbor_cellbun]; void appRun(void); void dataInit(void); void keyCheck(unsigned short keyStatus); void threadSendEvent(LSAPI_OSI_Thread_t *threadID, unsigned int id, unsigned int param1,unsigned int param2,unsigned int param3); void usbCmdHandler(const char *data,unsigned int length); void subTask(void *param); void ttsPlay(ENCODE_USER_ENUM type, char *tts); void backLightReset(void); void backLightCb(void *param); void StrAsciiToHex(char *src, unsigned char *des); void lcdBackLightApi(char value); #endif