huangyongliang 2 gadi atpakaļ
vecāks
revīzija
31192dc371
23 mainītis faili ar 1159 papildinājumiem un 194 dzēšanām
  1. 2 0
      CMakeLists.txt
  2. BIN
      D29V菜单.xlsx
  3. 5 5
      app/GpsData.c
  4. 7 1
      app/GpsData.h
  5. 1 1
      app/Interface/Palace.h
  6. 65 19
      app/app.c
  7. 1 0
      app/app.h
  8. 1 2
      app/appAuth.c
  9. 2 2
      app/board.h
  10. 8 4
      app/gpsCtl.c
  11. 1 0
      app/gpsCtl.h
  12. 5 6
      app/hook.c
  13. 5 1
      app/includes.h
  14. 128 28
      app/poc.c
  15. 4 2
      app/poc.h
  16. 10 5
      app/setting.c
  17. 8 2
      app/setting.h
  18. 486 75
      app/uiBlock.c
  19. 31 0
      app/uiBlock.h
  20. 79 5
      app/uiEntry.c
  21. 23 0
      app/uiEntry.h
  22. 237 24
      app/xinbiao.c
  23. 50 12
      app/xinbiao.h

+ 2 - 0
CMakeLists.txt

@@ -34,6 +34,7 @@ set(app_file ./hpocapp.c
 	${app_dir}/common.c
 	${app_dir}/bsp.c
 	${app_dir}/ble.c
+	${app_dir}/xinbiao.c
 	${debug_files})
 
 set(log_dir ${app_dir}/log)
@@ -57,6 +58,7 @@ set(interface_file ${interface_dir}/Palace.c
 				   ${interface_dir}/ListBoxSMS.c
 				   ${interface_dir}/NumEdit.c
 				   ${interface_dir}/ManageMessage.c
+				    ${interface_dir}/checkbox.c
 				   ${interface_dir}/newMessage.c)
 set(md5_dir ${app_dir}/md5)
 set(md5_file ${md5_dir}/mymd5.c)

BIN
D29V菜单.xlsx


+ 5 - 5
app/GpsData.c

@@ -38,7 +38,7 @@ void GpsInternalChange(unsigned int interval)
 	static  char last_g_GpsStat=-1;
 	static unsigned short cnt=0; 
 	
-	if(++cnt<(1000/interval)) return;//1秒读一次ADC即可
+	if(++cnt<(1000/interval)) return;
 	cnt=0;
 
 	if(last_g_GpsStat!=sutGpsInfo.g_GpsEnable){
@@ -50,20 +50,20 @@ void GpsInternalChange(unsigned int interval)
 	{
 		case 0:
 			if(sutGpsInfo.g_GpsEnable){
-				msgToModem("AT+GPS=\"ON\"\r\n");
+				msgAtSend("AT+GPS=\"ON\"\r\n");
 				MSG_INFO(1,"GPS open--change--r\n");
 				
 			}
 			 else {
-				 msgToModem("AT+GPS=\"OFF\"\r\n");
+				 msgAtSend("AT+GPS=\"OFF\"\r\n");
 				 gpsDataInit();
 				MSG_INFO(1,"GPS OFF--change--r\n");
 			 }
 				//step=1;
 				break;
 		case 1:
-			if(sutGpsInfo.g_GpsEnable)msgToModem("AT+GPSANT=1\r\n");
-				else msgToModem("AT+GPSANT=0\r\n");
+			if(sutGpsInfo.g_GpsEnable)msgAtSend("AT+GPSANT=1\r\n");
+				else msgAtSend("AT+GPSANT=0\r\n");
 			//step=2;
 			break;
 	   case 7:  //第一次查询需要延时查询

+ 7 - 1
app/GpsData.h

@@ -27,15 +27,21 @@ typedef struct SUT_GPS_INF
 	
 	unsigned char GPSVisible_num;
 	unsigned char BDVisible_num;
-	unsigned char startnum;
+	unsigned char startnum;//
 	unsigned short  hight;
 	
 	uint32_t longitue;//经度
 	uint32_t latitue;//纬度
+	unsigned int heading;//航向
+	unsigned int headerSpeed;//航速
+	unsigned short elevation;//海拔
 	
 	uint32_t speed;//速度
 	uint32_t aspect;//方位
+	
 
+	
+	
 	uint32_t AvgSpeed;//平均速度
 	uint32_t speedbuf[5];
 	uint32_t StatisticsMile ;//历程统计

+ 1 - 1
app/Interface/Palace.h

@@ -11,7 +11,7 @@
  
  #include "board.h"
 #define 	PALACE_ROW	3	//有多少行图标
-#define 	PALACE_COL	4	//有多少列图标
+#define 	PALACE_COL	3	//有多少列图标
 #define   PALACE_NUM	(PALACE_ROW*PALACE_COL) //总共有多少个图标
 
 #define 	PALACE_TOP  UI_CONTENT_SHOW_Y //30

+ 65 - 19
app/app.c

@@ -9,7 +9,6 @@ void plusKeyNum(void){
 	keyNum++;
 }
 
-
 static void appDataInit(void){
 	memset((unsigned char *)&sutApp, 0, sizeof(APP_DEF));
 	sutApp.updateStatusBar=1;
@@ -21,6 +20,9 @@ static void appDataInit(void){
 	appSleepCtl(ASLEEP_LCD, 1);
 	readInfoNow();
 	sysIniRead();
+	ReadXbFile();
+	ReadLeaderFile();
+	
 #ifdef ENABLE_DEBUG	
 	takeNoteOfSerType();
 #endif
@@ -141,16 +143,19 @@ static void pttHandler(char type, char ctl){
 		if(pttPressed==0 || micPttPressed==0 || maxPressed==0){
 			sutApp.pttReq=0;
 			pttPressed=0;micPttPressed=0;maxPressed=0;
-			msgAtSend("AT+POC=0C0000\r\n");
+			msgAtSend("AT+POC=0C0000\r\n");	
 			sutPocStatus.PaDlyStart=1;
-			paControl(true);
-			
+			paControl(true);		
 		}
 	}else{//press
 		if(pttPressed || micPttPressed || maxPressed){
 			if(sutApp.pttReq==0){
 				sutApp.pttReq=1;
+				if(sutPocStatus.LeaderCmd!=0)return;//被 摇晕和摇毙
 				msgAtSend("AT+POC=0B0000\r\n");
+				if(newPara.gpsEnable&&sutGpsInfo.isGpsValid){
+					if(newPara.Xinbiao_SendMode==0||newPara.Xinbiao_SendMode==2)XinbiaoPackSend(NULLCMD);
+				}
 				sutPocStatus.PaDlyStart=1;
 				paControl(true);
 			}
@@ -340,6 +345,30 @@ static void enterGTMode(void){
 void micPttHandler(char status){
 	keySendEvent(MKEY_VALUE_MIC_PTT,status);
 }
+
+void quickUiSel(char func01_02){
+	switch(func01_02){
+			case 0:
+				quickUiSwitch(UIS_MENU_BLE_ENABLE);
+				break;
+			case 1:
+				quickUiSwitch(UIS_MENU_XINBIAO_SENDMODE);
+				break;
+			case 2:
+				quickUiSwitch(UIS_MENU_XINBIAO_INFO);
+				break;
+			case 3:
+				quickUiSwitch(UIS_MENU_GROUP_SEL);
+				break;
+			case 4:
+				quickUiSwitch(UIS_MENU_USER_SEL);
+				break;
+			case 5:
+				quickUiSwitch(UIS_MENU_FRIEND_SEL);
+				break;
+	}
+
+}
 void keyHandler(unsigned short key,unsigned char status){//普通按键值处琿
 static unsigned char debugcnt=0;
 static unsigned char gtModeCnt=0;
@@ -371,25 +400,28 @@ static unsigned char gtModeCnt=0;
 			case MKEY_VALUE_ESC:
 				pwrDetRead(1);
 				break;
-			case MKEY_VALUE_F1:
-				if(sutApp.key_f1_cnt==1 && sutUIstatus.Status!=UIS_MENU_SYS_SERVERPASS) sutApp.voluemUpdate=1;
+			case MKEY_VALUE_UP:
+				//if(sutApp.key_f1_cnt==1 && sutUIstatus.Status!=UIS_MENU_SYS_SERVERPASS) sutApp.voluemUpdate=1;
 				sutApp.key_f1_cnt=0;
 				break;
-			case MKEY_VALUE_F2:
-				if(sutApp.key_f2_cnt==1 && sutUIstatus.Status!=UIS_MENU_SYS_SERVERPASS) sutApp.voluemUpdate=2;
+			case MKEY_VALUE_DOWN:
+				//if(sutApp.key_f2_cnt==1 && sutUIstatus.Status!=UIS_MENU_SYS_SERVERPASS) sutApp.voluemUpdate=2;
 				sutApp.key_f2_cnt=0;
 				break;
 			case MKEY_VALUE_CB_GT:
 				gtModeCnt=0;
 				break;
 			case MKEY_VALUE_MENU:
+				
 				if(sutApp.keyLock != 0 && lockCnt==1)//实际无法实现锁短按一下,因为按下去键值就被使用了,不过锁键盘后,都是在待机界面,不影响
 					sutApp.lockShow=1;
 				lockCnt=0;
+				
 				break;
 			case MKEY_VALUE_CB_IP:
 				debugcnt=0;
 				break;
+			
 			default:
 				break;
 		}
@@ -416,18 +448,23 @@ static unsigned char gtModeCnt=0;
 				keyInArow=1;
 				pwrDetRead(0);
 				break;
-			case MKEY_VALUE_F1:
+			case MKEY_VALUE_UP:
 				keyInArow=1;
 				sutApp.key_f1_cnt++;
 				if(sutApp.keyLock==0){
-					if(sutApp.key_f1_cnt==3) quickUiSwitch(UIS_MENU_GROUP_SEL);
+					if(sutApp.key_f1_cnt==3) {
+						quickUiSel(newPara.sidekey01_func);
+					}
+						
 				}else if(sutApp.key_f1_cnt!=1) sutApp.lockShow=1;
 				break;
-			case MKEY_VALUE_F2:
+			case MKEY_VALUE_DOWN:
 				keyInArow=1;
 				sutApp.key_f2_cnt++;
 				if(sutApp.keyLock==0){
-					if(sutApp.key_f2_cnt==3) quickUiSwitch(UIS_MENU_USER_SEL);
+					if(sutApp.key_f2_cnt==3) {
+						quickUiSel(newPara.sidekey02_func);
+					}
 				}else if(sutApp.key_f2_cnt!=1) sutApp.lockShow=1;
 				break;
 			case MKEY_VALUE_CB_GT:
@@ -447,7 +484,7 @@ static unsigned char gtModeCnt=0;
 				break;
 			case MKEY_VALUE_MENU:
 				keyInArow=1;
-				if(++lockCnt==3) lockProcess();
+				if(++lockCnt==30) lockProcess();
 				break;
 			default:
 				break;
@@ -702,7 +739,15 @@ static void paProCtl(void);
 static void subTimerCtl(unsigned char sleep_or_not);
 static void configureVoiceParam(void);
 
+void SecProcess(int interva)
+{
+	static int cnt=0;
+	if(sutApp.gtMode!=0) return;
+	if(++cnt<(5*1000/interva)) return;  // 5秒拿一次GPS数据
+		cnt=0;
+	if(sutGpsInfo.g_GpsEnable)msgAtSend("AT+GPSRD=\"ALL\"\r\n");
 
+}
 
 
 
@@ -710,6 +755,7 @@ static void configureVoiceParam(void);
 void appRun(void){
 	
 	char cnt=0;
+	char buf[20];
 	LSAPI_OSI_Event_t event={0};
 	osiPmSource_t*App_osiPmSource_t=NULL;
 	App_osiPmSource_t=osiPmSourceCreate(APP_NEED_SLEEP, &sleep_ops, NULL);
@@ -771,7 +817,9 @@ void appRun(void){
 	msgAtSend("AT+POC=000000010101\r\n");
 	pwrModeSetCmd(newPara.pwrMode);//心跳间隔  ZZD_PWRMODE
 	ModemSetZZDPocPara();
-	BLE_Open();//d  打开蓝牙
+	snprintf(buf,sizeof(buf),"AT+POC=3000%02d01\r\n",newPara.Poc_sound+1);
+	msgAtSend(buf);
+	//BLE_Open();//d  打开蓝牙
 	osiPmWakeUnlock(App_osiPmSource_t);
 
  for(;;){
@@ -783,7 +831,6 @@ void appRun(void){
 		ledsProCtl();
 		adcRead(APP_SUB_DIV_TIME);
 		uiProcess(APP_SUB_DIV_TIME);
-		//gpsProCtl(APP_SUB_DIV_TIME);
 		AutoExitDanhu(APP_SUB_DIV_TIME);
 		ShouHuProcess(APP_SUB_DIV_TIME);
 		pocProCtl(APP_SUB_DIV_TIME);
@@ -791,11 +838,10 @@ void appRun(void){
 		//uiTimeOutToStandby(0, APP_SUB_DIV_TIME);
 		HookGroupUserInfo();
 		HookVolToutCheck();
-		
+		SecProcess(APP_SUB_DIV_TIME);
 		Ble_handler(APP_SUB_DIV_TIME);
-		
-		//gpsProCtl(APP_SUB_DIV_TIME);
-		//GpsInternalChange(APP_SUB_DIV_TIME);	
+		Xinbiao_handler(APP_SUB_DIV_TIME);
+		GpsInternalChange(APP_SUB_DIV_TIME);	
 		//IncomingSMS();
 		LogoutOutTimeCheck(APP_SUB_DIV_TIME);
 		if(isSleepReady()==0) LSAPI_OSI_ThreadSleep(APP_TASK_SLEEP_TIME);

+ 1 - 0
app/app.h

@@ -20,6 +20,7 @@ typedef enum{
 	ASLEEP_GGROUP,//用于获取群组列表时不要休眠
 	ASLEEP_GUSER,//用于获取成员列表时不要休眠
 	ASLEEP_GFRIEND,
+	ASLEEP_LEADER,
 }ASLEEP_ENUM;
 
 #pragma pack(push)

+ 1 - 2
app/appAuth.c

@@ -16,10 +16,9 @@ void saveAuthEncode(char *writebuf,int length){
 		MSG_ERR(1,"%s open failed",AUTH_FILE);
 		return;
 	}
-	//淇濆�
 	LSAPI_FS_Seek(fd, 0L, LSAPI_FS_SEEK_SET);
 	LSAPI_FS_Write(fd, writebuf, length);
-	//nwy_sdk_fsync(fd);
+
 	LSAPI_FS_Close(fd);
 	MSG_INFO(1,"%s save done", AUTH_FILE);
 }

+ 2 - 2
app/board.h

@@ -36,9 +36,9 @@ typedef enum{
 #define MKEY_VALUE_F1   (1<<MKEY_VALUE_6)
 #define MKEY_VALUE_F2  	(1<<MKEY_VALUE_5)
 
-#define MKEY_VALUE_MENU (1<<MKEY_VALUE_2)  //短按确认,长按锁屏
+#define MKEY_VALUE_UP (1<<MKEY_VALUE_2)  //短按确认,长按锁屏
 
-#define MKEY_VALUE_UP (1<<MKEY_VALUE_4)
+#define MKEY_VALUE_MENU (1<<MKEY_VALUE_4)
 
 #define MKEY_VALUE_DOWN (1<<MKEY_VALUE_13)  //菜单键/下一项键
 #define MKEY_VALUE_ESC 	(1<<MKEY_VALUE_0)

+ 8 - 4
app/gpsCtl.c

@@ -13,7 +13,7 @@ unsigned short getGPSTimeValue(unsigned char index){
 	return GPS_TimeTable[index];
 }
 
-static unsigned char gpsCheckCnt=1;//默认开机查询一�
+unsigned char gpsCheckCnt=1;//默认开机查询一�
 void gpsCheckInfo(void){//查询GPS信�
 	gpsCheckCnt++;
 }
@@ -38,20 +38,24 @@ void gpsProCtl(int dly){
 	unsigned char destohex[40];
 	
 	if(GPS_TimeTable[newPara.gpsTimeIndex]==0)return;
+
 	
 	if(sutApp.gtMode!=0) return;
 	if(++cnt<(GPS_TimeTable[newPara.gpsTimeIndex]*1000/dly) && gpsCheckCnt==0) return;
 	cnt=0;
-	if(sutGpsInfo.g_GpsEnable)msgToModem("AT+GPSRD=\"ALL\"\r\n");
-	gpsCheckCnt=0;
+	if(sutGpsInfo.g_GpsEnable)msgAtSend("AT+GPSRD=\"ALL\"\r\n");
+	//gpsCheckCnt=0;
 	if(sutGpsInfo.isGpsValid){
+		
 		snprintf(restohex,sizeof(restohex),"%d.%06d,%d.%06d",sutGpsInfo.latitue/1000000,sutGpsInfo.latitue%1000000,sutGpsInfo.longitue/1000000,sutGpsInfo.longitue%1000000);
 
 		AscStrTurnHexStr(restohex,destohex);
 		snprintf(GpsDatabuf,sizeof(GpsDatabuf),"AT+POC=110000%s2c352c32302c362e302c042524252600\r\n",destohex);
 		msgAtSend(GpsDatabuf);
 		
-		//MSG_INFO(1,GpsDatabuf);
+		
+
+		
 	}	
 		
 }

+ 1 - 0
app/gpsCtl.h

@@ -20,6 +20,7 @@ typedef struct{
 #pragma pack(pop)
 
 extern SUT_MESS sutMess;
+extern unsigned char gpsCheckCnt;
 
 
 extern const unsigned short GPS_TimeTable[GPS_TABLE_NUM];

+ 5 - 6
app/hook.c

@@ -51,9 +51,9 @@ char SimpleInfoScan(unsigned char  firstIn,unsigned char direction)
 			 if(sutUIstatus.Status==UIS_MENU_GROUP_SEL){
 				snprintf(buf, sizeof(buf),"AT+POC=0D00000000000100000000\r\n"); 
 			}
-			else  if(sutUIstatus.Status==UIS_MENU_USER_SEL) {
+			else  if(sutUIstatus.Status==UIS_MENU_USER_SEL||sutUIstatus.Status==UIS_MENU_SZ_YAOYUN||sutUIstatus.Status==UIS_MENU_SZ_YAOYBI) {
 				snprintf(buf, sizeof(buf),"AT+POC=3B0000%08x\r\n",sutPocStatus.LocalGroup.ID);//?è?üD?×üêy
-			}else {
+			}else if(sutUIstatus.Status==UIS_MENU_FRIEND_SEL) {
 				snprintf(buf, sizeof(buf),"AT+POC=0D00000000000100000000\r\n"); 
 			}
 			
@@ -118,10 +118,9 @@ char SimpleInfoScan(unsigned char  firstIn,unsigned char direction)
 		if(sutUIstatus.Status==UIS_MENU_GROUP_SEL){
 			snprintf(buf, sizeof(buf), "AT+POC=0D000000000005%08x\r\n",sutPocStatus.handleIndex*5+1);
 			}
-			else if(sutUIstatus.Status==UIS_MENU_USER_SEL){
-			
-			snprintf(buf, sizeof(buf), "AT+POC=130000%08x00000005%08x\r\n",sutPocStatus.LocalGroup.ID,sutPocStatus.handleIndex*5);
-			}else{
+			else if(sutUIstatus.Status==UIS_MENU_USER_SEL||sutUIstatus.Status==UIS_MENU_SZ_YAOYUN||sutUIstatus.Status==UIS_MENU_SZ_YAOYBI){
+				snprintf(buf, sizeof(buf), "AT+POC=130000%08x00000005%08x\r\n",sutPocStatus.LocalGroup.ID,sutPocStatus.handleIndex*5);
+			}else if(sutUIstatus.Status==UIS_MENU_FRIEND_SEL){
 
 			snprintf(buf, sizeof(buf), "AT+POC=0E00000000000000000005%08x\r\n",sutPocStatus.handleIndex*5);
 

+ 5 - 1
app/includes.h

@@ -23,6 +23,8 @@
 #include "bsp.h"
 #include "ble.h"
 #include "language.h"
+#include "xinbiao.h"
+
 
 
 #include "app.h"
@@ -40,6 +42,8 @@
 #include "Palace.h"
 #include "uiMenu.h"
 #include "ListBox.h"
+#include "checkbox.h"
+
 #include "NumEdit.h"
 #include "ManageMessage.h"
 #include "mymd5.h"
@@ -74,5 +78,5 @@ extern LSAPI_OSI_Thread_t * ToneThreadPtr;
 
 //#define USE_LEFT_MOVING  //主界面/群组/成员列表  使用滚动操作显示
 
-#define CONFIG_AUDIO_AFTER_INIT
+//#define CONFIG_AUDIO_AFTER_INIT
 #endif

+ 128 - 28
app/poc.c

@@ -88,6 +88,8 @@ static void pro0dMsg(char *msg);
 static void pro0eMsg(char *msg);
 static void pro3bMsg (char *msg);
 static void Pro7DMsg(char *msg);
+void  pro8CMsg(char *msg);
+
 
 
 void cmdsProcess(char *msg, int len){//宸插幓鎺夊洖杞︽崲琛?
@@ -140,7 +142,7 @@ void cmdsProcess(char *msg, int len){//宸插幓鎺夊洖杞︽崲
 		else if(msgCmp(msg, "+POC:84")) pro84Msg(msg+7);
 		else if(msgCmp(msg, "+CTEC:")) proNetMode(msg+7);
 		else if(msgCmp(msg, "+CSQ: ")) proCsqMsg(msg+6);
-		
+		else if(msgCmp(msg, "+POC:8C00")) pro8CMsg(msg);	
 
 		
 		else if(msgCmp(msg, "+POC:1D")) pro1dMsg(msg+7);
@@ -270,14 +272,18 @@ static void pro80Msg(char *msg){
 	sutPocStatus.AllGroups[sutPocStatus.ListFillIndex].ID=htoi(&msg[17]);
 	
 	if(sutPocStatus.AllGroups[sutPocStatus.ListFillIndex].ID==0xFFFFFFFF){
-		sutPocStatus.ListUpdate=1;	
-		sutPocStatus.ListDetailValid=1;
-		sutPocStatus.ListCurOnlineNum=htoi(Idbuf);	
-		//if(sutPocStatus.danHuStatus!=0)sutPocStatus.ListCurOnlineNum--;//  鑼朵綑鍗曞懠鍘绘帀涓存椂缇ょ粍
-		MSG_INFO(1, "friend:%d", sutPocStatus.ListCurOnlineNum);
+
+		if(sutUIstatus.Status==UIS_MENU_FRIEND_SEL){
+			sutPocStatus.ListUpdate=1;	
+			sutPocStatus.ListDetailValid=1;
+			sutPocStatus.ListCurOnlineNum=htoi(Idbuf);	
+			//if(sutPocStatus.danHuStatus!=0)sutPocStatus.ListCurOnlineNum--;//  鑼朵綑鍗曞懠鍘绘帀涓存椂缇ょ粍
+			MSG_INFO(1, "friend:%d", sutPocStatus.ListCurOnlineNum);
+		}
 		return;
 	}
 	
+	
 	if(sutPocStatus.ListFillIndex>0){
 		if(sutPocStatus.AllGroups[sutPocStatus.ListFillIndex].ID==sutPocStatus.AllGroups[sutPocStatus.ListFillIndex-1].ID){
 			MSG_INFO(1,"id===chongfu==================%d\r\n",sutPocStatus.AllGroups[sutPocStatus.ListFillIndex].ID);	
@@ -292,7 +298,6 @@ static void pro80Msg(char *msg){
 		unicodeToGbk(Groupname, sutPocStatus.AllGroups[sutPocStatus.ListFillIndex].name, &len);
 	}
 	//msg[29+8]=0;
-
 	MSG_INFO(1,"AllGroups===%s,%d,%d\r\n",sutPocStatus.AllGroups[sutPocStatus.ListFillIndex].name,sutPocStatus.ExceptionReadNum,sutPocStatus.ListFillIndex);
 	
 	sutPocStatus.AllGroups[sutPocStatus.ListFillIndex].status=2;
@@ -310,22 +315,53 @@ static void pro81Msg(char *msg){
 
 	char Username[POC_GROUP_USER_NAME_LEN];
 	char len;
+	unsigned char i=0;
+
+	if(sutPocStatus.NeedGetUser==2){	
+		len=strlen(&msg[25]);
+		memcpy(Username, &msg[25], len);
+		memset(UserArr[sutPocStatus.ListFillIndex].UserName,0,POC_GROUP_USER_NAME_LEN);
+		msg[25]=0;
+			UserArr[sutPocStatus.ListFillIndex].id=htoi(&msg[17]);
+			/*
+			if(sutPocStatus.AllUsers[sutPocStatus.ListFillIndex].ID==0xFFFFFFFF){
+				return;
+			}
+			*/
+			if(msg[29]==0) UserArr[sutPocStatus.ListFillIndex].UserName[0]=' ';
+			else {
+				LwEndingToBiEndingStr(Username,len);
+				unicodeToGbk(Username, UserArr[sutPocStatus.ListFillIndex].UserName, &len);
+			}
+		
+			
+			MSG_INFO(1,"GetAllUsers===%s,%d\r\n",UserArr[sutPocStatus.ListFillIndex].UserName,sutPocStatus.ListFillIndex);
+			sutPocStatus.ListFillIndex++;
+		if(sutPocStatus.ListFillIndex==sutPocStatus.UserSum){
+				sutPocStatus.NeedGetUser=0;
+				/*
+					如果有新用户需添加至leader
+				*/
+
+	
+		
+		}
+
+	}
+	if(sutPocStatus.NeedGetUser!=0)return;//获取所有成员信息
 
 	len=strlen(&msg[25]);
 	memcpy(Username, &msg[25], len);
 
-
 	memset(sutPocStatus.AllUsers[sutPocStatus.ListFillIndex].name,0,POC_GROUP_USER_NAME_LEN);
 	msg[25]=0;
-		sutPocStatus.AllUsers[sutPocStatus.ListFillIndex].ID=htoi(&msg[17]);
-		
+	sutPocStatus.AllUsers[sutPocStatus.ListFillIndex].ID=htoi(&msg[17]);
 		if(sutPocStatus.AllUsers[sutPocStatus.ListFillIndex].ID==0xFFFFFFFF){
-
 			return;
 		}
 		
 		sutPocStatus.AllUsers[sutPocStatus.ListFillIndex].status=msg[8]-0x30;
-		//1 绂荤嚎锛� 2 鍦ㄧ嚎锛堜笉鍦ㄦ�缇ょ粍涓�級 锛� 3 鍦ㄦ�缇ょ粍涓�紙鍦ㄧ嚎锛� 
+		//1 
 		if(sutPocStatus.AllUsers[sutPocStatus.ListFillIndex].status==1&&sutUIstatus.Status==UIS_MENU_USER_SEL)return; //涓嶅湪绾� 涓嶆樉绀�
 		if(msg[29]==0) sutPocStatus.AllUsers[sutPocStatus.ListFillIndex].name[0]=' ';
 		else {
@@ -336,12 +372,15 @@ static void pro81Msg(char *msg){
 		
 		MSG_INFO(1,"AllUsers===%s,%d,%d\r\n",sutPocStatus.AllUsers[sutPocStatus.ListFillIndex].name,sutPocStatus.ExceptionReadNum,sutPocStatus.ListFillIndex);
 		sutPocStatus.AllUsers[sutPocStatus.ListFillIndex].status=msg[8]-0x30;
+	
 		
 		sutPocStatus.ListFillIndex++;
-		MSG_INFO(1,"get groups end\r\n");
-				if(sutPocStatus.ListFillIndex==sutPocStatus.ExceptionReadNum){
+		
+
+	if(sutPocStatus.ListFillIndex==sutPocStatus.ExceptionReadNum){
 				sutPocStatus.ListGetOneFlag=1;
-			}
+				MSG_INFO(1,"get users finish--\r\n");
+		}
 	
 }
 /*鐧诲綍鐘舵€佷俊鎭?
@@ -385,7 +424,9 @@ static void pro83Msg(char *msg){
 	int len;
 	char callerName[POC_GROUP_USER_NAME_LEN*2];
 	char *pName;
-
+	unsigned short i=0;
+	unsigned char Needcat=1;
+	char temp[POC_GROUP_USER_NAME_LEN];
 
 	len=strlen(msg);
 	
@@ -406,9 +447,20 @@ static void pro83Msg(char *msg){
 	unicodeToGbk(callerName, sutPocStatus.CallName, &len);
 	//StrUnicodeToAnsiBig(sutPocStatus.Callname,i,&msg[17+8]);
 	*(msg+17) = 0;
-	sutPocStatus.CallID = strtol(&msg[9+8],&pName,16);
+	sutPocStatus.CallID = strtol(&msg[9],&pName,16);
 	msg[17]=0;
 
+	for(i=0;i<MAX_USER;i++){
+		if(UserArr[i].id==sutPocStatus.CallID){
+			Needcat=0;
+			break;
+		}
+	}
+	if(Needcat){
+		snprintf(temp,sizeof(temp),"监听组-%s",sutPocStatus.CallName);
+		strcpy(sutPocStatus.CallName,temp);
+		MSG_INFO(1,"监听组---%s",temp);
+	}
 
 }
 /*鍗曞懠鍝嶅簲淇℃伅
@@ -449,17 +501,18 @@ static void pro86Msg(char *msg){
 		sutPocStatus.LocalGroup.ID=strtol(&msg[9],&pName,16);	
 		LwEndingToBiEndingStr(GroupName,len);
 		unicodeToGbk(GroupName, sutPocStatus.LocalGroup.name, &len);
-		
 		MSG_INFO(1,"groupnamelen======%d",len);
 		MSG_INFO(1,"groupname======%s",sutPocStatus.LocalGroup.name);
 		sutPocStatus.danHuStatus=0;
-
+		snprintf(tmp,sizeof(tmp),"AT+POC=3B0000%08x\r\n",sutPocStatus.LocalGroup.ID);
+		ModemSendAt(tmp);
+		sutPocStatus.NeedGetUser=1;
+		
 	}else if(msg[8]=='1'){
 	//鍗曞懠妯″紡	
 		sutPocStatus.danHuStatus=1;
 	}
 	backLightReset();
-
 	sutPocStatus.firstLogin=1;	
 }
 /*鏌ヨ�鎵€灞炵兢缁勬€绘暟鐨勫搷搴?
@@ -738,7 +791,6 @@ static void pro28Msg(char *msg){
 static void pro0dMsg(char *msg){
 	
 	if(sutUIstatus.Status!=UIS_MENU_GROUP_SEL)return;
-	
 	sutPocStatus.ListUpdate=1;	
 	sutPocStatus.ListDetailValid=1;
 	sutPocStatus.ListCurOnlineNum=htoi(&msg[13])-1;	
@@ -755,15 +807,30 @@ static void pro0eMsg(char *msg){
 	MSG_INFO(1, "friend:%d", sutPocStatus.ListCurOnlineNum);
 }
 
-
-static void pro3bMsg (char *msg){
+//+POC:3b 00 0000 006c 0002 0001
+//+POC:3b000000006c00020001
 
 
-	if(msg[5]=='3' && msg[6]=='B'){ 		
-		sutPocStatus.ListUpdate=1;	
-		sutPocStatus.ListDetailValid=1;
+static void pro3bMsg (char *msg){
+	char buf[40];
+	if(msg[5]=='3' && msg[6]=='B'){ 	
+		if(sutPocStatus.NeedGetUser==0){
+			sutPocStatus.ListUpdate=1;	
+			sutPocStatus.ListDetailValid=1;
+		}
+		
 		sutPocStatus.ListCurOnlineNum	=htoi(&msg[21]);
-		MSG_INFO(1, "UserNum:%d", sutPocStatus.ListCurOnlineNum);
+		msg[17]=0;
+		sutPocStatus.UserSum= htoi(&msg[13]);
+		if(sutPocStatus.NeedGetUser){
+		snprintf(buf, sizeof(buf), "AT+POC=130000%08x0000006400000000\r\n",sutPocStatus.LocalGroup.ID);//默认成员100
+			sutPocStatus.ListFillIndex=0;
+			sutPocStatus.NeedGetUser=2;
+			if(sutPocStatus.UserSum==0)sutPocStatus.NeedGetUser=0;
+			msgAtSend(buf);
+			//MSG_INFO(1,buf);
+		}
+		MSG_INFO(1, "UserSum:%d,UserOnline:%d",sutPocStatus.UserSum,sutPocStatus.ListCurOnlineNum);
 	}			
 }
 
@@ -771,7 +838,6 @@ static void Pro7DMsg(char *msg){
 
 	int i,j,len,ver;
 	char bufTemp[40];
-	
 	len = strlen(msg);
 	j=0;
 	StrAsciiToHex(msg,bufTemp);
@@ -864,3 +930,37 @@ void ohpocGetClock(MY_CLOCK *myclock){
 }
 
 
+
+//+POC:8C00934C0008 2222222222//data: cmd data
+void  pro8CMsg(char *msg){
+
+ char buf[500];
+ char temp[3]={0};
+ char cmd=0;
+ 
+	memcpy(temp,msg+17,2);
+ 	cmd=htoi(temp);
+	switch(cmd){
+		case NULLCMD://信标
+			Recv_PackNewxinbiaopage(msg);
+			break;
+
+		case YAOYUN:
+			LeaderRecv_handler(msg,1);
+			break;	
+		case YAOBI:
+			LeaderRecv_handler(msg,2);
+			break;
+		case GPSALLON:
+
+			break;
+
+	}
+
+}
+
+
+
+
+
+

+ 4 - 2
app/poc.h

@@ -34,12 +34,13 @@ typedef struct{
 	SUT_POC_GROUP LocalGroup;
 	char CallName[POC_GROUP_USER_NAME_LEN];
 	unsigned long CallID;
-
+	unsigned char UserSum; //³ÉÔ±×ÜÊý
+	unsigned char NeedGetUser;
 	SUT_POC_USER	AllUsers[POC_ALL_USERS_NUM];
 	SUT_POC_GROUP	AllGroups[POC_ALL_GROUPS_NUM];
 
 	unsigned char handleIndex;
-	unsigned char ListFillIndex;
+	unsigned short ListFillIndex;
 	unsigned int ListCurOnlineNum;
 	unsigned char ListUpdate;
 	unsigned char ListType;
@@ -48,6 +49,7 @@ typedef struct{
 	unsigned char ListDetailValid;//是�有群组/�员明细回�
 	unsigned char PocLineOffReason;
 	unsigned char PaDlyStart;
+	unsigned char LeaderCmd;// 0  Õý³£¡£   1Ò¡ÔÈ¡  2Ò¡±Ð
 }POC_DEF;
 #pragma pack(pop)
 

+ 10 - 5
app/setting.c

@@ -166,16 +166,21 @@ void sysIniRead(void){
 		newPara.spkVol=7;
 		newPara.micGain=MIC_GAIN_DEFAULT;
 		newPara.spkGain=SPK_GAIN_DEFAULT;
+		//lc
+		newPara.sidekey02_func=1;
+		newPara.Xinbiao_LiveUpdate=1;
+		newPara.Xinbiao_station=1;
+		newPara.Xinbiao_IpEnable=1;
+		newPara.BleEnable=1;
+		newPara.BleSpkLv=8;
+		newPara.BleMicLv=9;
+		
+
 	#ifndef DEVELOP_MODE		
 		setFactoryParam();
 	#endif
 	}
 	if(newPara.serverMenuPass!=NULL) memcpy(menu_key, newPara.serverMenuPass,6);
-	//测试开始
-	//newPara.gpsEnable=0;
-	//newPara.bubiaoEnable=0;
-	//newPara.KeySound=1;
-	//测试结束
 	
 	if(newPara.spkVol>MAX_SPK_VOL){
 		newPara.spkVol=7;

+ 8 - 2
app/setting.h

@@ -65,10 +65,16 @@ typedef struct{
 	unsigned char Xinbiao_station;
 	unsigned char Xinbiao_LiveUpdate;
 	unsigned char Xinbiao_SendMode;
-	unsigned char  Xinbiao_Time;
+	unsigned char Xinbiao_Time;
 	unsigned char Xinbiao_IpEnable;
+
+	unsigned char menu_tts; //²Ëµ¥TTS
+	unsigned char Poc_sound; //
+	unsigned char Shake;	
+	unsigned char sidekey01_func;
+	unsigned char sidekey02_func;  //01
 	
-	unsigned char reversed[50-13];//�留段
+	unsigned char reversed[50-16];//�留段
 	///////////////////////////////////////
 	char ttsMessage[20*4];//开机TTS,空则�播放
 	unsigned char ttsCodeType;//TTS编�类型

+ 486 - 75
app/uiBlock.c

@@ -575,9 +575,11 @@ void uiShowMenuMain(char update){
 		"侧键定义",
 		"本机信息",
 		"首长功能",
+		/*
 		"闹铃设置",
 		"初始化",
 		"初始化",
+		*/
 		""
 	};
 
@@ -596,22 +598,29 @@ void MenuMainResponse(void){
 				uISetNextStatus(UIS_MENU_USER_SEL);
 				break;
 			case 2:
-				uISetNextStatus(UIS_MENU_MAIL_SEL);
+				uISetNextStatus(UIS_MENU_FRIEND_SEL);
 				break;
 			case 3:
-				uISetNextStatus(UIS_MENU_SYS_SEL);
+				uISetNextStatus(UIS_MENU_BLE_MAIN);
 				break;
 			case 4: 
 				uISetNextStatus(UIS_MENU_XINBIAO_MAIN);
 				break;
+
 			case 5:
-				uISetNextStatus(UIS_MENU_INFO_SEL);
+				uISetNextStatus(UIS_MENU_SYS_SEL);
 				break;
 			case 6:
-				uISetNextStatus(UIS_MENU_BLE_MAIN);
+				uISetNextStatus(UIS_MENU_CJ_MIAN);
 				break;
 			case 7:
-				uISetNextStatus(UIS_MENU_FRIEND_SEL);
+				uISetNextStatus(UIS_MENU_INFO_SEL);
+				break;
+			case 8:
+				uISetNextStatus(UIS_MENU_SZ_MIAN);
+				break;
+			case 9:
+				uISetNextStatus(UIS_MENU_ALARM_SET);
 				break;
 		}
 		uiPushStack(sutPalace.Index);
@@ -658,7 +667,8 @@ void uiShowGUSel(char StatusUpdate,unsigned int exeInterval,char type){
 				uiSwitchLock=true;
 				if(type==0) appSleepCtl(ASLEEP_GGROUP, 1);//要获取群组信息,不让休眠,记得超时或获取成功或获取失败后需要释放
 				else if(type==1)appSleepCtl(ASLEEP_GUSER, 1);
-				else appSleepCtl(ASLEEP_GFRIEND,1);
+				else if(type==2)appSleepCtl(ASLEEP_GFRIEND,1);
+				else appSleepCtl(ASLEEP_LEADER,1);
 				UiassistStart(0);
 				machine=2;
 				setHandleToZero=true;
@@ -679,17 +689,26 @@ void uiShowGUSel(char StatusUpdate,unsigned int exeInterval,char type){
 				}else if(type==1){
 					guiShowCaption(30,"用户选择",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_16X16); //0
 					uiMenuShowBottomIndacitor("单呼", "返回");
-				}else {
+				}else if(type==2){
 					guiShowCaption(30,"好友选择",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_16X16); //0
 					uiMenuShowBottomIndacitor("呼叫", "返回");
+				}else if(type==3){
+					guiShowCaption(30,"摇晕选择",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_16X16); //0
+					uiMenuShowBottomIndacitor("勾选", "返回");
+				}else if(type==4){
+					guiShowCaption(30,"摇毙选择",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_16X16); //0
+					uiMenuShowBottomIndacitor("勾选", "返回");
 				}
-				ReFlashItemGU(type);
+				if(type<3)ReFlashItemGU(type);
+				else 
+				
 				uiMenuShowBottomLine();
 				machine=3;
 				//获取成功后退出释放休眠
 				if(type==0) appSleepCtl(ASLEEP_GGROUP, 0);
 				else if(type==1)appSleepCtl(ASLEEP_GUSER, 0);
-				else appSleepCtl(ASLEEP_GFRIEND,0);
+				else if(type==2)appSleepCtl(ASLEEP_GFRIEND,1);
+				else appSleepCtl(ASLEEP_LEADER,1);
 				uiSwitchLock=false;
 			}
 			break;
@@ -830,7 +849,7 @@ static void UserAssistAdd(void){
 			if(getAssistResult()){
 				 if(sutUIstatus.Status==UIS_MENU_GROUP_SEL)ReFlashItemGU(0);
 				else if(sutUIstatus.Status==UIS_MENU_USER_SEL)ReFlashItemGU(1);
-				else ReFlashItemGU(2);
+				else if(sutUIstatus.Status==UIS_MENU_FRIEND_SEL)ReFlashItemGU(2);
 				SelMachine=0;
 			}
 			break;
@@ -838,7 +857,7 @@ static void UserAssistAdd(void){
 			if(getAssistResult()){
 				 if(sutUIstatus.Status==UIS_MENU_GROUP_SEL)ReFlashItemGU(0);
 				else if(sutUIstatus.Status==UIS_MENU_USER_SEL)ReFlashItemGU(1);
-				else ReFlashItemGU(2);
+				else if(sutUIstatus.Status==UIS_MENU_FRIEND_SEL)ReFlashItemGU(2);
 				SelMachine=0;
 			}
 			break;
@@ -865,12 +884,14 @@ static void ReFlashItemGU(char type){
 	if(type==0){
 		icons[0]=accIconFileName[0];
 		icons[1]=accIconFileName[1];
+		icons[2]=accIconFileName[5];
 	}else{
 		icons[0]=accIconFileName[2];
 		icons[1]=accIconFileName[3];
 		icons[2]=accIconFileName[4];
+		icons[3]=accIconFileName[5];
 	}
-	icons[3]=accIconFileName[5];
+	
 	for(i=0;i<=POC_ALL_GROUPS_NUM;i++){
 		GUName[i]=NullGU;
 		GUFeatures[i]=0;
@@ -912,11 +933,12 @@ static void ReFlashItemGU(char type){
 /*****************************系统设置部分开始*********************************/
 void uiShowMenuSysSetup(char flash){
 	static const char *apcPtr[]={
-		"1.LCD设置",
-		"2.功耗模式设置",
-		"3.提示音设置",
-		"4.键锁设置",
-		"5.工程设置",
+		"1.屏保时间",
+		"2.语音播报",
+		"3.哗音开关",
+		"4.震动开关",
+		"5.音质设置",
+		"6.省电模式",
 		""
 	};
 	if(flash){
@@ -928,7 +950,12 @@ void uiShowMenuSysSetup(char flash){
 		uiMenuInit(&sutMenuSysSetup,apcPtr,FONT_MODE_16X16);
 	}
 }
+/*
+UIS_MENU_SYS_TTSON,  //语音播报
+UIS_MENU_SYS_SHAKE, //震动
+UIS_MENU_SYS_SOUNDSEL,//音质
 
+*/
 void sysTemSetResponse(void){
 	unsigned short key;
 	
@@ -938,20 +965,23 @@ void sysTemSetResponse(void){
 			case 0://LCD设置
 				uISetNextStatus(UIS_MENU_SYS_LCD);
 				break;
-			case 1://功耗模式设置
-				uISetNextStatus(UIS_MENU_SYS_PWR);
+			case 1:
+				uISetNextStatus(UIS_MENU_SYS_TTSON);
 				break;
-			case 2://提示音设置
+			case 2:
 				uISetNextStatus(UIS_MENU_SYS_NOTE);
 				break;
-			case 3://键锁设置
-				uISetNextStatus(UIS_MENU_SYS_LOCK);
-				break;
-			case 4://工程设置
-				uISetNextStatus(UIS_MENU_SYS_FACTORY);
+			case 3://
+				uISetNextStatus(UIS_MENU_SYS_SHAKE);
+				break;		
+			case 4://
+				uISetNextStatus(UIS_MENU_SYS_SOUNDSEL);
+				break;		
+			case 5:
+				uISetNextStatus(UIS_MENU_SYS_PWR);
 				break;
 		}
-		if(sutMenuSysSetup.handle<=4) uiPushStack(sutMenuSysSetup.handle);
+		if(sutMenuSysSetup.handle<=5) uiPushStack(sutMenuSysSetup.handle);
 	}else if(MKEY_VALUE_ESC==key) uISetNextStatus(UIS_MENU_MAIN);
 }
 /*****************************系统设置部分结束*********************************/
@@ -963,10 +993,11 @@ static locationXYFlash(char flash);
 void uiShowMenuLocationSel(char flash){
 	static unsigned int timer;
 	static char machine=0;
+	static int cnt=0;
 	if(flash){
 		machine=0;
 		guiClearAll(guiGetBackColor());
-		guiShowCaption(0,"定位设置",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_16X16);
+		guiShowCaption(0,"GPS开关",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_16X16);
 		uiMenuShowBottomLine();
 		if(newPara.gpsEnable==0){
 			machine=1;
@@ -978,17 +1009,25 @@ void uiShowMenuLocationSel(char flash){
 		uiMenuShowBottomIndacitor("保存", "返回");
 		locationTimeFlash(0);
 	}
-	if(newPara.gpsEnable!=0) locationXYFlash(flash);
+
+		
+	
+	
 	if(machine==1){
 		if(uTimerExpired(&timer)){
 			machine=0;
 			uISetNextStatus(UIS_MENU_MAIN);
 		}
 	}
+	
+	if(++cnt<(1000/APP_SUB_DIV_TIME)) return;  
+		if(newPara.gpsEnable!=0) locationXYFlash(flash);	
+		cnt=0;
+
+	
 }
 void loationSetResponse(void){
 	unsigned short key;
-	
 	key=getKeyValue();
 	if(newPara.gpsEnable==0){
 		if(key!=MKEY_VALUE_ESC) return;
@@ -997,9 +1036,8 @@ void loationSetResponse(void){
 	else if(MKEY_VALUE_DOWN==key) locationTimeFlash(2);
 	else if(MKEY_VALUE_ESC==key) uISetNextStatus(UIS_MENU_XINBIAO_MAIN);
 	else if(MKEY_VALUE_MENU==key){
-		if(tempGpsIndex != newPara.gpsTimeIndex){
-			MSG_INFO(1, "GPS timeIndex update:%d",getGPSTimeValue(tempGpsIndex));
-			newPara.gpsTimeIndex=tempGpsIndex;
+		if(tempGpsIndex != newPara.gpsEnable){
+			newPara.gpsEnable=tempGpsIndex;
 			sysIniSave("location");
 			gpsCheckInfo();//检测一下
 		}
@@ -1009,35 +1047,24 @@ void loationSetResponse(void){
 static locationTimeFlash(char type){
 	unsigned short gpsTimeValue;
 	char buf[50];
-	unsigned short y=70;
-
-	if(type==0){
-		tempGpsIndex=newPara.gpsTimeIndex;
-	}else if(type==1){
-		if(++tempGpsIndex>=GPS_TABLE_NUM) tempGpsIndex=0;
-	}else if(type==2){
-		if(tempGpsIndex>0) tempGpsIndex--;
-		else tempGpsIndex=GPS_TABLE_NUM-1;
-	}else return;
-	
-	gpsTimeValue=getGPSTimeValue(tempGpsIndex);
-	if(gpsTimeValue==0) snprintf(buf, sizeof(buf), "定位上传设置:关闭");
-	else snprintf(buf, sizeof(buf), "定位上传设置:%d秒",gpsTimeValue);
+	unsigned short y=200;
+	tempGpsIndex=!tempGpsIndex;
+	if(gpsTimeValue==0) snprintf(buf, sizeof(buf), "关闭");
+	else snprintf(buf, sizeof(buf), "打开",gpsTimeValue);
 	guiClearRect(0,y,GLCD_WIDTH-1, y+12,guiGetBackColor());
 	guiShowStr(30,y, buf,FONT_MODE_16X16, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
 }
 static locationXYFlash(char flash){
 	char buf[50];
 	unsigned short y=UI_CONTENT_SHOW_Y+2;
-	
 //	if(gpsInfo.update==0 && flash==0) return;
 //	gpsInfo.update=0;
 	guiClearRect(0, y,GLCD_WIDTH-1, y+12+5+12,guiGetBackColor());
 	snprintf(buf, sizeof(buf), "纬度 S:%d.%05d",sutGpsInfo.latitue/1000000,sutGpsInfo.latitue%1000000);
-	guiShowStr(30,y, buf,FONT_MODE_16X16, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
+	guiShowStr(0,y, buf,FONT_MODE_16X16, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
 	y+=12+5;
 	snprintf(buf, sizeof(buf), "经度 W:%d.%05d",sutGpsInfo.longitue/1000000,sutGpsInfo.longitue%1000000);
-	guiShowStr(30,y, buf,FONT_MODE_16X16, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
+	guiShowStr(0,y, buf,FONT_MODE_16X16, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
 }
 /*****************************定位设置部分结束*********************************/
 
@@ -1046,7 +1073,7 @@ unsigned char sysInfoType;
 static void sysInfoFlash(void){
 	unsigned short x,y;
 	char buf[50];
-	unsigned char LineSpace=12+4;
+	unsigned char LineSpace=24+4;
 	unsigned char NeedSpace=0;
 	int len;
 	char yunyingshang=0;
@@ -1772,7 +1799,7 @@ static void switchFlash(void){
 void uiShowNoteSel(char StatusUpdate){
 	if(StatusUpdate){
 		guiClearAll(guiGetBackColor());
-		guiShowCaption(0,"提示音设置",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_16X16);
+		guiShowCaption(0,"哗音开关",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_16X16);
 		uiMenuShowBottomLine();
 		noteSetTmp=newPara.KeySound;
 		switchFlash();
@@ -2378,7 +2405,11 @@ void uiShowBleEnableUpdate(char StatusUpdate){
 
 void uiShowBleEnableUpdateResponse(void){
 	unsigned short key=ListBoxResponse(&sutListBox);
-	if(MKEY_VALUE_ESC==key) uISetNextStatus(UIS_MENU_BLE_MAIN);
+	if(MKEY_VALUE_ESC==key) {
+		if(getStackStruct()->FastUiChange)uISetNextStatus(UIS_STANDBY);
+		else uISetNextStatus(UIS_MENU_BLE_MAIN);
+
+	}
 	else if(MKEY_VALUE_MENU==key){
 		getStackStruct()->ok_back=1;
 		if(newPara.BleEnable != sutListBox.handle){
@@ -2387,7 +2418,8 @@ void uiShowBleEnableUpdateResponse(void){
 			else BLE_Close();
 			sysIniSave("bleenable");
 		}
-		uISetNextStatus(UIS_MENU_BLE_MAIN);
+		if(getStackStruct()->FastUiChange)uISetNextStatus(UIS_STANDBY);
+		else uISetNextStatus(UIS_MENU_BLE_MAIN);
 	}
 }
 /*****************************蓝牙开关结束********************************/
@@ -2719,6 +2751,14 @@ void sysXINBIAOSetResponse(void){
 void uiShowXINBIAOStationUpdate(char StatusUpdate){
 	char Features[NORMAL_BOOL_NUM];
 	unsigned char i;
+
+
+	static const char *StationMode[2+1]={
+			"固定站点",
+			"GPS坐标",
+			""
+	};
+	
 	if(StatusUpdate){
 		guiClearAll(guiGetBackColor());
 		guiShowCaption(0,"站点设置",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_16X16);
@@ -2748,11 +2788,6 @@ void uiShowXINBIAOStationUpdateResponse(void){
 
 
 
-
-
-
-
-
 /*****************************信标详情开始********************************/
 
 void uiShowXINBIAOPageShow(char dir){
@@ -2766,29 +2801,28 @@ void uiShowXINBIAOPageShow(char dir){
 	}else if(dir==2){
 		if(--UserTempIndex==0)UserTempIndex=sut_xinbiao_info.Max_id-1;
 	}
-	snprintf(Showbuf,sizeof(Showbuf),"ID号:%03d",sut_xinbiaopage.xb_id);
+	snprintf(Showbuf,sizeof(Showbuf),"ID号:%03d",sut_xinbiaopage[UserTempIndex].xb_id);
 	guiShowStr(0,y,Showbuf,FONT_MODE_16X16,REVERSED_NO,COLOR_BLACK,guiGetBackColor());
 	y+=LIST_ITEM_HEGH;
-	snprintf(Showbuf,sizeof(Showbuf),"名字:%s",sut_xinbiaopage.xb_CallName);
+	snprintf(Showbuf,sizeof(Showbuf),"名字:%s",sut_xinbiaopage[UserTempIndex].xb_CallName);
 	guiShowStr(0,y,Showbuf,FONT_MODE_16X16,REVERSED_NO,COLOR_BLACK,guiGetBackColor());
 	y+=LIST_ITEM_HEGH;
 	//guiClearRect(0, y,GLCD_WIDTH-1, y+12+5+12,guiGetBackColor());
-	snprintf(Showbuf, sizeof(Showbuf), "纬度 S:%d.%05d",sut_xinbiaopage.xb_latitue/1000000,sut_xinbiaopage.xb_latitue%1000000);
-	guiShowStr(30,y, buf,FONT_MODE_16X16, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
+	snprintf(Showbuf, sizeof(Showbuf), "纬度 S:%d.%05d",sut_xinbiaopage[UserTempIndex].xb_latitue/1000000,sut_xinbiaopage[UserTempIndex].xb_latitue%1000000);
+	guiShowStr(0,y, Showbuf,FONT_MODE_16X16, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
 	y+=LIST_ITEM_HEGH;
-	snprintf(Showbuf, sizeof(Showbuf), "经度 W:%d.%05d",sut_xinbiaopage.xb_longitue/1000000,sut_xinbiaopage.xb_longitue%1000000);
-	guiShowStr(30,y, Showbuf,FONT_MODE_16X16, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
+	snprintf(Showbuf, sizeof(Showbuf), "经度 W:%d.%05d",sut_xinbiaopage[UserTempIndex].xb_longitue/1000000,sut_xinbiaopage[UserTempIndex].xb_longitue%1000000);
+	guiShowStr(0,y, Showbuf,FONT_MODE_16X16, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
 	y+=LIST_ITEM_HEGH;
-	snprintf(Showbuf,sizeof(Showbuf),"航向:%s",sut_xinbiaopage.xb_heading);
+	snprintf(Showbuf,sizeof(Showbuf),"航向:%s",sut_xinbiaopage[UserTempIndex].xb_heading);
 	guiShowStr(0,y,Showbuf,FONT_MODE_16X16,REVERSED_NO,COLOR_BLACK,guiGetBackColor());
 	y+=LIST_ITEM_HEGH;
-	snprintf(Showbuf,sizeof(Showbuf),"方向:%s",sut_xinbiaopage.xb_dir);
+	snprintf(Showbuf,sizeof(Showbuf),"方向:%s",sut_xinbiaopage[UserTempIndex].xb_dir);
 	guiShowStr(0,y,Showbuf,FONT_MODE_16X16,REVERSED_NO,COLOR_BLACK,guiGetBackColor());
 	y+=LIST_ITEM_HEGH;
-	snprintf(Showbuf,sizeof(Showbuf),"海拔:%s",sut_xinbiaopage.xb_elevation);
+	snprintf(Showbuf,sizeof(Showbuf),"海拔:%s",sut_xinbiaopage[UserTempIndex].xb_elevation);
 	guiShowStr(0,y,Showbuf,FONT_MODE_16X16,REVERSED_NO,COLOR_BLACK,guiGetBackColor());
 	y+=LIST_ITEM_HEGH;
-	
 }
 
 
@@ -2805,13 +2839,27 @@ void uiShowXINBIAOInfoUpdate(char StatusUpdate){
 		uiMenuShowBottomIndacitor("详情", "返回");
 	}
 }
-/*****************************信标详情结束********************************/
-
-
 
 
 
+void uiShowXINBIAOInfoResponse(void){
+	unsigned short key=getKeyValue();
+	if(MKEY_VALUE_ESC==key) {
+		UserTempIndex=0;
+		if(getStackStruct()->FastUiChange)uISetNextStatus(UIS_STANDBY);
+			else uISetNextStatus(UIS_MENU_XINBIAO_MAIN);
+	}
+	else if(MKEY_VALUE_UP==key)uiShowXINBIAOPageShow(1);
+	else if(MKEY_VALUE_DOWN==key)uiShowXINBIAOPageShow(2);
+	else if(MKEY_VALUE_MENU==key){
+		UserTempIndex=0;
+		getStackStruct()->ok_back=1;	
+		if(getStackStruct()->FastUiChange)uISetNextStatus(UIS_STANDBY);
+			else uISetNextStatus(UIS_MENU_XINBIAO_MAIN);
+	}
+}
 
+/*****************************信标详情结束********************************/
 
 
 
@@ -2882,14 +2930,19 @@ void uiShowXINBIAOTriggerMode(char StatusUpdate){
 
 void uiShowXINBIAOTriggerModeResponse(void){
 	unsigned short key=ListBoxResponse(&sutListBox);
-	if(MKEY_VALUE_ESC==key) uISetNextStatus(UIS_MENU_XINBIAO_MAIN);
+	if(MKEY_VALUE_ESC==key) {
+		if(getStackStruct()->FastUiChange)uISetNextStatus(UIS_STANDBY);
+			else uISetNextStatus(UIS_MENU_XINBIAO_MAIN);
+
+	}
 	else if(MKEY_VALUE_MENU==key){
 		getStackStruct()->ok_back=1;
 		if(newPara.Xinbiao_SendMode != sutListBox.handle){
 			newPara.Xinbiao_SendMode=sutListBox.handle;
 			sysIniSave("bleenable");
 		}
-		uISetNextStatus(UIS_MENU_XINBIAO_MAIN);
+		if(getStackStruct()->FastUiChange)uISetNextStatus(UIS_STANDBY);
+			else uISetNextStatus(UIS_MENU_XINBIAO_MAIN);
 	}
 }
 
@@ -2994,7 +3047,7 @@ void uiShowXinbiaoClearlist(char StatusUpdate){
 	if(StatusUpdate){
 		guiClearAll(guiGetBackColor());
 		guiShowCaption(0,"清除列表",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_16X16);
-		BleAudioLvFlash(0,1);
+		//BleAudioLvFlash(0,1);
 		uiMenuShowBottomLine();
 		uiMenuShowBottomIndacitor("确认", "返回");
 	}
@@ -3009,13 +3062,371 @@ void uiShowXinbiaoClearlistResponse(void){
 	}
 }
 
+/*****************************清除列表结束********************************/
+
+
+
+/*****************************菜单TTS开关开始********************************/
+
+void uiShowMenuTTSEnableUpdate(char StatusUpdate){
+	char Features[NORMAL_BOOL_NUM];
+	unsigned char i;
+	if(StatusUpdate){
+		guiClearAll(guiGetBackColor());
+		guiShowCaption(0,"语音播报",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_16X16);
+		uiMenuShowBottomLine();
+		for(i=0;i<NORMAL_BOOL_NUM;i++){
+			if(i==newPara.menu_tts) Features[i]=1;
+			else Features[i]=0;
+		}
+		ListBoxInit(&sutListBox,BoolMode,0,commonIcon2,Features,0);
+		uiMenuShowBottomIndacitor("保存", "返回");
+	}
+}
+
+void uiShowMenuTTSEnableUpdateResponse(void){
+	unsigned short key=ListBoxResponse(&sutListBox);
+	if(MKEY_VALUE_ESC==key) uISetNextStatus(UIS_MENU_SYS_SEL);
+	else if(MKEY_VALUE_MENU==key){
+		getStackStruct()->ok_back=1;
+		if(newPara.menu_tts!= sutListBox.handle){
+			newPara.menu_tts=sutListBox.handle;
+			sysIniSave("menu_tts");
+		}
+		uISetNextStatus(UIS_MENU_SYS_SEL);
+	}
+}
+/*****************************菜单TTS开关结束********************************/
+
+
+
+/*****************************震动开关开始********************************/
+
+void uiShowShakeEnableUpdate(char StatusUpdate){
+	char Features[NORMAL_BOOL_NUM];
+	unsigned char i;
+	if(StatusUpdate){
+		guiClearAll(guiGetBackColor());
+		guiShowCaption(0,"振动开关",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_16X16);
+		uiMenuShowBottomLine();
+		for(i=0;i<NORMAL_BOOL_NUM;i++){
+			if(i==newPara.Shake) Features[i]=1;
+			else Features[i]=0;
+		}
+		ListBoxInit(&sutListBox,BoolMode,0,commonIcon2,Features,0);
+		uiMenuShowBottomIndacitor("保存", "返回");
+	}
+}
+
+void uiShowShakeEnableUpdateResponse(void){
+	unsigned short key=ListBoxResponse(&sutListBox);
+	if(MKEY_VALUE_ESC==key) uISetNextStatus(UIS_MENU_SYS_SEL);
+	else if(MKEY_VALUE_MENU==key){
+		getStackStruct()->ok_back=1;
+		if(newPara.Shake!= sutListBox.handle){
+			newPara.Shake=sutListBox.handle;
+			sysIniSave("Shake");
+		}
+		uISetNextStatus(UIS_MENU_SYS_SEL);
+	}
+}
+/****************************震动开关结束********************************/
+
+
+
+
+/*****************************音质设置开始********************************/
+
+void uiShowPoc_soundUpdate(char StatusUpdate){
+	char Features[NORMAL_BOOL_NUM];
+
+	static const char *POc_SoundMode[NORMAL_BOOL_NUM+1]={
+			"4K",
+			"8K",
+			""
+	};
+	unsigned char i;
+	if(StatusUpdate){
+		guiClearAll(guiGetBackColor());
+		guiShowCaption(0,"音质设置",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_16X16);
+		uiMenuShowBottomLine();
+		for(i=0;i<NORMAL_BOOL_NUM;i++){
+			if(i==newPara.Poc_sound) Features[i]=1;
+			else Features[i]=0;
+		}
+		ListBoxInit(&sutListBox,POc_SoundMode,0,commonIcon2,Features,0);
+		uiMenuShowBottomIndacitor("保存", "返回");
+	}
+}
+
+void uiShowPoc_soundUpdateResponse(void){
+	char buf[20];
+	unsigned short key=ListBoxResponse(&sutListBox);
+	if(MKEY_VALUE_ESC==key) uISetNextStatus(UIS_MENU_SYS_SEL);
+	else if(MKEY_VALUE_MENU==key){
+		getStackStruct()->ok_back=1;
+		if(newPara.Poc_sound!= sutListBox.handle){
+			newPara.Poc_sound=sutListBox.handle;
+			snprintf(buf,sizeof(buf),"AT+POC=3000%02d01\r\n",newPara.Poc_sound+1);
+			msgAtSend(buf);
+			sysIniSave("Poc_sound");
+		}
+		uISetNextStatus(UIS_MENU_SYS_SEL);
+	}
+}
+/****************************音质设置结束********************************/
+
+
+
+
+/*****************************侧键部分开始*********************************/
+void uiShowSideKeyMenuSysSetup(char StatusUpdate){
+	static const char *CjapcPtr[]={
+		"1.侧键一长按",
+		"2.侧键二长按",
+		""
+	};
+	if(StatusUpdate){
+		guiClearAll(guiGetBackColor());
+		guiShowCaption(0,"侧键定义",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_16X16);
+		uiMenuShowBottomLine();
+		uiMenuShowBottomIndacitor("确认", "返回");
+		uiMenuInit(&sutMenuSysSetup,CjapcPtr,FONT_MODE_16X16);
+	}
+}
+
+void sysSetSideKeyResponse(void){
+	unsigned short key;
+	key=uiMenuResponse(&sutMenuSysSetup);
+	if(MKEY_VALUE_MENU==key){
+		switch(sutMenuSysSetup.handle){
+			case 0:
+				uISetNextStatus(UIS_MENU_CFUN_1_SEL);
+				break;
+			case 1:
+				uISetNextStatus(UIS_MENU_CFUN_2_SEL);
+				break;
+	
+		}
+		if(sutMenuSysSetup.handle<=1) uiPushStack(sutMenuSysSetup.handle);
+	}else if(MKEY_VALUE_ESC==key) uISetNextStatus(UIS_MENU_MAIN);
+}
+/*****************************侧键部分结束*********************************/
+
+
+
+/*****************************侧键长按设置开始********************************/
+
+void uiShowSideKeyFuncUpdate(char StatusUpdate,char type){
+	char Features[6];
+
+	static const char *SideKeyMode[6+1]={
+			"蓝牙开关",
+			"信标发送",
+			"信标详情",
+			"群组选择",
+			"成员选择",
+			"好友选呼",
+			""
+	};
+	unsigned char i;
+	char temp;
+	if(StatusUpdate){
+		guiClearAll(guiGetBackColor());
+		if(type==0){
+			temp=newPara.sidekey01_func;
+			guiShowCaption(0,"侧键1长按",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_16X16);
+		}
+		else {
+			temp=newPara.sidekey02_func;
+			guiShowCaption(0,"侧键2长按",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_16X16);
+
+		}
+		uiMenuShowBottomLine();
+		for(i=0;i<6;i++){
+			if(i==temp) Features[i]=1;
+			else Features[i]=0;
+		}
+		ListBoxInit(&sutListBox,SideKeyMode,0,commonIcon2,Features,0);
+		uiMenuShowBottomIndacitor("选择", "返回");
+	}
+}
+
+void uiShowSideKeyFuncUpdateResponse(char type){
+	char buf[20];
+	char tmep=0;
+	unsigned short key=ListBoxResponse(&sutListBox);
+
+	if(type==0)tmep=newPara.sidekey01_func;
+	else tmep=newPara.sidekey02_func;
+	if(MKEY_VALUE_ESC==key) {
+		if(getStackStruct()->FastUiChange)uISetNextStatus(UIS_STANDBY);
+		else uISetNextStatus(UIS_MENU_CJ_MIAN);
+	}
+	else if(MKEY_VALUE_MENU==key){
+		getStackStruct()->ok_back=1;
+		if(tmep!= sutListBox.handle){
+			if(type==0)newPara.sidekey01_func=sutListBox.handle;
+			else newPara.sidekey02_func=sutListBox.handle;
+			sysIniSave("SideKey");
+		}
+		if(getStackStruct()->FastUiChange)uISetNextStatus(UIS_STANDBY);
+		else uISetNextStatus(UIS_MENU_CJ_MIAN);
+	}
+}
+/****************************侧键长按结束********************************/
+
+
+
+/*****************************首长主菜单开始*********************************/
+void uiShowLeaderMenuSysSetup(char StatusUpdate){
+	static const char *CjapcPtr[]={
+		"1.摇晕",
+		"2.摇毙",
+		"3.强制打开GPS",
+		""
+	};
+	if(StatusUpdate){
+		guiClearAll(guiGetBackColor());
+		guiShowCaption(0,"首长功能",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_16X16);
+		uiMenuShowBottomLine();
+		uiMenuShowBottomIndacitor("确认", "返回");
+		uiMenuInit(&sutMenuSysSetup,CjapcPtr,FONT_MODE_16X16);
+	}
+}
+
+void sysSetLeaderResponse(void){
+	unsigned short key;
+	key=uiMenuResponse(&sutMenuSysSetup);
+	if(MKEY_VALUE_MENU==key){
+		switch(sutMenuSysSetup.handle){
+			case 0:
+				uISetNextStatus(UIS_MENU_SZ_YAOYUN);
+				break;
+			case 1:
+				uISetNextStatus(UIS_MENU_SZ_YAOYBI);
+				break;
+				
+			case 2:
+				uISetNextStatus(UIS_MENU_SZ_FORCEGPS);
+				break;
+
+		}
+		if(sutMenuSysSetup.handle<=2) uiPushStack(sutMenuSysSetup.handle);
+	}else if(MKEY_VALUE_ESC==key) uISetNextStatus(UIS_MENU_MAIN);
+}
+/*****************************首长主菜单结束*********************************/
+
+
+
+
+ void ReFlashItemLeader(char StatusUpdate,char type){
+	static unsigned short susCt=0;
+	static const char *leaderIconFileName[]={
+		"/ext/prepack/people2.bmp",
+		"/ext/prepack/yaoyun.bmp",
+		"/ext/prepack/yaobi.bmp",
+		"/ext/prepack/unsel.bmp",
+		"/ext/prepack/sel.bmp",
+		""
+	};
+	static char *icons[5];//3//3
+	int i,j;
+	unsigned short timeout;
+	static const char *NullGU="";
+	static char *GUName[MAX_USER+1+1];	
+	static char GUFeatures[MAX_USER+1+1];
+	static char checkboxFeatures[MAX_USER+1+1];
+	static char *Pall="所有";
+
+	unsigned char showHandle=0;
+
+	if(StatusUpdate==0)return;
+
+	for(i=0;i<6;i++)icons[i]=leaderIconFileName[i];
+
+	GUName[0]=Pall;
+	GUFeatures[0]=0;
+	if(StatusUpdate==1)checkboxFeatures[0]=0;
+	else checkboxFeatures[0]=1;
+	
+	for(i=1;i<=MAX_USER;i++){
+		GUName[i]=NullGU;
+		GUFeatures[i]=0;
+		if(StatusUpdate==1)checkboxFeatures[i]=0;
+		else checkboxFeatures[i]=1;
+	
+	}
+	for(i=0;i<MAX_USER;i++){	
+		GUName[i+1]=UserArr[i].UserName;		
+		for(j=0;j<MAX_USER;j++){	
+			if(UserArr[i].id==leader[j].id){
+			GUFeatures[i+1]=leader[j].status;
+			}
+		}		
+	}
+	
+	  if(UserArr[0].UserName[0]==0){
+			GUName[0]="空";
+			GUFeatures[0]=0;
+		}
+	  
+	    guiFillRect(0, UI_STATUS_ITEM_Y, GLCD_WIDTH-1, UI_CONTENT_SHOW_Y-1, guiGetForeColor());//清除第二区
+	 if(type==0){
+		guiShowCaption(0,"摇晕选择",UI_STATUS_BAR_HEIGH,guiGetBackColor(),guiGetForeColor(),FONT_MODE_16X16);
+		uiMenuShowBottomIndacitor("勾选", "返回");
+	}else if(type==1){
+		guiShowCaption(0,"摇毙选择",UI_STATUS_BAR_HEIGH,guiGetBackColor(),guiGetForeColor(),FONT_MODE_16X16);
+		uiMenuShowBottomIndacitor("勾选", "返回");
+	}
+ 
+ /*
+	if(setHandleToZero==true){
+		showHandle=0;
+		setHandleToZero=false;
+	}else{
+		if(sutPocStatus.ListFillIndex) showHandle=sutPocStatus.ListFillIndex-1;
+		else showHandle=0;
+	}
+	*/
+	CheckBoxInit(&sut_check_box,GUName,0,leaderIconFileName,GUFeatures,0,checkboxFeatures);
+    //	GUListBoxInited=1;
+}
+
+
+
+void uiShowLeaderFuncResponse(){
+	char buf[20];
+	char tmep=0;
+	unsigned short key=CheckBoxResponse(&sut_check_box);
+	if(key==MKEY_VALUE_ESC)uISetNextStatus(UIS_MENU_SZ_MIAN);
+	else if(key==MKEY_VALUE_PTT){
+		
+		if(sutUIstatus.Status==UIS_MENU_SZ_YAOYUN){
+			Record_Leader_Status(0);
+			LeaderPackSend(YAOYUN);
+		}
+		else{
+			 Record_Leader_Status(1);
+			LeaderPackSend(YAOBI);
+		}
+		//write
+		 WriteLeaderFile();
+		uISetNextStatus(UIS_MENU_SZ_MIAN);
+	}	
+}
+
+
+
+
+
+
 
 
 
 
 
 
-/*****************************清除列表结束********************************/
 
 
 

+ 31 - 0
app/uiBlock.h

@@ -130,6 +130,37 @@ void uiShowXINBIAOGateway(char StatusUpdate);
 void uiShowXINBIAOGatewayResponse(void);
 void uiShowXinbiaoClearlist(char StatusUpdate);
 void uiShowXinbiaoClearlistResponse(void);
+void uiShowXINBIAOInfoUpdate(char StatusUpdate);
+void uiShowXINBIAOInfoResponse(void);
+
+
+void uiShowMenuTTSEnableUpdate(char StatusUpdate);
+void uiShowMenuTTSEnableUpdateResponse(void);
+
+void uiShowShakeEnableUpdate(char StatusUpdate);
+void uiShowShakeEnableUpdateResponse(void);
+void uiShowPoc_soundUpdate(char StatusUpdate);
+
+void uiShowPoc_soundUpdateResponse(void);
+
+
+
+
+
+void uiShowSideKeyMenuSysSetup(char StatusUpdate);
+void sysSetSideKeyResponse(void);
+
+
+void uiShowSideKeyFuncUpdate(char StatusUpdate,char type);
+void uiShowSideKeyFuncUpdateResponse(char type);
+
+void uiShowLeaderMenuSysSetup(char StatusUpdate);
+void sysSetLeaderResponse();
+
+void ReFlashItemLeader(char StatusUpdate,char type);
+
+void uiShowLeaderFuncResponse();
+
 
 
 

+ 79 - 5
app/uiEntry.c

@@ -72,9 +72,7 @@ void uiLoop(unsigned int exeInterval){
 			break;
 			
 		case UIS_MENU_FRIEND_SEL:
-
 			uiShowGUSel(StatusUpdate,exeInterval,2);
-
 			break;
 	
 			
@@ -212,7 +210,7 @@ void uiLoop(unsigned int exeInterval){
 			uiShowXINBIAOStationUpdate(StatusUpdate);
 			break;
 		case UIS_MENU_XINBIAO_INFO:
-		
+			uiShowXINBIAOInfoUpdate(StatusUpdate);
 			break;
 		case UIS_MENU_XINBIAO_LIVE:
 			uiShowXINBIAOEnableLive( StatusUpdate);
@@ -229,7 +227,43 @@ void uiLoop(unsigned int exeInterval){
 		case UIS_MENU_XINBIAO_LISTCLEAR:
 			uiShowXinbiaoClearlist( StatusUpdate);
 			break;	
+			
+		case UIS_MENU_SYS_TTSON:
+			uiShowMenuTTSEnableUpdate( StatusUpdate);
+			break;
 
+		case UIS_MENU_SYS_SHAKE:
+			uiShowShakeEnableUpdate( StatusUpdate);
+			break;
+
+		case UIS_MENU_SYS_SOUNDSEL:
+			uiShowPoc_soundUpdate(StatusUpdate);
+			break;
+
+		
+		case UIS_MENU_CJ_MIAN:
+			uiShowSideKeyMenuSysSetup(StatusUpdate);
+			break;
+		case UIS_MENU_CFUN_1_SEL:
+			uiShowSideKeyFuncUpdate( StatusUpdate,0);
+			break;
+
+		case UIS_MENU_CFUN_2_SEL:
+			uiShowSideKeyFuncUpdate( StatusUpdate,1);
+			break;
+
+		case UIS_MENU_SZ_MIAN:
+			uiShowLeaderMenuSysSetup(StatusUpdate);
+			break;
+		case UIS_MENU_SZ_YAOYUN:
+			ReFlashItemLeader(StatusUpdate,0);
+			break;
+		case UIS_MENU_SZ_YAOYBI:
+			ReFlashItemLeader(StatusUpdate,1);
+			break;
+		case UIS_MENU_SZ_FORCEGPS:
+			break;
+			
 			
 #ifdef ENABLE_DEBUG			
 		case UIS_DEBUG:
@@ -405,7 +439,7 @@ void uiResponse(unsigned int exeInterval){
 			uiShowXINBIAOStationUpdateResponse();
 			break;
 		case UIS_MENU_XINBIAO_INFO:
-			
+			 uiShowXINBIAOInfoResponse();
 			break;
 		case UIS_MENU_XINBIAO_LIVE:
 			uiShowXINBIAOEnableLiveResponse();
@@ -421,8 +455,48 @@ void uiResponse(unsigned int exeInterval){
 			break;
 		case UIS_MENU_XINBIAO_LISTCLEAR:
 			uiShowXinbiaoClearlistResponse();
-			break;		
+			break;	
+			
+		case UIS_MENU_SYS_TTSON:
+			uiShowMenuTTSEnableUpdateResponse();
+			break;
+
+		case UIS_MENU_SYS_SHAKE:
+			uiShowShakeEnableUpdateResponse();
+			break;
+
+		case UIS_MENU_SYS_SOUNDSEL:
+			uiShowPoc_soundUpdateResponse();
+			break;
+
+
+		case UIS_MENU_CJ_MIAN:
+			sysSetSideKeyResponse();
+			break;
+		case UIS_MENU_CFUN_1_SEL:
+			uiShowSideKeyFuncUpdateResponse(0);
+			break;
+
+			
+		case UIS_MENU_CFUN_2_SEL:
+			uiShowSideKeyFuncUpdateResponse(1);
+			break;
+
+
+		case UIS_MENU_SZ_MIAN:
+			sysSetLeaderResponse();
+			break;
+		case UIS_MENU_SZ_YAOYUN:
+			uiShowLeaderFuncResponse();
+			break;
+		case UIS_MENU_SZ_YAOYBI:
+			uiShowLeaderFuncResponse();
+			break;
+		case UIS_MENU_SZ_FORCEGPS:
+			
+			break;
 			
+						
 	#ifdef ENABLE_DEBUG			
 		case UIS_DEBUG:
 			uiShowDebugResponse();

+ 23 - 0
app/uiEntry.h

@@ -16,6 +16,9 @@ typedef enum{
 	UIS_MENU_SYS_SEL,		//1.4:系统设置菜单
 	UIS_MENU_LOCATION_SEL,	//1.5:定位设置菜单
 	UIS_MENU_INFO_SEL,		//1.6:终端信息菜单
+	//UIS_MENU_QUICKUI_SET,
+	//UIS_MENU_LEADFUNC_SET,
+	UIS_MENU_ALARM_SET,
 	
 	UIS_MENU_MAIL_READ,		//1.3.1:文本消息读
 	UIS_MENU_MAIL_OPTION,	//1.3.2:文本消息选项
@@ -34,6 +37,12 @@ typedef enum{
 	UIS_MENU_SYS_SPK,
 	UIS_MENU_SYS_FONT,
 	UIS_MENU_SYS_LOCK,
+	
+	UIS_MENU_SYS_TTSON,  //语音播报
+	UIS_MENU_SYS_SHAKE, //震动
+	UIS_MENU_SYS_SOUNDSEL,//音质
+
+	
 	UIS_MENU_SYS_SERVER,	//1.4.5.1:服务器设置
 	UIS_MENU_SYS_FACTORY,
 	UIS_MENU_SHUT_PWR,
@@ -77,7 +86,21 @@ typedef enum{
 	UIS_MENU_XINBIAO_TIME,
 	UIS_MENU_XINBIAO_IP,
 	UIS_MENU_XINBIAO_LISTCLEAR,
+	/*
+		侧键定义
+	*/
+	UIS_MENU_CJ_MIAN,
+	UIS_MENU_CFUN_1_SEL,
+	UIS_MENU_CFUN_2_SEL,
+	/*
+		首长功能
 
+	*/
+	UIS_MENU_SZ_MIAN,
+	UIS_MENU_SZ_YAOYUN,
+	UIS_MENU_SZ_YAOYBI,
+	UIS_MENU_SZ_FORCEGPS,
+	
 #ifdef ENABLE_DEBUG			
 	UIS_DEBUG
 #endif

+ 237 - 24
app/xinbiao.c

@@ -1,34 +1,104 @@
 
-#include "xinbiao.h"
+#include "includes.h"
+
 
 SUT_XINBIAO_PAGE sut_xinbiaopage[XINBIAO_NUM];
-SUT_XINBIAO_PAGE Self_xinbiaopage;
+SUT_XINBIAO_PAGE New_xinbiaopage;
 SUT_XINBIAO_INFO sut_xinbiao_info;
 
+USERARR UserArr[MAX_USER];  //临时存储当前所有成员   //每次 86  都需要更新
+LEADER leader[XINBIAO_NUM];  //根据 UserArr  每次更新 进表格  存入文件系统
+
 
 /*
 	获得新的信标页
 	 callID    //是, 更新页  
-	 	      //否,创建新页
+	 	      //否,创建新页	 	      
+	
+*/
 
-	 	      
-	 
+//+POC=8C00%08x%02x;%d;%d;%d;%d;%d;\r\n"
+//+POC:8C00 934C0008 00 3B 
 
-*/
 
-void CalcDistance(void *SelfXinbiao,void*OtherXinbiao)
+void Recv_PackNewxinbiaopage(char*msg)
 {
+	char i,j;
+	char start=0;
+	char *Pmsg=0;
+	char data[500];
+	msg[17]=0;
+	New_xinbiaopage.xb_CallID=htoi(msg+9);
+	
+	//find user name
+	for(i=0;i<MAX_USER;i++){
+		if(UserArr[i].id==New_xinbiaopage.xb_CallID){
+		strcpy(New_xinbiaopage.xb_CallName,UserArr[i].UserName);
+		}
 
+	}
+	StrAsciiToHex(msg[21],data);
+	Pmsg=data;
+
+		//456;789
+	for(i=0;i<strlen(Pmsg);i++){
+		if(Pmsg[i]==';'){
+			Pmsg[i]=0;
+			switch(j){
+				case 0:
+					New_xinbiaopage.xb_longitue=atoi(Pmsg+start);
+				break;
+
+				case 1:
+					New_xinbiaopage.xb_latitue=atoi(Pmsg+start);
+				break;
 
+				case 2:
+					New_xinbiaopage.xb_heading=atoi(Pmsg+start);
+				break;
 
+				case 3:
+					New_xinbiaopage.xb_headerSpeed=atoi(Pmsg+start);
+				break;
 
+				case 4:
+					New_xinbiaopage.xb_elevation=atoi(Pmsg+start);
+				break;
+			}
+			i++;
+			start=i;
+			j++;
+		}
 
 
+	}
 
 }
 
+void PushXinbiao(SUT_XINBIAO_PAGE*NewXinbiao)
+{
 
-void PushXinbiao()
+	char i=0;
+	for(i=0;i<sut_xinbiao_info.Max_id;i++){
+		if(NewXinbiao->xb_CallID==sut_xinbiaopage[i].xb_CallID){
+			memcpy(&sut_xinbiaopage[i],NewXinbiao,sizeof(SUT_XINBIAO_PAGE));	
+			return;
+		}
+	}
+	
+	  //否,创建新页	
+	NewXinbiao->xb_id=sut_xinbiao_info.Max_id;
+	memcpy(&sut_xinbiaopage[i+1],NewXinbiao,sizeof(SUT_XINBIAO_PAGE));	
+	sut_xinbiao_info.Max_id++;
+	
+	//处理完 清空
+	memset(NewXinbiao,0,sizeof(NewXinbiao));
+	
+}
+
+
+
+void CalcDistance(SUT_XINBIAO_PAGE*NewXinbiao)
 {
 
 
@@ -37,6 +107,42 @@ void PushXinbiao()
 
 }
 
+/*
+信标协议 cmd  00  通用 
+	        0a  摇晕  只收不发
+	        a0  解除摇晕
+		  0b	摇毙   不收不发
+		  b0  解除摇毙
+		  0c  强制打开GPS
+*/
+
+void XinbiaoPackSend(char cmd)
+{
+	char temp[100]={0};
+	snprintf(temp,sizeof(temp),"AT+POC=150000%08x%02x;%d;%d;%d;%d;%d;\r\n",sutPocStatus.LocalGroup.ID,cmd,sutGpsInfo.longitue\
+		,sutGpsInfo.latitue,sutGpsInfo.heading,sutGpsInfo.headerSpeed,sutGpsInfo.elevation);
+	//strcpy(data,temp);
+	msgAtSend(temp);
+	MSG_INFO(1,temp);
+}
+
+//定时发送信标
+void Xinbiao_handler(unsigned int interval){
+	static unsigned short cnt=0;
+	//char Packdata[100]={0};
+	if(sutApp.gtMode!=0) return;
+	if(newPara.Xinbiao_SendMode==0)return;
+	if(newPara.gpsEnable==0)return;
+	if(++cnt<((newPara.Xinbiao_Time+1)*5*1000/interval) && gpsCheckCnt==0) return;
+	cnt=0;
+	gpsCheckCnt=0;
+	if(sutGpsInfo.isGpsValid){
+		XinbiaoPackSend(NULLCMD);
+	}
+}
+
+
+
 
 void ReadXbFile()
 {
@@ -47,7 +153,7 @@ void ReadXbFile()
 		return;
 	}
 	LSAPI_FS_Seek(fd, 0L, LSAPI_FS_SEEK_SET);
-	LSAPI_FS_Read(fd, (unsigned char *)&sut_xinbiaopage, sizeof(sut_xinbiaopage)*XINBIAO_NUM);
+	LSAPI_FS_Read(fd, (unsigned char *)&sut_xinbiaopage, sizeof(SUT_XINBIAO_PAGE)*XINBIAO_NUM);
 
 	for(i=0;i<XINBIAO_NUM;i++){
 		if(sut_xinbiaopage[i].xb_id==0){
@@ -55,44 +161,151 @@ void ReadXbFile()
 				break;
 		}
 	}
-
-	
 }
 
-
-
 void WriteXbFile()
 {
-
-
-
-
+	int fd;
+	MSG_INFO(1,"%s save start",XINBIAO_FILE);
+	fd=LSAPI_FS_Open(XINBIAO_FILE, LSAPI_FS_O_RDWR,0x0);
+	if(fd<0){
+		MSG_ERR(1,"%s open failed",XINBIAO_FILE);
+		return;
+	}
+	LSAPI_FS_Seek(fd, 0L, LSAPI_FS_SEEK_SET);
+	LSAPI_FS_Write(fd, (unsigned char *)&sut_xinbiaopage, sizeof(SUT_XINBIAO_PAGE)*XINBIAO_NUM);
+	LSAPI_FS_Close(fd);
+	MSG_INFO(1,"%s save done", XINBIAO_FILE);
 	
 }
 
 
+/*******************************************************************************************
+下面为 首长功能
+*******************************************************************************************/
 
+signed char Record_Leader_CurIndex(){
+	unsigned char i;
+	for(i=0;i<MAX_USER;i++){
+		if(leader[i].id==0)return i;//找到空白
+	}
+	return -1;
 
+}
+char Record_Leader_Scanf(int id){
+	unsigned char i;
 
+	for(i=0;i<MAX_USER;i++){
+		if(leader[i].id==id)break;
+		if(leader[i].id==0)break;//找到空白
+	}
+	if(i==MAX_USER)i=0;               //覆盖第一条
+	return i;
+}
 
+void Record_Leader_Status(char type){
 
+	unsigned char i;
+	unsigned char index;
+	
+	for(i=1;i<MAX_USER;i++){
+		index=Record_Leader_Scanf(UserArr[i-1].id);
+		leader[index].id=UserArr[i-1].id;
+		if(type=0){//摇匀
+			if(sut_check_box.checkstatus[i])leader[index].status=1;
+			else leader[index].status=0;
+		}else{
+			if(sut_check_box.checkstatus[i])leader[index].status=2;
+			else leader[index].status=0;
+
+		}		
+	}
+}
 
+//           ID      cmd   ;
+//+POC:8C00 934C0008 00    3B 
+void LeaderRecv_handler(char*msg,char type)
+{
+	char i;
+	char start=0;
+	char *Pmsg=0;
+	int id=0;
+	char data[250];
+
+	StrAsciiToHex(msg[21],data);
+	Pmsg=data;
+		//456;789
+	for(i=0;i<strlen(Pmsg);i++){
+		if(Pmsg[i]==';'){
+			Pmsg[i]=0;
+
+			id=atoi(Pmsg+start);
+			if(id==sutPocStatus.LocalUser.ID){
+				sutPocStatus.LeaderCmd=type;
+				if(sutPocStatus.spk)msgAtSend("AT+POC=0C0000\r\n");//说话状态释放话语权
+				break;
+			}
+				
+			i++;
+			start=i;
+		}
 
+	}
 
+}
 
 
 
 
+void LeaderPackSend(char cmd)
+{
+	char temp[250]={0};
+	char buf[8];
+	int i;
+	int max;
+
+	max=Record_Leader_CurIndex();
+	if(max==-1)return;
+	snprintf(temp,sizeof(temp),"AT+POC=150000%08x%02x;",sutPocStatus.LocalGroup.ID,cmd);
+	for(i=0;i<max;i++){
+		snprintf(buf,sizeof(buf),"%x;",leader[i].id);
+		strcat(temp,buf);
+	}
+	strcat(temp,"\r\n");
+	msgAtSend(temp);
+	MSG_INFO(1,temp);
+}
+//LEADER leader[XINBIAO_NUM];
 
+void ReadLeaderFile()
+{
+	int fd,i=0;
+	fd=LSAPI_FS_Open(LEADER_FILE, LSAPI_FS_O_RDWR,0);
+	if(fd<0){
+		MSG_ERR(1,"%s open read failed", LEADER_FILE);
+		return;
+	}
+	LSAPI_FS_Seek(fd, 0L, LSAPI_FS_SEEK_SET);
+	LSAPI_FS_Read(fd, (unsigned char *)&leader, sizeof(LEADER)*XINBIAO_NUM);
+	
+}
 
 
-
-
-
-
-
-
-
+void WriteLeaderFile()
+{
+	int fd;
+	MSG_INFO(1,"%s save start",LEADER_FILE);
+	fd=LSAPI_FS_Open(LEADER_FILE, LSAPI_FS_O_RDWR,0x0);
+	if(fd<0){
+		MSG_ERR(1,"%s open failed",LEADER_FILE);
+		return;
+	}
+	LSAPI_FS_Seek(fd, 0L, LSAPI_FS_SEEK_SET);
+	LSAPI_FS_Write(fd, (unsigned char *)&leader, sizeof(LEADER)*XINBIAO_NUM);
+	LSAPI_FS_Close(fd);
+	MSG_INFO(1,"%s save done", LEADER_FILE);
+	
+}
 
 
 

+ 50 - 12
app/xinbiao.h

@@ -1,15 +1,36 @@
 #ifndef _XINBIAO_H_
 #define _XINBIAO_H_
 
-#define XINBIAO_NUM 50
+#define XINBIAO_NUM 100
 #define XINBIAO_FILE "/ext/prepack/xinbiao"
+#define LEADER_FILE "/ext/prepack/leader"
+
+
+/*
+信标协议 cmd  00  通用 
+	        0a  摇晕  只收不发
+	        a0  解除摇晕
+		  0b	摇毙   不收不发
+		  b0  解除摇毙
+		  0c  强制打开GPS
+*/
+
+#define NULLCMD 0x00
+#define YAOYUN 0xa0
+#define UNYAOYUN 0x0a
+#define YAOBI  0x0b
+#define UNYAOBI  0xb0
+#define GPSALLON  0x0c
+
+#define MAX_USER 100
+
 
 typedef struct{
 	unsigned int xb_id;// 结构体index  也做作为mark
 	unsigned int xb_CallID;
-	unsigned char xb_CallName[20];
-	uint32_t xb_longitue;//经度
-	uint32_t xb_latitue;//纬度
+	unsigned char xb_CallName[26];
+	unsigned int xb_longitue;//经度
+	unsigned int xb_latitue;//纬度
 	unsigned int xb_heading;//航向
 	unsigned int xb_headerSpeed;
 	unsigned short xb_elevation;//海拔
@@ -18,37 +39,54 @@ typedef struct{
 }SUT_XINBIAO_PAGE;
 
 
-
 extern SUT_XINBIAO_PAGE sut_xinbiaopage[XINBIAO_NUM];
-
-extern SUT_XINBIAO_PAGE Self_xinbiaopage;
-
+extern SUT_XINBIAO_PAGE New_xinbiaopage;
 
 typedef struct{
 	
 	unsigned char Max_id;//最大值
 	
-
-
-
 }SUT_XINBIAO_INFO;
 
 
-extern SUT_XINBIAO_INFO sut_xinbiao_info;
+typedef struct{
+	int id;
+	char UserName[26];
+}USERARR;
 
 
 
+typedef struct{
+	char status;
+	int id;
+}LEADER;
 
 
 
 
+extern SUT_XINBIAO_INFO sut_xinbiao_info;
+extern USERARR UserArr[MAX_USER];
+extern LEADER leader[XINBIAO_NUM];
 
+void Recv_PackNewxinbiaopage(char*msg);
 
+void XinbiaoPackSend(char cmd);
 
+void Xinbiao_handler(unsigned int interval);
 
 
 
+/*
+首长功能
+*/
+signed char Record_Leader_CurIndex();
+char Record_Leader_Scanf(int id);
+void Record_Leader_Status(char type);
+void LeaderPackSend(char cmd);
+void LeaderRecv_handler(char*msg,char type);
 
+void ReadLeaderFile();
+void WriteLeaderFile();