123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091 |
- /*****************************************************************************
- SetSystemPara.c
- *****************************************************************************/
- #include "includes.h"
- SUT_MENU sutMenuSysSetup;
- unsigned char Net_temp_flag;
- SUT_LCDGPS_SEND_DATA sutLcdGpsSendData;
- char ReadApnData(unsigned char *source,unsigned char witchone,char *apnapn,char *apnname,char *apnpass);
- unsigned short g_ausTimeOut[5]={10,30,60,300,0};
- static char Languagecnt=0;
- int ApnFileIndex;
- /*************************************************************************/
- unsigned int g_uiGpsStat = 1; //1
- SUT_LCD_PARAM sutLcdParam;
- unsigned short g_UpdatePocCount;
- static char AdbDebug=0;
- char BOOTDebug=0;
- char showApnTable[2*APN_NUM][31];
- char *APNNAME[APN_NUM+1]=
- {
- "APN1",
- "APN2",
- "APN3",
- "APN4",
- ""
- };
- void SetAPNShow(int update)
- {
- #if 1
- int i;
- static const char *accIconFileName[]={
- "APN.bmp",
- "APN1.bmp",
- ""
- };
- static char GroupsFeatures[APN_NUM];
- if(update){
- if(showApn!=1)
- {
- ShowMessageBox("禁止修改");
- os_dly_wait(200);
- UISetNextStatus(UIS_MENU_SYS_SET);
- return;
- }
- if(validApnNum==1)
- {
- ShowMessageBox("配置文件无APN");
- os_dly_wait(200);
- UISetNextStatus(UIS_MENU_SYS_SET);
- return;
- }
- GuiClearAll();
- ShowCaption("设置APN",2);//
- GuiDrawHLine(0,159,20,1);
- //设置Features 将决定选择图标
- GroupsFeatures[sutProductPara.APNIndex]=1;
- ListBoxInit(&sutListBox,APNNAME,0,accIconFileName,GroupsFeatures);
- //----------------------------
- GuiDrawHLine(0,159,104,1);
- GuiShowStr(0,110,"[OK]切换 [P1]详情",0x01);
- }
- #else
- int i;
- static unsigned short susCt=0;
- static const char *accIconFileName[]={"APN.bmp","APN1.bmp",""};
- unsigned char buf[300];
- static char NullGroup=0;
- static char GroupsFeatures[APN_NUM];
- static char *APNAPN[APN_NUM];
- char NullPtr[]="";
- if(update){
- susCt=0;
- GuiClearAll();
- ShowCaption("设置APN",1);//
- GuiDrawHLine(0,159,20,1);
- ReadFileData(ApnFileIndex,0,sizeof(buf),buf);
- for(i=0;i<3;i++)
- {//读取三组接入点名称
- if(ReadApnData(buf, i, &showApn[i][0], 0,0))
- {
- return;
- }
- }
- //付给用于显示的指针
- APNAPN[0]=&showApn[0][0];
- APNAPN[1]=&showApn[1][0];
- APNAPN[2]=&showApn[2][0];
- APNAPN[3]=NullPtr;
- APNAPN[4]=NullPtr;
- //----------------------------
- for(i=0;i<APN_NUM;i++){
- GroupsFeatures[i]=0;
- }
-
- //设置Features 将决定选择图标
- if(0==strcmp(sutProductPara.APNApn, APNAPN[0])) GroupsFeatures[0]=1;
- else if(0==strcmp(sutProductPara.APNApn, APNAPN[1])) GroupsFeatures[1]=1;
- else if(0==strcmp(sutProductPara.APNApn, APNAPN[2])) GroupsFeatures[2]=1;
- else{
- //如果以上三种都不是,则认为是用户自定义的了
- APNAPN[3]=sutProductPara.APNApn;
- GroupsFeatures[3]=1;
- }
- ListBoxInit(&sutListBox,APNAPN,0,accIconFileName,GroupsFeatures);
- //----------------------------
- GuiDrawHLine(0,159,104,1);
- GuiShowStr(0,110,"[M]切换 ",0x01);
- }
- #endif
- }
-
- void SetSYSResponse(void)
- {
- unsigned long key;
- key=MenuResponse(&sutMenuSysSetup);
- if(KEY_PANEL_MENU==key){
- switch(sutMenuSysSetup.handle){
- // case 0:
- // UISetNextStatus(UIS_SET_LANGUAGE);
- //
- // break;
- // case 1:
- // UISetNextStatus(UIS_SET_GPS);
- // break;
- // case 2:
- // UISetNextStatus(UIS_SET_LCD);
- // break;
- // case 3:
- // UISetNextStatus(UIS_SET_NET);
- // break;
- case 0:
- UISetNextStatus(UIS_SET_KEYSound);
- break;
- case 1:
- UISetNextStatus(UIS_SET_PTTTONE);
- break;
-
- // case 6:
- // UISetNextStatus(UIS_AWMODESET);
- // break;
- // case 2:
- // UISetNextStatus(UIS_FASTINTERFACE);
- // break;
- case 2:
- UISetNextStatus(UIS_UP_INTERCOM_VER);
- break;
- case 3:
- UISetNextStatus(UIS_SET_ADB);
- break;
- case 4://固件升级
- UISetNextStatus(UIS_SET_BOOT);
- break;
-
- }
- PushUiStack(&UI_Stack,sutMenuSysSetup.handle);
- }
- else if(KEY_PANEL_EXIT==key){
- UISetNextStatus(UIS_MENU_MAIN); //UIS_MENU_SYS_SET
- }
- }
- /***************************************
- 注意:CDMA的APN形式跟WCDMA大不相同
- W机子是不需要改来改去的 "IP","UNIM2M.NJM2MAPN","0.0.0.0"
- ****************************************/
- void SetAPNResponse(void)
- {
- unsigned long key;
- key=ListBoxResponse(&sutListBox);
-
- if(KEY_PANEL_MENU==key)
- {
- ShowMessageBox("即将重启更新...");
- sutProductPara.APNIndex=sutListBox.handle;
- strcpy(sutProductPara.APNName, showApnTable[2*sutProductPara.APNIndex]);
- strcpy(sutProductPara.APNPass, showApnTable[2*sutProductPara.APNIndex+1]);
- SaveProductParaToFlash("MENU_SWAPN");
- os_dly_wait(200);
- modemPwrOffNow=1;
- }else if(KEY_INFO==key) UISetNextStatus(UIS_APN_DETAIL);
- else if(KEY_PANEL_EXIT==key)UISetNextStatus(UIS_MENU_SYS_SET);
- }
- char showIndex;
- void ShowAPNMessage(char index)
- {
- char buf[40];
- char temp[40];
- unsigned char len;
- unsigned char i,y,maxLen;
- i=0;
- y=22;
- maxLen=14;
- GuiClearRect(0, y, LCD_WIDTH-1,LCD_HEIGHT-25);
- snprintf(buf, sizeof(buf), "%s:",APNNAME[showIndex]);
- GuiShowStr(1,y+16*i++,buf,0x01);
- len=strlen(showApnTable[2*showIndex]);
- memcpy(temp, showApnTable[2*showIndex], maxLen);
- temp[maxLen]=0;
- snprintf(buf, sizeof(buf), "Name:%s",temp);
- GuiShowStr(1,y+16*i++,buf,0x01);
- if(len > maxLen)
- {
- strcpy(temp, &showApnTable[2*showIndex][maxLen]);
- snprintf(buf, sizeof(buf), "%s",temp);
- buf[len-maxLen]=0;
- GuiShowStr(1,y+16*i++,buf,0x01);
- }
- len=strlen(showApnTable[2*showIndex+1]);
- memcpy(temp, showApnTable[2*showIndex+1], maxLen);
- temp[maxLen]=0;
- snprintf(buf, sizeof(buf), "Pass:%s",temp);
- GuiShowStr(1,y+16*i++,buf,0x01);
- if(len > maxLen)
- {
- strcpy(temp, &showApnTable[2*showIndex+1][maxLen]);
- snprintf(buf, sizeof(buf), "%s",temp);
- buf[len-maxLen]=0;
- GuiShowStr(1,y+16*i++,buf,0x01);
- }
- }
- void SetApnDetailShow(int update)
- {
- char buf[40];
- if(update)
- {
- GuiClearAll();
- ShowCaption("APN详情",2);//
- GuiDrawHLine(0,159,20,1);
- showIndex=0;
- ShowAPNMessage(showIndex);
- //----------------------------
- GuiDrawHLine(0,159,104,1);
- GuiShowStr(0,110,"[EXIT]返回 ",0x01);
- }
- }
- void SetApnDetailResponse(void)
- {
- if(KEY_PANEL_DOWN==g_ulKeyValue)
- {
- showIndex++;
- if(showIndex >= validApnNum) showIndex=0;
- ShowAPNMessage(showIndex);
- }else if(KEY_PANEL_UP==g_ulKeyValue)
- {
- if(showIndex==0) showIndex=validApnNum;
- if(showIndex > 0) showIndex--;
- ShowAPNMessage(showIndex);
- }
- else if(KEY_PANEL_EXIT==g_ulKeyValue) UISetNextStatus(UIS_SET_APN);
- }
- void MakeGpsSendData(void)
- {
- unsigned char *data=(unsigned char *)&sutLcdGpsSendData;
- memset(data, 0, sizeof(SUT_LCDGPS_SEND_DATA));
- data[0] = (sutGpsInfo.latitue>>24)&0xFF;
- data[1] = (sutGpsInfo.latitue>>16)&0xFF;
- data[2] = (sutGpsInfo.latitue>>8)&0xFF;
- data[3] = (sutGpsInfo.latitue)&0xFF;
-
- data[4] = (sutGpsInfo.longitue>>24)&0xFF;
- data[5] = (sutGpsInfo.longitue>>16)&0xFF;
- data[6] = (sutGpsInfo.longitue>>8)&0xFF;
- data[7] = (sutGpsInfo.longitue)&0xFF;
- }
- /*****************************************************
- 深圳北纬22.33 东经114.07
- 经过试验数据比较准确,但是东西南北不知道
- ******************************************************/
- void GetCoordinates(unsigned char type)
- {
- //type 0 UI时调用
- // 1 上传时调用
- char buf[30];
- //char buf0[15]={0};
- char buf1[8];
- char buf2[4]={0};
- char temp[3];
- char temp1[3];
- char temp2[5];
- char temp3[5];
- int i,num,num1,w,j;
- double Jnum1,Jnum2,Jnum3;//有小数位 8位有效
- double Wnum1,Wnum2,Wnum3;//有小数位 8位有效
- // char* g_cGetlongitude;
- // char* g_cGetlatitude;
-
- MakeGpsSendData();
- AscStrTurnHexStr((char *)sutLcdGpsSendData.JJJJ,buf1);
- memset(temp, 0, sizeof(temp));
-
- for(i=0;i<3;i++){
- temp[i]=buf1[i];
- }
-
- j=atoi(temp);
-
-
- memset(temp2, 0, sizeof(temp2));
-
- for(i=0;i<6;i++){
- temp2[i]=buf1[i+3];
- }
- num=atoi(temp2);
-
- Jnum1=num/1000;
- Jnum1 /=60;
-
- Jnum2 = (num%1000)*60;
- Jnum2 /=3600000;
- Jnum3=Jnum1+Jnum2;
- //sutLcdGpsSendData.j=j*1000000+Jnum3*1000000;
- // sutLcdGpsSendData.j = (j+Jnum3)*1000000;
- //Getlongitude;
- //Getlatitude;
-
- sutGpsInfo.testJD = j*1000000+Jnum3*1000000;//上传时使用
- // if(type == 0){//UI时要显示
- // sprintf(buf,"经度 %s: %d.%05d","W",j,(unsigned int)(Jnum3*100000));
- // GuiShowStr(0,40,buf,0x01);
- // }
- AscStrTurnHexStr((char *)sutLcdGpsSendData.WWWW,buf2);
- for(i=0;i<3;i++){
- temp1[i]=buf2[i];
- }
- w=atoi(temp1);
- for(i=0;i<6;i++){//5
- temp3[i]=buf2[i+3];
- }
- num1=atoi(temp3);
- Wnum1=num1/1000;
- Wnum1 /=60;
- Wnum2 = (num1%1000)*60;
- Wnum2 /=3600000;
- Wnum3=Wnum1+Wnum2;
-
- sutGpsInfo.testWD = w*1000000+Wnum3*1000000; //6 10000000
-
- if(type == 0){//UI时要显示
- if(0==strcmp(sutProductPara.Language,"cn"))
- {
- snprintf(buf, sizeof(buf)," 纬度 %c: %.3d.%06d",sutGpsInfo.NSFlag,w,(unsigned int)(Wnum3*1000000)); //
- GuiShowStr(0,24,buf,0x01);
- snprintf(buf, sizeof(buf)," 经度 %c: %d.%06d",sutGpsInfo.EWFlag,j,(unsigned int)(Jnum3*1000000)); //
- GuiShowStr(0,40,buf,0x01);
- }else{
- snprintf(buf, sizeof(buf),"Latitude: %.3d.%06d",w,(unsigned int)(Wnum3*1000000)); //
- GuiShowStr(0,24,buf,0x01);
- snprintf(buf, sizeof(buf),"Longitude: %d.%06d",j,(unsigned int)(Jnum3*1000000)); //
- GuiShowStr(0,40,buf,0x01);
- }
- }
-
-
-
- }
-
- void SetGPSTimeShowDetail(unsigned char timeIndex)
- {
- unsigned short tempTime;
- char buf[10];
- tempTime = GPS_TimeTable[timeIndex];
- if(tempTime==0)
- {
- GuiShowStr(100,56," 关闭 ",0x01);//130
- GuiReverseRect(108,56,16*2,14);
- }else
- {
- snprintf(buf, sizeof(buf)," %02d 秒",tempTime);
- GuiShowStr(100,56,buf,0x01);//130
- GuiReverseRect(108,56,16,14);
- }
- }
-
- /*********************************************************/
- void SetGPSShow(int update)
- {
- char tempbuf[30];
- static unsigned char susCt=0;
- unsigned short usGps;
- static unsigned short susGps;
- static unsigned char GpsStart=-1;
-
- if(update){
- GuiClearAll();
- if(sutPocStatus.Modeminited==0&&g_uGtFactory==0){
- if(0==strcmp(sutProductPara.Language,"cn"))ShowMessageBox("模块初始化中");
- else ShowMessageBox("Modem init!");
- os_dly_wait(50);
- UISetNextStatus(UIS_STANDBY);
- return ;
- }
-
- if(g_uGtFactory==0&&sutGpsInfo.isGpsWork==0){
- if(sutGpsInfo.GpsOpened){
- if(0==strcmp(sutProductPara.Language,"cn"))ShowMessageBox("未打开");
- else ShowMessageBox("not open!");
- }else {
- if(0==strcmp(sutProductPara.Language,"cn"))ShowMessageBox("不支持");
- else ShowMessageBox("no support!");
- }
- os_dly_wait(50);
- UISetNextStatus(UIS_STANDBY);
- return ;
- }
-
- if(0==strcmp(sutProductPara.Language,"cn"))
- {
- ShowCaption("北斗设置",1);//
-
- snprintf(tempbuf,sizeof(tempbuf)," 北斗上传时间:%d 秒",sutGpsInfo.GPS_UploadTime);
- GuiShowStr(0,56,tempbuf,0x01); //sutGpsInfo.SendTime
- //sutGpsInfo.startnum
- snprintf(tempbuf,sizeof(tempbuf)," 有效卫星:%d ",sutGpsInfo.startnum);
- GuiShowStr(0,74,tempbuf,0x01); //sutGpsInfo.SendTime
-
- }else {
- ShowCaption("GPS Set",1);//
- snprintf(tempbuf,sizeof(tempbuf),"Upload time: %d S",sutGpsInfo.GPS_UploadTime);
- GuiShowStr(0,56,tempbuf,0x01); //sutGpsInfo.SendTime
- snprintf(tempbuf,sizeof(tempbuf),"Start Number:%d ",sutGpsInfo.startnum);
- GuiShowStr(0,74,tempbuf,0x01); //sutGpsInfo.SendTime
- }
- GpsStart=sutGpsInfo.startnum;
- GuiDrawHLine(0,159,20,1);
- GetCoordinates(0);
- if(0==strcmp(sutProductPara.Language,"cn")) GuiShowStr(0,110," [EXIT]退出",0x01);
- else GuiShowStr(0,110," [EXIT]",0x01);
- if(g_uGtFactory)ShowGPSICon(92);
- }
- usGps=((unsigned short)sutGpsInfo.isGpsWork<<8) | ((unsigned short)sutGpsInfo.isGpsValid) | ((unsigned short)sutGpsInfo.isGpsAuthOk<<2);
- if(susGps!=usGps){
- susGps =usGps;
- if(g_uGtFactory)ShowGPSICon(92);
- }
- if(++susCt>=200){
- GetCoordinates(0);
- if(GpsStart!=sutGpsInfo.startnum){
- if(0==strcmp(sutProductPara.Language,"cn")){
- snprintf(tempbuf,sizeof(tempbuf)," 有效卫星:%d ",sutGpsInfo.startnum);
- GuiShowStr(0,74,tempbuf,0x01); //sutGpsInfo.SendTime
- }else{
- snprintf(tempbuf,sizeof(tempbuf),"Start Number:%d ",sutGpsInfo.startnum);
- GuiShowStr(0,74,tempbuf,0x01); //sutGpsInfo.SendTime
- }
- GpsStart=sutGpsInfo.startnum;
- }
- susCt=0;
- }
- }
-
- void SetGPSResponse(void)
- {
- switch(g_ulKeyValue)
- {
- case KEY_PANEL_UP:
-
- break;
- case KEY_PANEL_DOWN:
- printf("GPS DOWN--------------\r\n");
- // if(g_ulKeyValue==KEY_PANEL_UP)
- // {
- // if(sutGpsInfo.GPS_TimeIndexBackup<(sizeof(GPS_TimeTable)-1))
- // sutGpsInfo.GPS_TimeIndexBackup++;
- // else
- // sutGpsInfo.GPS_TimeIndexBackup=0;
- // }else{
- // if(sutGpsInfo.GPS_TimeIndexBackup==0)
- // sutGpsInfo.GPS_TimeIndexBackup=sizeof(GPS_TimeTable)-1;
- // else
- // sutGpsInfo.GPS_TimeIndexBackup--;
- // }
- // SetGPSTimeShowDetail(sutGpsInfo.GPS_TimeIndexBackup);
- break;
- case KEY_PANEL_MENU:
- // if(sutGpsInfo.GPS_TimeIndexBackup != sutProductPara.m_GPS_TimeIndex)
- // {//changed
- // sutProductPara.m_GPS_TimeIndex = sutGpsInfo.GPS_TimeIndexBackup;
- // // GpsTimeUpdate();
- // SaveProductParaToFlash("MENU_SWGPS");
- // }
- //
- // UISetNextStatus(UIS_STANDBY);
- break;
- case KEY_PANEL_EXIT:
- if(!g_uGtFactory)UISetNextStatus(UIS_MENU_SYS_SET);
- else UISetNextStatus(UIS_FACTORY_MENU);
- break;
- //case KEY_PANEL_MENU: UISetNextStatus(UIS_MENU_MAIN);break;
- }
- }
- void SetLCDShow(int update)
- {
- static unsigned short susCt=0;
- char buf[10];
- char buf1[6];
- int x=4;//4
- int i;
-
- if(update==1){
- sutLcdParam.SetTimeIndex=sutProductPara.LCDSetIndex;
- GuiClearAll();
- if(0==strcmp(sutProductPara.Language,"cn")){
- ShowCaption("LCD设置",1);//0
- GuiDrawHLine(0,159,20,1);
- GuiShowStr(x,56," 背光时间: ",1);
- }else {
- ShowCaption("LCD Set",1);//0
- GuiDrawHLine(0,159,20,1);
- GuiShowStr(x,56,"LightTime: ",1);
- }
- if(sutLcdParam.SetTimeIndex==4)
- {
- if(0==strcmp(sutProductPara.Language,"cn"))snprintf(buf, sizeof(buf),"常亮");
- else snprintf(buf, sizeof(buf),"Keep");
- }
- else {
- snprintf(buf, sizeof(buf),"%3d",g_ausTimeOut[sutLcdParam.SetTimeIndex]);
- GuiShowStr(x+(16*5)+49,56," S",1);
- }
-
- ShowCaptionArea(buf,(x+(16*5)),(x+(16*5))+48,56);
-
- GuiReverseRect(x+(16*5),56,48,14);
- snprintf(buf1, sizeof(buf1),"%3d",sutLcdParam.SetTimeIndex);
- SlwTrace(INF,buf1,1);
- GuiDrawHLine(0,159,104,1);
- susCt=0;
- //return;
- }else if(update == 2){
- GuiClearRect(x+(16*5),56,160,76);//
- if(sutLcdParam.SetTimeIndex==4){
- if(0==strcmp(sutProductPara.Language,"cn"))snprintf(buf, sizeof(buf),"常亮");
- else snprintf(buf, sizeof(buf),"Keep");
- }
- else {
- snprintf(buf, sizeof(buf),"%3d",g_ausTimeOut[sutLcdParam.SetTimeIndex]);
- GuiShowStr(x+(16*5)+49,56," S",1);
- }
- ShowCaptionArea(buf,(x+(16*5)),(x+(16*5))+48,56);
- GuiReverseRect(x+(16*5),56,48,14);
- GuiDrawHLine(0,159,104,1);
-
- }
-
- if(susCt==0){
- if(0==strcmp(sutProductPara.Language,"cn")) GuiShowStr(0,110,"[上]选择 [下]选择",0x01);
- else GuiShowStr(0,110,"[UP] [DOWN]",0x01);
-
- }else if(susCt==200){
- if(0==strcmp(sutProductPara.Language,"cn")) GuiShowStr(0,110,"[M]保存 [EXIT]退出",0x01);
- else GuiShowStr(0,110,"[SAVE] [EXIT]",0x01);
- }
- if(++susCt>=400)susCt=0;
-
- }
-
-
- void SetLCDResponse(void)
- {
- int FileIndex;
- unsigned long key;
- char Buf[10];
- int x=4;//4
-
- switch(g_ulKeyValue){
-
- case KEY_PANEL_UP:
- if(++sutLcdParam.SetTimeIndex>=5)sutLcdParam.SetTimeIndex=0;
- SetLCDShow(2);//0
- break;
- case KEY_PANEL_DOWN:
- if(sutLcdParam.SetTimeIndex>0)sutLcdParam.SetTimeIndex--;
- else sutLcdParam.SetTimeIndex=4;
- SetLCDShow(2);//0
- break;
- case KEY_PANEL_MENU:
-
- if(sutProductPara.LCDSetIndex!=sutLcdParam.SetTimeIndex)
- {
- fanhui=1;
- sutProductPara.LCDSetIndex=sutLcdParam.SetTimeIndex;
- SaveProductParaToFlash("LCDparm");
- UISetNextStatus(UIS_MENU_MAIN);
- }
- break;
- case KEY_PANEL_EXIT:
- UISetNextStatus(UIS_MENU_MAIN);
- break;
- }
- }
-
- unsigned char modemProcessFlash=0;
- MODEM_UPDATE_DEF m_updStatus;
- unsigned char m_process=0;
- int m_updateTimeout=0;
- char updateStart=0;
- void UpdateStatus(MODEM_UPDATE_DEF status)
- {
- modemProcessFlash=1;
- m_updStatus=status;
- m_updateTimeout=0;
- }
-
-
-
-
-
- void SetUpIntercomVerShow(int update)
- {
- char buf[19];
- if(update){
- GuiClearAll();
- if(0==strcmp(sutProductPara.Language,"cn")) ShowCaption("升级对讲版本",1);
- else ShowCaption("System Update",1);
- GuiDrawHLine(0,159,20,1);
- if(0==strcmp(sutProductPara.Language,"cn"))GuiShowStr(16,56,"升级到最新版本? ",1);
- else GuiShowStr(0,56,"Upgrade New Version",1);
-
- //Upgrade to The latest version
- GuiDrawHLine(0,159,104,1);
-
- if(0==strcmp(sutProductPara.Language,"cn")) GuiShowStr(0,110,"[M]升级 [EXIT]退出",0x01);
- else GuiShowStr(0,110,"[OK] [EXIT]",0x01);
- }
-
- }
- void SetUpIntercomVerResponse(void)
- {
- static char cnt=0;
- //if(updateStart) return;
- if(KEY_PANEL_MENU==g_ulKeyValue)
- {
- // if(sutGpsStatus.PPPStatus != OPEN)
- // {
- // ShowMessageBox("无网络");
- // os_dly_wait(100);
- // UISetNextStatus(UIS_MENU_SYS_SET);
- // return;
- // }
- // updateStart++;
- // GuiClearArea(0, 22, LCD_WIDTH-1, LCD_HEIGHT-22);
- // UpdateStatus(MODEM_STATUS_TRIGGER);
- //AT+POC=542&0&0
- if(0==strcmp(sutProductPara.Language,"cn"))ShowMessageBox("升级至最新版本?");
- else ShowMessageBox("Upgrade New Version?"); //GuiShowStr(0,56,"Upgrade New Version",1);
- cnt++;
- if(cnt==2){
- cnt=0;
- ModemSendAT("AT+POC=542&0&0\r\n");
- UISetNextStatus(UIS_STANDBY);
- }
-
- }
-
- if(KEY_PANEL_EXIT==g_ulKeyValue){
- cnt=0;
- UISetNextStatus(UIS_MENU_SYS_SET);
- }
- }
- char GetApnPara(unsigned char *source, unsigned char whitchOne,unsigned short *accessP, unsigned short *account,unsigned short *passw)
- {
- unsigned char *ptr=source;
- unsigned char getFlag=0;
-
- unsigned short i,noteAddress[9];//总共3组,共9个;号
-
- if(whitchOne >=3) return 1;//只有3组值
- i=0;
- while(*ptr != 0)
- {
- if(*ptr == ';')
- {
- if(getFlag < 9)
- {
- noteAddress[getFlag++]=i;
- }else{
- //收够了
- break;
- }
- }
- i++;
- ptr++;
- }
- if(getFlag != 9) return 2;//资源文件内容有错误
- switch(whitchOne)
- {
- case 0:*accessP=0;*account=noteAddress[0]+1;*passw=noteAddress[1]+1;break;
- case 1:*accessP=noteAddress[2]+1;*account=noteAddress[3]+1;*passw=noteAddress[4]+1;break;
- case 2:*accessP=noteAddress[5]+1;*account=noteAddress[6]+1;*passw=noteAddress[7]+1;break;
- }
- return 0;
- }
- char ReadApnData(unsigned char *source,unsigned char witchone,char *apnapn,char *apnname,char *apnpass)
- {//从缓存中获取数据段,一次一组
- unsigned char *accessPV,*accountV,*passwV;
- unsigned short accessP,account,passw;
- unsigned short i;
- char buf[30];
- if(GetApnPara(source, witchone, &accessP, &account, &passw))
- {
- SlwTrace(INF, "HGS.apn dataErr",1);//如果初始化失败,则直接使用内存中的了
- return 1;
- }
- accessPV=source+accessP;
- accountV=source+account;
- passwV=source+passw;
- //accesspoint
- if(apnapn != 0)
- {
- if(*accessPV == ';') apnapn[0] = 0;//空数据段
- else{
- for(i=0;i<APN_LEN;i++)
- {
- if(accessPV[i] != ';') apnapn[i]=accessPV[i];
- else{
- apnapn[i]=0;
- break;
- }
- }
- }
- }
- //account name
- if(apnname != 0)
- {
- if(*accountV == ';') apnname[0] = 0;//空数据段
- else{
- for(i=0;i<APN_LEN;i++)
- {
- if(accountV[i] != ';') apnname[i]=accountV[i];
- else{
- apnname[i]=0;
- break;
- }
- }
- }
- }
- //password
- if(apnpass != 0)
- {
- if(*passwV == ';') apnpass[0] = 0;//空数据段
- else{
- for(i=0;i<APN_LEN;i++)
- {
- if(passwV[i] != ';') apnpass[i]=passwV[i];
- else{
- apnpass[i]=0;
- break;
- }
- }
- }
- }
- return 0;
- }
- //读取Para.ini配置文件获取LCD模式
- char GetApnFromSrc(char *src, char index,char *name, char *pass)
- {
- char target[15];
- char finalData[62];
- unsigned char tempLen,i,j;
- j=0;
- index +=1;
- switch(index)
- {
- case 1:case 2:case 3:case 4:
- snprintf(target, sizeof(target), "APN%d", index);
- break;
- default:return 0;
- }
- tempLen=GetParaFromStr(src, target, finalData);
- if(tempLen == 0) return 0;
- for(i=0;i<tempLen;i++)
- {
- if(finalData[i]==',')
- {
- j=i+1;
- finalData[i]=0;
- i=tempLen;
- }
- }
- tempLen=strlen(finalData);
- if(tempLen>30) tempLen=30;
- memcpy(name, finalData, tempLen);
- name[tempLen]=0;
- tempLen=strlen(finalData+j);
- if(tempLen>30) tempLen=30;
- memcpy(pass, finalData+j, tempLen);
- pass[tempLen]=0;
- return 1;
- }
- int HgsApnLen;
- unsigned char validApnNum;
- void APNFileInit(void)
- {
- char tempData[400];//3组APN,每组中每参数30个
- char name[APN_LEN+1];
- char pass[APN_LEN+1];
- int tempLen,i;
-
- ApnFileIndex=GetFileIndex("HGS.apn");
- if(ApnFileIndex == -1)
- {
- printf("No HGS.apn file\r\n");
- goto READ_EXIT;
- }
-
- HgsApnLen=GetFileLen(ApnFileIndex);
- if(HgsApnLen==0)
- {
- printf("HGS.apn empty\r\n");
- goto READ_EXIT;
- }
- //读出数据
- if(HgsApnLen > sizeof(tempData))
- {
- printf("Hgs.apn len=%d,should <=%d\r\n",HgsApnLen,sizeof(tempData));
- HgsApnLen=sizeof(tempData);
- }
- tempLen=ReadFileData(ApnFileIndex,0,HgsApnLen,(u8*)tempData);
- //检测是否显示APN
- tempLen=GetParaFromStr(tempData, "APNSHOW", name);
-
- if(tempLen==0)
- {
- showApn=1;//没有字段,则设置为显示菜单
- printf("No 'APNSHOW'\r\n");
- }else{
- showApn=atoi(name);
- }
- printf("APNSHOW:%d\r\n",showApn);
-
-
- tempLen=GetParaFromStr(tempData, "APNAUTHTYPE", name);
- if(tempLen==0)
- { //默认 NONE
- sutProductPara.ApnAuthType=0;
- printf("No 'APNAUTHTYPE'\r\n");
- }else{
- sutProductPara.ApnAuthType=atoi(name);
- }
- printf("APNAUTHTYPE:%d\r\n", sutProductPara.ApnAuthType);
-
- READ_EXIT:
- //读取APN参数到table
- if(ApnFileIndex==-1 || HgsApnLen==0)
- {//资源文件错误,则只有一个默认APN
- goto SET_ONLY_ONE;
- }else{
- //读出数据
- for(i=0;i<APN_NUM;i++)
- {
- if(0==GetApnFromSrc(tempData, i, name,pass))
- {//获取APN失败,恢复默认
- goto SET_ONLY_ONE;
- }else{
- strcpy(&showApnTable[2*i][0], name);
- strcpy(&showApnTable[2*i+1][0],pass);
- }
- }
-
- if(sutProductPara.APNIndex>3) {
- while(1){
- SlwTrace(INF,"APNIndex error",1);
- }
- }
-
- //如果所选的APN与资源文件的APN 不同则修改
- if(0!=strcmp(showApnTable[sutProductPara.APNIndex*2],sutProductPara.APNName)){
- strcpy(sutProductPara.APNName,showApnTable[sutProductPara.APNIndex*2]);
- strcpy(sutProductPara.APNPass,showApnTable[sutProductPara.APNIndex*2+1]);
- SaveProductParaToFlash("Apn Res Set");
- }
-
- validApnNum=APN_NUM;
- return;
- }
-
- SET_ONLY_ONE:
-
- strcpy(showApnTable[0],APN_NAME);
- strcpy(showApnTable[1],APN_PASSWORD);
- validApnNum=1;
- }
- void SetLanguageShow(int update)
- {
- static unsigned short susCt=0;
- //static char cnt=0;
- char buf[10];
- unsigned char len=0;
- char buf2[20];
- int x=12;//4
- if(update==1){
- GuiClearAll();
- if(0==strcmp(sutProductPara.Language,"cn")) ShowCaption("语种设置",1);
- else ShowCaption("Languages Set",1);
- GuiDrawHLine(0,159,20,1);
- if(0==strcmp(sutProductPara.Language,"cn"))GuiShowStr(x,56," 语种选择: ",1);
- else GuiShowStr(x,56," Choice: ",1);
- if(0==strcmp(sutProductPara.Language,"cn")){
-
- snprintf(buf, sizeof(buf),"%s","中文");
- }else{
- snprintf(buf, sizeof(buf),"%s","English");
- }
- len=strlen(buf);
- GuiShowStr(x+(16*5),56,buf,1);
- GuiReverseRect(x+(16*5),56,8*len,14);//5
- GuiDrawHLine(0,159,104,1);
- susCt=0;
-
- }else if(update == 2){
- memset(buf,0,sizeof(buf));
- //cnt++;
- //Languagecnt++;
- if(0==strcmp(sutProductPara.Language,"cn")){
- if(0!=Languagecnt%2){
- snprintf(buf, sizeof(buf),"%s","English");
-
- }else {
- snprintf(buf, sizeof(buf),"%s","中文");
- }
- }else
- {
- if(0!=Languagecnt%2) snprintf(buf, sizeof(buf),"%s","中文");
- else snprintf(buf, sizeof(buf),"%s","English");
-
- }
- len=strlen(buf);
- GuiClearRect(x+(16*5),56,160,56+16);
- GuiShowStr(x+(16*5),56,buf,1);
- GuiReverseRect(x+(16*5),56,8*len,16);//5 //14
- GuiDrawHLine(0,159,104,1);
- }
-
- if(susCt==0){
- if(0==strcmp(sutProductPara.Language,"cn")) GuiShowStr(0,110,"[上]选择 [下]选择",0x01);
- else GuiShowStr(0,110,"[UP] [DOWN]",0x01);
-
- }else if(susCt==200){
- if(0==strcmp(sutProductPara.Language,"cn")) GuiShowStr(0,110,"[M]保存 [EXIT]退出",0x01);
- else GuiShowStr(0,110,"[SAVE] [EXIT]",0x01);
- }
- if(++susCt>=400)susCt=0;
- }
- void SetLanguageResponse(void)
- {
- //static char cnt=0;
- char Tempbuf[60];
- switch(g_ulKeyValue){
-
- case KEY_PANEL_UP:
- //cnt++;
- Languagecnt++;
- SetLanguageShow(2);//0
- break;
- case KEY_PANEL_DOWN:
- //cnt++;
- Languagecnt++;
- SetLanguageShow(2);//0
- break;
- case KEY_PANEL_MENU:
- if(0==Languagecnt%2){
- UISetNextStatus(UIS_MENU_SYS_SET);
-
- }else{
- Languagecnt=0;
- if(0==strcmp(sutProductPara.Language,"cn")){
- strcpy(sutProductPara.Language,"en");
- if(sutProductPara.Netmode>2){
- sutProductPara.Netmode=0;
- GetMododexWithCard();
- }
- }else strcpy(sutProductPara.Language,"cn");
- }
- SaveProductParaToFlash("MENU_SWGPS");
- fanhui=1;
- UISetNextStatus(UIS_MENU_SYS_SET);
- if(0==strcmp(sutProductPara.Language,"cn")){
- strncpy(Tempbuf,"AT+POC=512&0\r\n",sizeof(Tempbuf));
- }else{
- strncpy(Tempbuf,"AT+POC=512&1\r\n",sizeof(Tempbuf));
- }
- SlwTrace(INF,Tempbuf,1);
- ModemSendAT(Tempbuf);
- break;
- case KEY_PANEL_EXIT:
- Languagecnt=0;
- UISetNextStatus(UIS_MENU_SYS_SET);
- break;
- }
-
- }
- void SetKeySoundShow(int update)
- {
- static unsigned short susCt=0;
- static char cnt=0;
- char buf[10];
- unsigned char len=0;
- char buf2[20];
- int x=12;//4
- if(update==1){
- GuiClearAll();
- if(0==strcmp(sutProductPara.Language,"cn"))ShowCaption("按键音设置",1);
- else ShowCaption("KeySound Set",1);
- GuiDrawHLine(0,159,20,1);
- if(0==strcmp(sutProductPara.Language,"cn"))GuiShowStr(x,56," 键音开关: ",1);
- else GuiShowStr(x,56," Switch: ",1);
- snprintf(buf, sizeof(buf),"%s",sutProductPara.Keysound);
- len=strlen(buf);
- GuiShowStr(x+(16*5),56,buf,1);
- GuiReverseRect(x+(16*5),56,8*len,14);//5
- GuiDrawHLine(0,159,104,1);
- susCt=0;
- }else if(update == 2){
- memset(buf,0,sizeof(buf));
- cnt++;
- if(0==strcmp(sutProductPara.Keysound,"open")){
-
- if(0!=cnt%2){
-
- snprintf(buf, sizeof(buf),"%s","close");
- }else {
-
- snprintf(buf, sizeof(buf),"%s","open");
- }
-
- }else
- {
- if(0!=cnt%2) snprintf(buf, sizeof(buf),"%s","open");
- else snprintf(buf, sizeof(buf),"%s","close");
- }
- len=strlen(buf);
- GuiClearArea(x+(16*5),56,160,14); ////////////////////////
- GuiShowStr(x+(16*5),56,buf,1);
- GuiReverseRect(x+(16*5),56,8*len,14);//5
- GuiDrawHLine(0,159,104,1);
- }
-
- if(susCt==0){
- if(0==strcmp(sutProductPara.Language,"cn")) GuiShowStr(0,110,"[上]选择 [下]选择",0x01);
- else GuiShowStr(0,110,"[UP] [DOWN]",0x01);
-
- }else if(susCt==200){
- if(0==strcmp(sutProductPara.Language,"cn")) GuiShowStr(0,110,"[M]保存 [EXIT]退出",0x01);
- else GuiShowStr(0,110,"[SAVE] [EXIT]",0x01);
- }
- if(++susCt>=400)susCt=0;
- }
- void SetKeysoundResponse(void)
- {
- static char cnt=0;
-
- switch(g_ulKeyValue){
-
- case KEY_PANEL_UP:
- cnt++;
- SetKeySoundShow(2);//0
- break;
- case KEY_PANEL_DOWN:
- cnt++;
- SetKeySoundShow(2);//0
- break;
- case KEY_PANEL_MENU:
-
- if(0==cnt%2){
- UISetNextStatus(UIS_MENU_SYS_SET);
- }else{
-
- if(0==strcmp(sutProductPara.Keysound,"open")){
- strcpy(sutProductPara.Keysound,"close");
- }else strcpy(sutProductPara.Keysound,"open");
-
- }
- printf("start set--------------------\r\n");
- SaveProductParaToFlash("MENU_SWGPS");
- fanhui=1;
- UISetNextStatus(UIS_MENU_SYS_SET);
- break;
- case KEY_PANEL_EXIT:
- UISetNextStatus(UIS_MENU_SYS_SET);
- break;
- }
-
- }
- void SetStartInfoShow(int update)
- {
- if(update){
- GuiClearAll();
- GuiShowBmp(0,0,"update.bmp");
- }
- }
- //void MessageBoxShow(int update)
- //{
- // if(update){
- // GuiClearArea(0,19,160,90);
- // ShowMessageBox("请先解锁!");
- // os_dly_wait(10);
- // UISetNextStatus(UIS_STANDBY);
- // }
- //}
- void SetFastInterfaceModeShow(int update) //快捷界面设置
- {
- int i;
- char**p=NULL;
- char GroupsFeatures[2];
- static const char *accIconFileName[]={
- "APN.bmp",
- "APN1.bmp",
- ""
- };
- static const char*ModeName[]={
- "群组选择",
- "成员选择",
- //"语音记录",
- ""
- };
-
- static const char *apcModeName[]={
- "Group Option",
- "Member Option",
- // "Voice record",
- ""
- };
- if(0==strcmp(sutProductPara.Language,"cn"))
- {
- p=ModeName;
-
- }else{
- p=apcModeName;
- }
- memset(GroupsFeatures,0,sizeof(GroupsFeatures));
-
- if(update){
- GuiClearAll();
- if(0==strcmp(sutProductPara.Language,"cn"))ShowCaption("快捷界面设置",2);//
- else ShowCaption("FastInterface",2);//
- GuiDrawHLine(0,159,20,1);
-
- //设置Features 将决定选择图标
- GroupsFeatures[sutProductPara.FastInterface]=1;
- ListBoxInit(&sutListBox,p,0,accIconFileName,GroupsFeatures);
- //----------------------------
- GuiDrawHLine(0,159,104,1);
- if(0==strcmp(sutProductPara.Language,"cn")) GuiShowStr(0,110,"[上]选择 [下]退出",0x01);
- else GuiShowStr(0,110,"[UP] [DOWN]",0x01);
- }
- }
-
-
- void SetFastInterfaceModeResponse(void)
- {
- unsigned long key;
- key=ListBoxResponse(&sutListBox);
-
- if(KEY_PANEL_MENU==key)
- {
- if(sutProductPara.FastInterface!=sutListBox.handle){
- sutProductPara.FastInterface=sutListBox.handle;
- SaveProductParaToFlash("SetFastInter");
- os_dly_wait(1);
- }
- fanhui=1;
- UISetNextStatus(UIS_MENU_SYS_SET);
- }
- else if(KEY_PANEL_EXIT==key)UISetNextStatus(UIS_MENU_SYS_SET);
-
- }
- /****************************2G 3G 4G****************************************/
- void SetNetModeShow(int update) //
- {
- int i;
- char**p=NULL;
- char GroupsFeatures[4];
- static const char *accIconFileName[]={
- "APN.bmp",
- "APN1.bmp",
- ""
- };
- static const char*ModeName[]={
- "Auto",
- "4G",
- "3G",
- "2G",
- ""
- };
- static const char*apcModeName[]={
- "Auto",
- "4G",
- "3G",
- ""
- };
-
-
- if(0==strcmp(sutProductPara.Language,"cn"))
- {
- p=ModeName;
-
- }else{
- p=apcModeName;
- }
- memset(GroupsFeatures,0,sizeof(GroupsFeatures));
-
- if(update){
- GuiClearAll();
- if(0==strcmp(sutProductPara.Language,"cn"))ShowCaption("网络设置",2);//
- else ShowCaption("NetMode Set",2);//
- GuiDrawHLine(0,159,20,1);
- //设置Features 将决定选择图标
- GroupsFeatures[sutProductPara.Netmode]=1;
-
- ListBoxInit(&sutListBox,p,0,accIconFileName,GroupsFeatures);
- //----------------------------
- GuiDrawHLine(0,159,104,1);
- if(0==strcmp(sutProductPara.Language,"cn")) GuiShowStr(0,110,"[上]选择 [下]退出",0x01);
- else GuiShowStr(0,110,"[UP] [DOWN]",0x01);
-
- }
- }
-
- void SetNetModeResponse(void)
- {
- unsigned char i=0;
- unsigned long key;
- key=ListBoxResponse(&sutListBox);
- if(KEY_PANEL_MENU==key)
- {
- if(sutProductPara.LowConsumption==1)
- {
- if(0==strcmp(sutProductPara.Language,"cn"))ShowMessageBox("低功耗中无法设置");
- else ShowMessageBox("Unable to set");
- i=50;
- while(i--)
- OsDelayTime(1);
- fanhui=1;
- UISetNextStatus(UIS_MENU_SYS_SET);
- return;
- }
- sutProductPara.Netmode=sutListBox.handle;
- SaveProductParaToFlash("MENU_SetVolume");
- os_dly_wait(1);
- switch(sutProductPara.Netmode)
- {
- case 0:
- //ModemSendAT("at+zsnt=0,0,0\r\n"); //AUTO
- GetMododexWithCard();
- break;
- case 1:
- //ModemSendAT("at+zsnt=6,0,0\r\n"); //4g
- GetMododexWithCard();
- break;
- case 2:
- //ModemSendAT("at+zsnt=9,0,0\r\n");//3
- GetMododexWithCard();
- break;
- case 3:
- //ModemSendAT("at+zsnt=4,0,0\r\n");//2
- GetMododexWithCard();
- break;
- }
-
-
- fanhui=1;
- UISetNextStatus(UIS_MENU_SYS_SET);
- }
- else if(KEY_PANEL_EXIT==key)UISetNextStatus(UIS_MENU_SYS_SET);
-
- }
- /**********************功放*********************************/
- void SetAwModeShow(int update) //
- {
- int i;
- char**p=NULL;
- char GroupsFeatures[2];
- static const char *accIconFileName[]={
- "APN.bmp",
- "APN1.bmp",
- ""
- };
- static const char*ModeName[]={
- "K类",
- "免提",
- ""
- };
-
- static const char *apcModeName[]={
- "K Class",
- "HandsFree",
- ""
- };
- if(0==strcmp(sutProductPara.Language,"cn"))
- {
- p=ModeName;
-
- }else{
- p=apcModeName;
- }
- memset(GroupsFeatures,0,sizeof(GroupsFeatures));
-
- if(update){
- GuiClearAll();
- if(0==strcmp(sutProductPara.Language,"cn"))ShowCaption("功放设置",2);//
- else ShowCaption("AwMode Set",2);//
- GuiDrawHLine(0,159,20,1);
- //设置Features 将决定选择图标
- GroupsFeatures[sutProductPara.Aw8735]=1;
-
- ListBoxInit(&sutListBox,p,0,accIconFileName,GroupsFeatures);
- //----------------------------
- GuiDrawHLine(0,159,104,1);
- if(0==strcmp(sutProductPara.Language,"cn")) GuiShowStr(0,110,"[上]选择 [下]退出",0x01);
- else GuiShowStr(0,110,"[UP] [DOWN]",0x01);
-
- }
- }
-
- void SetAwModeResponse(void)
- {
- unsigned long key;
- key=ListBoxResponse(&sutListBox);
- if(KEY_PANEL_MENU==key)
- {
- if(sutProductPara.Aw8735!=sutListBox.handle){
- sutProductPara.Aw8735=sutListBox.handle;
- SaveProductParaToFlash("MENU_SetVolume");
- os_dly_wait(1);
- }
- fanhui=1;
- UISetNextStatus(UIS_MENU_SYS_SET);
- }
- else if(KEY_PANEL_EXIT==key)UISetNextStatus(UIS_MENU_SYS_SET);
-
- }
-
- /**********************低功耗********************************/
- void SetLowConsumptionModeShow(int update) //
- {
- int i;
- char**p=NULL;
- char GroupsFeatures[2];
- static const char *accIconFileName[]={
- "APN.bmp",
- "APN1.bmp",
- ""
- };
- static const char*ModeName[]={
- "关",
- "开",
- ""
- };
-
- static const char *apcModeName[]={
- "close",
- "open",
- ""
- };
- if(0==strcmp(sutProductPara.Language,"cn"))
- {
- p=ModeName;
-
- }else{
- p=apcModeName;
- }
- memset(GroupsFeatures,0,sizeof(GroupsFeatures));
-
- if(update){
- GuiClearAll();
- if(0==strcmp(sutProductPara.Language,"cn"))ShowCaption("低功耗设置",2);//
- else ShowCaption("LowConsumption",2);//
- GuiDrawHLine(0,159,20,1);
- //设置Features 将决定选择图标
- GroupsFeatures[sutProductPara.LowConsumption]=1;
-
- ListBoxInit(&sutListBox,p,0,accIconFileName,GroupsFeatures);
- //----------------------------
- GuiDrawHLine(0,159,104,1);
- if(0==strcmp(sutProductPara.Language,"cn")) GuiShowStr(0,110,"[上]选择 [下]退出",0x01);
- else GuiShowStr(0,110,"[UP] [DOWN]",0x01);
-
- }
- }
-
- void SetLowConsumptionResponse(void)
- {
- unsigned long key;
- key=ListBoxResponse(&sutListBox);
- if(KEY_PANEL_MENU==key)
- {
- if(sutProductPara.LowConsumption!=sutListBox.handle){
- sutProductPara.LowConsumption=sutListBox.handle;
-
- if(sutProductPara.LowConsumption==0)
- { switch(sutProductPara.Netmode)
- {
- case 0:
- GetMododexWithCard();
- break;
- case 1:
- GetMododexWithCard();//4g
- break;
- case 2:
- GetMododexWithCard();//3
- break;
-
- }
- os_dly_wait(30);
- ModemSendAT("AT+POC=558&0\r\n");
- }else { //4g
- sutProductPara.Netmode=1;
- GetMododexWithCard();
- os_dly_wait(30);
- ModemSendAT("AT+POC=558&1\r\n");
- }
-
- SaveProductParaToFlash("MENU_SetVolume");
- os_dly_wait(1);
- }
- fanhui=1;
- UISetNextStatus(UIS_MENU_SYS_SET);
- }
- else if(KEY_PANEL_EXIT==key)UISetNextStatus(UIS_MENU_SYS_SET);
-
- }
- //unsigned char MododrxTable[4][4]={{7,6,5,4},{7,6,6,1},{7,6,2,1},{7,6,2,1}}; //电信 移动 联通 国外
- unsigned char MododrxTable[4]={0,4,3,2}; //电信 移动 联通 国外
- void GetMododexWithCard(void)
- {
- char buf[30];
- //根据CardType和ModeSetup转换为Mododex值的一个表
- //static const unsigned char MododrxTable[3][3]={{11,24,5},{2,8,5},{17,21,5}};
- //if(thisYunYingShang>3) return;
- snprintf(buf,sizeof(buf),"at+zsnte=%d\r\n",MododrxTable[sutProductPara.Netmode]);
- //"at+zsnt=0,0,0\r\n"
- ModemSendAT(buf);
- }
-
- void WaitOneCallShow(int update)
- {
- char buf[50];
- if(update){
- GuiClearAll();
- if(0==strcmp(sutProductPara.Language,"cn"))snprintf(buf,sizeof(buf),"呼叫:%s",sutPocStatus.Callname);
- else snprintf(buf,sizeof(buf),"Call:%s",sutPocStatus.Callname);
- ShowMessageBox(buf);
-
- // UISetNextStatus(UIS_STANDBY);
- if(0==strcmp(sutProductPara.Language,"cn"))GuiShowStr(0,110," 挂断",0x01);//GuiShowStrM20(135,113,"挂断",1,COLOR_WHITE,OrangeColorId);
- else GuiShowStr(0,110," HangUp",0x01);//GuiShowStrM20(105,111,"HangUp",1,COLOR_WHITE,OrangeColorId);//113
- }
- }
-
- void WaitOneCallResponse()
- {
- unsigned long key;
- char buf[40];
- key=g_ulKeyValue;
- if(KEY_PANEL_EXIT==key){
- //UISetNextStatus(UIS_MENU_MAIN);
- snprintf(buf,sizeof(buf),"AT+POC=540&2&%d\r\n",sutPocStatus.CallID);
- ModemSendAT(buf);
- }
- }
-
- void SetFactory_KeyShow(int update)
- {
- static unsigned short susCt=0;
- char buf[10];
- char buf1[6];
- int x=64;//4
- int i;
- if(update==1){
- GuiClearAll();
- ShowCaption("按键测试",1);//0
- GuiDrawHLine(0,159,20,1);
- GuiShowStr(x,56,"按键",1);
- GuiShowStr(x,56+18,"无",1);
- }
-
- }
- void Factory_KeyResponse()
- {
- int FileIndex;
- static unsigned long Lastkey=-1;
- char Buf[10];
- int x=64;//4
- Lastkey=KeyScanPort();
-
- if(Lastkey!=((KEY_ALL_PORTB<<16)| KEY_ALL_PORTC))
- {
- switch(Lastkey)
- {
- case KEY_PPT:
- GuiClearArea(x,56+18,80,18);
- GuiShowStr(x,56+18,"左一",1); //二
- break;
- case KEY_SOS_OK:
- GuiClearArea(x,56+18,80,18);
- GuiShowStr(x,56+18,"上一",1);
- break;
-
- case KEY_INFO:
- GuiClearArea(x,56+18,80,18);
- GuiShowStr(x,56+18,"左一",1);
- break;
- case KEY_FUNC_P2:
- GuiClearArea(x,56+18,80,18);
- GuiShowStr(x,56+18,"左二",1); //三
- break;
- case KEY_FUNC_P3:
- GuiClearArea(x,56+18,80,18);
- GuiShowStr(x,56+18,"左三",1);
- break;
-
- case KEY_PANEL_MENU:
- GuiClearArea(x,56+18,80,18);
- GuiShowStr(x,56+18,"正一",1);
- break;
-
- case KEY_PANEL_UP:
- GuiClearArea(x,56+18,80,18);
- GuiShowStr(x,56+18,"正二",1);
- break;
- case KEY_PANEL_DOWN:
- GuiClearArea(x,56+18,80,18);
- GuiShowStr(x,56+18,"正三",1);
- break;
- case KEY_PANEL_EXIT:
- GuiClearArea(x,56+18,80,18);
- GuiShowStr(x,56+18,"正四",1);
- os_dly_wait(100);
- UISetNextStatus(UIS_FACTORY_MENU);
- break;
-
- }
-
- }
- else
- {
- GuiClearArea(x,56+18,80,18);
- GuiShowStr(x,56+18,"无",1);
- }
-
- }
- void SetFactory_LCDShow(int update)
- {
- if(update){
- GuiClearAll();
- }
- }
- void Factory_LcdResponse()
- {
- static unsigned char KeyCnt=0;
-
-
-
- if(KEY_PANEL_UP==g_ulKeyValue||KEY_PANEL_DOWN==g_ulKeyValue){
-
- if(++KeyCnt>3)KeyCnt=0;
- if(KeyCnt==1)GuiClearAllM20Test(RedColorId);
- else if(KeyCnt==2)GuiClearAllM20Test(GreenColorId);
- else if(KeyCnt==3)GuiClearAllM20Test(BlueColorId);
- else if(KeyCnt==0)GuiClearAll();
-
- }else if(KEY_PANEL_EXIT==g_ulKeyValue){
- KeyCnt=0;
- UISetNextStatus(UIS_FACTORY_MENU);
- }
-
- }
- void SetFactory_LEDShow(int update)
- {
- unsigned char x=64;
-
- if(update==1){
- GuiClearAll();
- ShowCaption("LED测试",1);//0
- GuiDrawHLine(0,159,20,1);
- // GuiShowStr(x,56,"红灯--按UP",1);
- ShowCaptionArea("红灯--按UP",0,160,56);
- // GuiShowStr(x,56+18,"绿灯--按DOWN",1);
- ShowCaptionArea("绿灯--按DOWN",0,160,56+18);
- }
-
- }
- /*
- NotBright=0, //均不亮
- RedBright, //红灯常亮
- RedFastFlash, //红灯快闪
- RedSlowFlash, //红灯慢闪
- BlueBright, //蓝灯常亮
- BlueFastFlash, //蓝灯快闪
- BlueSlowFlash, //蓝灯慢闪
- RedBlueBright, //红蓝常亮
- RedBlueFastFlash, //红蓝快闪
- RedBlueSlowFlash //红蓝慢闪
- */
- void Factory_LEDResponse()
- {
-
- static unsigned char KeyCnt=0;
- if(KEY_PANEL_UP==g_ulKeyValue){
-
- if(!KeyCnt){
- SetLedStatus(RedBright);
- }else{
- SetLedStatus(NotBright);
- }
- KeyCnt=!KeyCnt;
-
- }else if(KEY_PANEL_DOWN==g_ulKeyValue){
-
- if(!KeyCnt){
- SetLedStatus(BlueBright);
- }else{
- SetLedStatus(NotBright);
- }
- KeyCnt=!KeyCnt;
- }else if(KEY_PANEL_EXIT==g_ulKeyValue){
- KeyCnt=0;
- SetLedStatus(NotBright);
- UISetNextStatus(UIS_FACTORY_MENU);
- }
- }
- void SetFactory_VBATShow(int update)
- {
- unsigned char x=64;
- unsigned char buf[20];
- static unsigned int susCt=0;
- static unsigned int lastVbat=0;
-
- if(update==1){
- GuiClearAll();
- ShowCaption("电压值",1);//0
- GuiDrawHLine(0,159,20,1);
-
- if(Mcu_Type==MCU_ST){
- GuiShowStr(18,38,"ST",1);
- }else if(Mcu_Type==MCU_HK){
-
- GuiShowStr(18,38,"HK",1);
-
- }else{
- GuiShowStr(18,38,"未知",1);
- }
-
-
- snprintf(buf,sizeof(buf),"%d",g_iVbat);
- GuiShowStr(x,38,buf,1);
- if(sutProductPara.VbatCalibration>0)snprintf(buf,sizeof(buf),"校准值:%03d",sutProductPara.VbatCalibration);
- else snprintf(buf,sizeof(buf),"校准值:%03d",sutProductPara.VbatCalibration);
- GuiShowStr(18,56,buf,1);
- }
-
- if(susCt==200||susCt==0){
- if(lastVbat!=g_iVbat){
- lastVbat=g_iVbat;
- snprintf(buf,sizeof(buf),"%d",lastVbat);
- GuiShowStr(x,38,buf,1);
- }
- if(lastVbat>432){ // 或者IC判饱
- snprintf(buf,sizeof(buf),"合格");
- GuiShowStr(x,56+18+18,buf,1);
- }else GuiClearRect(x,56+18+18,160,56+18+18+18);
- }
- if(++susCt>=400)susCt=0;
- }
- void Factory_VBATResponse()
- {
- char buf[20];
-
- if(KEY_PANEL_EXIT==g_ulKeyValue){
-
- UISetNextStatus(UIS_FACTORY_MENU);
-
- }else if(KEY_PANEL_UP==g_ulKeyValue){
- if(++sutProductPara.VbatCalibration>20)sutProductPara.VbatCalibration=-15;
- snprintf(buf,sizeof(buf),"校准值:%03d",sutProductPara.VbatCalibration);
- GuiShowStr(18,56,buf,1);
- }else if(KEY_PANEL_DOWN==g_ulKeyValue)
- {
- if(--sutProductPara.VbatCalibration<-20)sutProductPara.VbatCalibration=15;
- snprintf(buf,sizeof(buf),"校准值:%03d",sutProductPara.VbatCalibration);
- GuiShowStr(18,56,buf,1);
- }else if(KEY_PANEL_MENU==g_ulKeyValue)
- {
- ShowMessageBox("正在保存");
- SaveProductParaToFlash("SAVE VBATCAL");
- UISetNextStatus(UIS_FACTORY_MENU);
- }
-
- }
- /**********************PTT 按键音*********************************/
- void SetPttToneModeShow(int update) //
- {
- int i;
- char**p=NULL;
- char TempStatue=0;
- char GroupsFeatures[4];
- static short susCt=0;
-
- static const char *accIconFileName[]={
- "APN.bmp",
- "APN1.bmp",
- ""
- };
-
- static const char*ModeName[]={
- "全关", //0x00
- "仅发送提示", //0x01
- "仅接收提示", //0x10
- "全开", //0x11
- ""
- };
- static const char *apcModeName[]={
- "Full Close",
- "Only Send",
- "Only Recv",
- "Full Open",
- ""
- };
- if(0==strcmp(sutProductPara.Language,"cn"))
- {
- p=ModeName;
- }else{
- p=apcModeName;
- }
- memset(GroupsFeatures,0,sizeof(GroupsFeatures));
-
- if(update){
- susCt=0;
- GuiClearAll();
- if(0==strcmp(sutProductPara.Language,"cn"))ShowCaption("PTT提示音设置",2);//
- else ShowCaption("PttTone Set",2);//
- GuiDrawHLine(0,159,20,1);
- //设置Features 将决定选择图标
- TempStatue=(sutProductPara.SendToneEnadble)|(sutProductPara.RecvToneEnadble<<1);
-
- GroupsFeatures[TempStatue]=1;
-
- ListBoxInit(&sutListBox,p,0,accIconFileName,GroupsFeatures);
- //----------------------------
- GuiDrawHLine(0,159,104,1);
- }
- if(susCt==0){
- if(0==strcmp(sutProductPara.Language,"cn")) GuiShowStr(0,110,"[上]选择 [下]选择",0x01);
- else GuiShowStr(0,110,"[UP] [DOWN]",0x01);
-
- }else if(susCt==200){
- if(0==strcmp(sutProductPara.Language,"cn")) GuiShowStr(0,110,"[M]保存 [EXIT]退出",0x01);
- else GuiShowStr(0,110,"[SAVE] [EXIT]",0x01);
- }
- if(++susCt>=400)susCt=0;
-
-
-
- }
-
- void SetPttToneResponse(void)
- {
- unsigned long key;
- char TempStatue=0;
- char buf[25];
- key=ListBoxResponse(&sutListBox);
-
- if(KEY_PANEL_MENU==key)
- {
- TempStatue=(sutProductPara.SendToneEnadble)|(sutProductPara.RecvToneEnadble<<1);
- if(TempStatue!=sutListBox.handle){
- memset(buf,0,sizeof(buf));
- TempStatue=sutListBox.handle;
- sutProductPara.SendToneEnadble=TempStatue&0x01;
- sutProductPara.RecvToneEnadble=TempStatue>>1;
- SaveProductParaToFlash("MENU_SetPttTone");
- snprintf(buf,sizeof(buf),"AT+POC=511&%d&%d&1\r\n",sutProductPara.SendToneEnadble,sutProductPara.RecvToneEnadble);
- ModemSendAT(buf);
- os_dly_wait(1);
- }
- fanhui=1;
- UISetNextStatus(UIS_MENU_SYS_SET);
- }
- else if(KEY_PANEL_EXIT==key)UISetNextStatus(UIS_MENU_SYS_SET);
- }
-
- void SetADBDebugShow(int update) //
- {
- int i;
- char**p=NULL;
- char GroupsFeatures[2];
- static short susCt=0;
-
- static const char *accIconFileName[]={
- "APN.bmp",
- "APN1.bmp",
- ""
- };
-
- static const char*ModeName[]={
- "关闭", //0x00
- "打开", //0x01
- ""
- };
- static const char *apcModeName[]={
- "close",
- "open",
- ""
- };
- if(0==strcmp(sutProductPara.Language,"cn"))
- {
- p=ModeName;
- }else{
- p=apcModeName;
- }
- memset(GroupsFeatures,0,sizeof(GroupsFeatures));
-
- if(update){
- susCt=0;
- GuiClearAll();
- if(0==strcmp(sutProductPara.Language,"cn"))ShowCaption("USB调试",2);//
- else ShowCaption("USB debug",2);//
- GuiDrawHLine(0,159,20,1);
- //设置Features 将决定选择图标
-
- GroupsFeatures[AdbDebug]=1;
-
- ListBoxInit(&sutListBox,p,0,accIconFileName,GroupsFeatures);
- //----------------------------
- GuiDrawHLine(0,159,104,1);
- }
- if(susCt==0){
- if(0==strcmp(sutProductPara.Language,"cn")) GuiShowStr(0,110,"[上]选择 [下]选择",0x01);
- else GuiShowStr(0,110,"[UP] [DOWN]",0x01);
-
- }else if(susCt==200){
- if(0==strcmp(sutProductPara.Language,"cn")) GuiShowStr(0,110,"[M]保存 [EXIT]退出",0x01);
- else GuiShowStr(0,110,"[SAVE] [EXIT]",0x01);
- }
- if(++susCt>=400)susCt=0;
- }
- void SetAdbDebugResponse(void)
- {
- unsigned long key;
- char buf[25];
- key=ListBoxResponse(&sutListBox);
- if(KEY_PANEL_MENU==key)
- {
- if(AdbDebug!=sutListBox.handle){
- memset(buf,0,sizeof(buf));
- AdbDebug=sutListBox.handle;
- if(AdbDebug){
- snprintf(buf,sizeof(buf),"at+zadset=d\r\n");
- ModemSendAT(buf);
- SlwTrace(INF,buf,1);
- os_dly_wait(1);
- fanhui=1;
- UISetNextStatus(UIS_MENU_SYS_SET);
- }
- else{
- //重启模块
- ShowMessageBox("reboot...");
- while(1);
- // sutPocStatus.modemRstFlag=1;
- // os_dly_wait(100);
- // UISetNextStatus(UIS_STANDBY);
- return;
- }
-
- }
-
- }
- else if(KEY_PANEL_EXIT==key)UISetNextStatus(UIS_MENU_SYS_SET);
- }
-
- void SetBOOTDebugShow(int update) //
- {
- int i;
- char**p=NULL;
- char GroupsFeatures[2];
- static short susCt=0;
-
- static const char *accIconFileName[]={
- "APN.bmp",
- "APN1.bmp",
- ""
- };
-
- static const char*ModeName[]={
- "普通模式", //0x00
- "升级模式", //0x01
- ""
- };
- static const char *apcModeName[]={
- "close",
- "open",
- ""
- };
- if(0==strcmp(sutProductPara.Language,"cn"))
- {
- p=ModeName;
- }else{
- p=apcModeName;
- }
- memset(GroupsFeatures,0,sizeof(GroupsFeatures));
- if(update){
- susCt=0;
- GuiClearAll();
- if(0==strcmp(sutProductPara.Language,"cn"))ShowCaption("固件升级",2);//
- else ShowCaption("BOOT updata",2);//
- GuiDrawHLine(0,159,20,1);
- //设置Features 将决定选择图标
- GroupsFeatures[BOOTDebug]=1;
- ListBoxInit(&sutListBox,p,0,accIconFileName,GroupsFeatures);
- //----------------------------
- GuiDrawHLine(0,159,104,1);
- }
- if(susCt==0){
- if(0==strcmp(sutProductPara.Language,"cn")) GuiShowStr(0,110,"[上]选择 [下]选择",0x01);
- else GuiShowStr(0,110,"[UP] [DOWN]",0x01);
-
- }else if(susCt==200){
- if(0==strcmp(sutProductPara.Language,"cn")) GuiShowStr(0,110,"[M]保存 [EXIT]退出",0x01);
- else GuiShowStr(0,110,"[SAVE] [EXIT]",0x01);
- }
- if(++susCt>=400)susCt=0;
- }
- void SetBOOTDebugResponse(void)
- {
- unsigned long key;
- char buf[25];
- key=ListBoxResponse(&sutListBox);
- if(KEY_PANEL_MENU==key)
- {
-
- if(BOOTDebug!=sutListBox.handle){
- memset(buf,0,sizeof(buf));
- BOOTDebug=sutListBox.handle;
- if(BOOTDebug){
- ShowMessageBox("reboot...");
- MODEN_BOOT_EN_HIGH;
- os_dly_wait(100);
- MODEM_RESET_HIGH;
- os_dly_wait(100);
- MODEM_RESET_LOW;
- CHARGE_IC_HIGH;//断掉充电IC
- }else{
- ShowMessageBox("normal...");
- MODEN_BOOT_EN_LOW;
- os_dly_wait(50);
- sutPocStatus.modemRstFlag=1;
- }
- //UIS_BOOTUPATE_SHOW
- //UISetNextStatus(UIS_STANDBY);
- UISetNextStatus(UIS_BOOTUPATE_SHOW);
- }
- }
- else if(KEY_PANEL_EXIT==key)UISetNextStatus(UIS_MENU_SYS_SET);
- }
- void PowerOffShow(int update) //
- {
- int i;
-
- if(update){
- GuiClearAll();
- GuiDrawHLine(0,159,20,1);
- if(0==strcmp(sutProductPara.Language,"cn"))ShowCaption("关机提示",2);//
- else ShowCaption("PowerOff",2);//
- if(0==strcmp(sutProductPara.Language,"cn")) ShowCaption("确定关机?",48);
- else ShowCaption("PowerOff?",48);
- //----------------------------
- GuiDrawHLine(0,159,104,1);
- }
- if(0==strcmp(sutProductPara.Language,"cn")) GuiShowStr(0,110,"确定 退出",0x01);
- else GuiShowStr(0,110,"[MENU] [EXIT]",0x01);
-
- }
- void SetPowerOffResponse(void)
- {
- unsigned long key;
- char buf[25];
- if(KEY_PANEL_MENU==g_ulKeyValue)
- {
- SlwTrace(INF, "PwrOffOk",1);
- ShowMessageBox("正在关机...");
- MODEN_POWER_EN_HIGH;
- IWDG_ReloadCounter();
- os_dly_wait(100);
- MODEN_POWER_EN_LOW;
- IWDG_ReloadCounter();
- os_dly_wait(220);
- PWR_EN_LOW;
- while(1);
- }
- else if(KEY_PANEL_EXIT==g_ulKeyValue){
- if(!g_uGtFactory)UISetNextStatus(UIS_STANDBY);
- else UISetNextStatus(UIS_FACTORY_MENU);
- }
- }
- void BootUptating(int update)
- {
- if(update)
- {
- GuiClearAll();
-
- ShowCaption("升级模式",64);
- }
- }
|