Просмотр исходного кода

增加sos报警提示,增加sos cancel逻辑,修改离线判断逻辑

vothin 5 месяцев назад
Родитель
Сommit
8f02a9e0f3

+ 2 - 2
.settings/com.zksw.flythings.easyui.prefs

@@ -1,5 +1,5 @@
-easyui.cfg.debug={"baud"\:"115200","defBrightness"\:-1,"font"\:"/mnt/extsd/ui/Harmony_231030.ttf","languageCode"\:"zh_CN","languagePath"\:"/mnt/extsd/tr/","resPath"\:"/mnt/extsd/ui/","rotateScreen"\:90,"rotateTouch"\:0,"screensaverTimeOut"\:-1,"startupLibPath"\:"/mnt/extsd/lib/libzkgui.so","startupTouchCalib"\:false,"touchDev"\:"/dev/input/event1","uart"\:"ttyS1","zkdebug"\:false}
-easyui.cfg.release={"baud"\:"115200","defBrightness"\:-1,"font"\:"/res/ui/Harmony_231030.ttf","languageCode"\:"zh_CN","languagePath"\:"/res/tr/","resPath"\:"/res/ui/","rotateScreen"\:90,"rotateTouch"\:0,"screensaverTimeOut"\:-1,"startupLibPath"\:"/res/lib/libzkgui.so","startupTouchCalib"\:false,"touchDev"\:"/dev/input/event1","uart"\:"ttyS1","zkdebug"\:false}
+easyui.cfg.debug={"baud"\:"115200","defBrightness"\:-1,"font"\:"/mnt/extsd/ui/Harmony_240927.ttf","languageCode"\:"zh_CN","languagePath"\:"/mnt/extsd/tr/","resPath"\:"/mnt/extsd/ui/","rotateScreen"\:90,"rotateTouch"\:0,"screensaverTimeOut"\:-1,"startupLibPath"\:"/mnt/extsd/lib/libzkgui.so","startupTouchCalib"\:false,"touchDev"\:"/dev/input/event1","uart"\:"ttyS1","zkdebug"\:false}
+easyui.cfg.release={"baud"\:"115200","defBrightness"\:-1,"font"\:"/res/ui/Harmony_240927.ttf","languageCode"\:"zh_CN","languagePath"\:"/res/tr/","resPath"\:"/res/ui/","rotateScreen"\:90,"rotateTouch"\:0,"screensaverTimeOut"\:-1,"startupLibPath"\:"/res/lib/libzkgui.so","startupTouchCalib"\:false,"touchDev"\:"/dev/input/event1","uart"\:"ttyS1","zkdebug"\:false}
 eclipse.preferences.version=1
 platform={"name"\:"Z21","cprojectTemplateDir"\:"bundle/cproject/z21","internalCode"\:"z21"}
 resolution=800x480

+ 1 - 0
i18n/zh_CN.tr

@@ -94,6 +94,7 @@
     <string name="Mode1">是否切换成模式1</string>
     <string name="Mode2">是否切换成模式2</string>
     <string name="ModeConfirm">确认切换模式后,本机会重启</string>
+    <string name="SosCalling">报警已发出</string>
     <!-- 医护界面 -->
     <string name="MedicalLoginMsg">请输入正确的密码,进入医护功能</string>
     <string name="InputMedicalPassword">输入密码进入医护</string>

+ 21 - 1
jni/logic/functionLogic.cc

@@ -308,6 +308,22 @@ void mode(string functionText) {
 	mFunctionWindowPtr->showWnd();
 }
 
+void functionSosCall() {
+    mIconPainterPtr->setBackgroundPic("icon/sos.png");
+    mFunctionTextViewPtr->setText(LANGUAGEMANAGER->getValue("SosCalling"));
+    mStateTextViewPtr->setVisible(false);
+    mFunctionButtonPtr->setVisible(true);
+    mFunctionButtonPtr->setButtonStatusPic(ZK_CONTROL_STATUS_NORMAL, "button/elliptic_red.png");
+    mFunctionWindowPtr->showWnd();
+
+    mediaPlayer.Play(CONFIGMANAGER->getResFilePath("sos4.MP3"), "", 1000,
+            base::MediaPlayer::PlayMode::Default);
+
+    mActivityPtr->registerUserTimer(FUNCTION_TIMER_HANDLE, 8 * 1000);
+}
+
+
+
 
 /**
  * 注册定时器
@@ -393,6 +409,9 @@ static void onUI_intent(const Intent *intentPtr) {
 			_functionText = intentPtr->getExtra(functionText);
 			mode(_functionText);
 		}
+        else if (_functionWindows == "sosCall") {
+            functionSosCall();
+        }
     }
 }
 
@@ -568,7 +587,8 @@ static bool onButtonClick_FunctionButton(ZKButton *pButton) {
     if (_functionWindows == "help" ||
     		_functionWindows == "helpResonse" ||
 			_functionWindows == "position" ||
-			_functionWindows == "roomPatrol"
+			_functionWindows == "roomPatrol" ||
+            _functionWindows == "sosCall"
 			) {
     	mActivityPtr->unregisterUserTimer(FUNCTION_TIMER_HANDLE);
     }

+ 389 - 300
jni/logic/mainLogic.cc

@@ -112,335 +112,426 @@ void setMainMode() {
 	}
 }
 
-
-static void getServerInfo(){
-
-	string url = getHttpGateway() + "/ncs_url/server_info";
-	LOGD("请求服务器信息. url = %s", url.c_str());
-	//发起HTTP GET请求
-	RestClient::Response r = RestClient::get(url);
-	//解析json
-	Json::Reader reader;
-	Json::Value root;
-	if (reader.parse(r.body, root, false)){
-		// http
-		StoragePreferences::putString(STORE_GATEWAY, root["http_local_ip"].asString());
-		StoragePreferences::putInt(STORE_HTTP_PORT, root["http_port"].asInt());
-
-		// tcp
-		StoragePreferences::putString(STORE_TCP_LOCAL_IP, root["tcp_local_ip"].asString());
-		StoragePreferences::putInt(STORE_TCP_PORT, root["tcp_port"].asInt());
-
-		// sip
-		StoragePreferences::putString(SIP_REG_DOMAIN, root["sip_ip"].asString());
-		StoragePreferences::putInt(SIP_REG_PORT, root["sip_port"].asInt());
-
-		serverInfo = false;	// 只有请求成功了,才不需要重复请求
+static net::Conn* udpConn;
+class UdpThread: public Thread {
+public:
+	static void getServerInfo(){
+
+		string url = getHttpGateway() + "/ncs_url/server_info";
+		LOGD("请求服务器信息. url = %s", url.c_str());
+		//发起HTTP GET请求
+		RestClient::Response r = RestClient::get(url);
+		//解析json
+		Json::Reader reader;
+		Json::Value root;
+		if (reader.parse(r.body, root, false)){
+			// http
+			StoragePreferences::putString(STORE_GATEWAY, root["http_local_ip"].asString());
+			StoragePreferences::putInt(STORE_HTTP_PORT, root["http_port"].asInt());
+
+			// tcp
+			StoragePreferences::putString(STORE_TCP_LOCAL_IP, root["tcp_local_ip"].asString());
+			StoragePreferences::putInt(STORE_TCP_PORT, root["tcp_port"].asInt());
+
+			// sip
+			StoragePreferences::putString(SIP_REG_DOMAIN, root["sip_ip"].asString());
+			StoragePreferences::putInt(SIP_REG_PORT, root["sip_port"].asInt());
+
+			serverInfo = false;	// 只有请求成功了,才不需要重复请求
+		}
 	}
-}
 
-// 读取空间缓存的数据
-static void getFrameInfo() {
-	mRoomNameTextViewPtr->setText(frameInfo["full_name"].asString());
-}
+	static void getDeviceInfo(){
+		if (dataInit){
+			getFrameInfo();
+			getBedCount();
+			return;
+		}
 
-static void getBedCount() {
-	if (mActivityPtr == NULL) {
-		return;
+        if (!isConnectServer()) {
+            return;
+        }
+		string url = getHttpGateway() + "/deviceRoom/get_device_by_eth_mac/" + StoragePreferences::getString(STORE_MAC_ADDR, "0.0.0.0");
+		LOGD("请求设备信息. url = %s", url.c_str());
+		//发起HTTP GET请求
+		RestClient::Response r = RestClient::get(url);
+		LOGD("获得设备信息. result = %s", r.body.c_str());
+		//解析json
+		Json::Reader reader;
+		Json::Value root;
+		if (reader.parse(r.body, root, false)){
+			string partName = root["part_display"].asString();
+			StoragePreferences::putString(STORE_PARTNAME,partName);
+			NavibarSetPartName(partName);
+			//设备
+			StoragePreferences::putInt(STORE_DEVICE_ID, root["id"].asInt());
+			StoragePreferences::putInt(STORE_DEVICE_TYPE, root["device_type"].asInt());
+
+			//SIP存储
+	//			StoragePreferences::putString(SIP_REG_DOMAIN, root["sip_ip"].asString());	// 应该去找配置文件里的sip-ip
+			StoragePreferences::putString(SIP_REG_ACCOUNT,root["sip_id"].asString());
+			StoragePreferences::putString(SIP_REG_PASSWORD, root["sip_password"].asString());
+
+			frameInfo["frame_id"] = root["frame_id"].asInt();
+			frameInfo["full_name"] = root["full_name"].asString();
+			frameInfo["part_id"] = root["part_id"].asInt();
+			getFrameInfo();
+
+			//获取科室设置
+			string partId = root["part_id"].asString();
+			StoragePreferences::putString(STORE_PARTID, partId);
+			getPartSetting(partId);
+			getVersion();
+			getNfcInteraction();
+		}
 	}
-	mInBedNumTextViewPtr->setText(inBedCount);
-	mEmptyBedNumTextViewPtr->setText(emptyBedCount);
-}
 
-static void getFrameRoom(int frame_id) {
-	string url = getHttpGateway() + "/deviceRoom/get_frame_room/" + to_string(frame_id);
-	LOGD("请求房间信息. url = %s", url.c_str());
-	//发起HTTP GET请求
-	RestClient::Response r = RestClient::get(url);
-	LOGD("获得房间信息. result = %s", r.body.c_str());
-	//解析json
-	Json::Reader reader;
-	Json::Value root;
-	if (reader.parse(r.body, root, false)){
-		frameRoom = root;
-		frameBedList = root["frame_bed_list"];
-
-		inBedCount = 0;
-		emptyBedCount = 0;
-		if (frameBedList.size() > 0) {
-			for (int i = 0; i < frameBedList.size(); i++) {
-				string customerId = frameBedList[i]["customer_id"].asString();
-				if (customerId != "") {
-					inBedCount += 1;
+	static void getFrameRoom(int frame_id) {
+		string url = getHttpGateway() + "/deviceRoom/get_frame_room/" + to_string(frame_id);
+		LOGD("请求房间信息. url = %s", url.c_str());
+		//发起HTTP GET请求
+		RestClient::Response r = RestClient::get(url);
+		LOGD("获得房间信息. result = %s", r.body.c_str());
+		//解析json
+		Json::Reader reader;
+		Json::Value root;
+		if (reader.parse(r.body, root, false)){
+			frameRoom = root;
+			frameBedList = root["frame_bed_list"];
+
+			inBedCount = 0;
+			emptyBedCount = 0;
+			if (frameBedList.size() > 0) {
+				for (int i = 0; i < frameBedList.size(); i++) {
+					string customerId = frameBedList[i]["customer_id"].asString();
+					if (customerId != "") {
+						inBedCount += 1;
+					}
 				}
+				emptyBedCount = frameBedList.size() - inBedCount;
+				getBedCount();
+			}
+
+			if (mBedListViewPtr != NULL) {
+				mBedListViewPtr->refreshListView();
 			}
-			emptyBedCount = frameBedList.size() - inBedCount;
-			getBedCount();
 		}
+	}
 
-		if (mBedListViewPtr != NULL) {
-			mBedListViewPtr->refreshListView();
+	// 读取空间缓存的数据
+	static void getFrameInfo() {
+		mRoomNameTextViewPtr->setText(frameInfo["full_name"].asString());
+	}
+
+	static void getBedCount() {
+		if (mActivityPtr == NULL) {
+			return;
 		}
+		mInBedNumTextViewPtr->setText(inBedCount);
+		mEmptyBedNumTextViewPtr->setText(emptyBedCount);
 	}
-}
 
+	// 将医生和护士别称缓存起来
+	static void setRightTitle(Json::Value partSetting) {
+		rightTitleInfo["doctor_title"] = partSetting["doctor_title"].asString();
+		rightTitleInfo["doctor_valid"] = partSetting["doctor_valid"].asInt();
+		rightTitleInfo["nurse_title"] = partSetting["nurse_title"].asString();
+		rightTitleInfo["nurse_valid"] = partSetting["nurse_valid"].asInt();
+	}
 
-// 将医生和护士别称缓存起来
-static void setRightTitle(Json::Value partSetting) {
-	rightTitleInfo["doctor_title"] = partSetting["doctor_title"].asString();
-	rightTitleInfo["doctor_valid"] = partSetting["doctor_valid"].asInt();
-	rightTitleInfo["nurse_title"] = partSetting["nurse_title"].asString();
-	rightTitleInfo["nurse_valid"] = partSetting["nurse_valid"].asInt();
-}
 
 
+	static void getPartSetting(string partId){
+		string url = getHttpGateway() + "/deviceBed/getPartSetting/" + partId;
+		LOGD("请求科室信息. url = %s", url.c_str());
+		//发起HTTP GET请求
+		RestClient::Response r = RestClient::get(url);
+		LOGD("获得科室信息. result = %s", r.body.c_str());
+		//解析json
+		Json::Reader reader;
+		Json::Value root;
+		if (reader.parse(r.body, root, false)){
+			partSetting.partId = root["part_id"].asInt();
+			partSetting.dayStart = root["day_start"].asString();
+			partSetting.dayLight = root["day_light"].asInt();
+			partSetting.dayVol = root["day_vol"].asInt();
+			partSetting.dayRingVol = root["day_ring_vol"].asInt();
+			partSetting.dayRingTimes = root["day_ring_times"].asInt();
+			partSetting.dayNurseLed = root["day_nurse_led"].asInt();
+			partSetting.dayDoorVol = root["day_door_vol"].asInt();
+			partSetting.dayBedVol = root["day_bed_vol"].asInt();
+			partSetting.dayTransferBoxVol = root["day_transfer_box_vol"].asInt();
+			partSetting.dayTransferBoxSystemVol = root["day_transfer_box_system_vol"].asInt();
+			partSetting.nightStart = root["night_start"].asString();
+			partSetting.nightLight = root["night_light"].asInt();
+			partSetting.nightVol = root["night_vol"].asInt();
+			partSetting.nightRingVol = root["night_ring_vol"].asInt();
+			partSetting.nightRingTimes = root["night_ring_times"].asInt();
+			partSetting.nightNurseLed = root["night_nurse_led"].asInt();
+			partSetting.nightDoorVol = root["night_door_vol"].asInt();
+			partSetting.nightBedVol = root["night_bed_vol"].asInt();
+			partSetting.nightTransferBoxVol = root["night_transfer_box_vol"].asInt();
+			partSetting.nightTransferBoxSystemVol = root["night_transfer_box_system_vol"].asInt();
+			partSetting.sleepSecondsNurse = root["sleep_seconds_nurse"].asInt();
+			partSetting.sleepSecondsDoor = root["sleep_seconds_door"].asInt();
+			partSetting.sleepSecondsBed = root["sleep_seconds_bed"].asInt();
+			partSetting.sipOvertime = root["sip_overtime"].asInt();
+			partSetting.transferDuration = root["transfer_duration"].asInt();
+			partSetting.transferDurationLeader = root["transfer_duration_leader"].asInt();
+			partSetting.communicationModeBed = root["communication_mode_bed"].asInt();
+			partSetting.communicationModeNurse = root["communication_mode_nurse"].asInt();
+			partSetting.communicationModeMobile = root["communication_model_mobile"].asInt();
+			partSetting.customizeRoleCallFirst = root["customize_role_call_first"].asInt();
+			partSetting.customizeRoleCallSecond = root["customize_role_call_second"].asInt();
+			partSetting.customizeRoleCallThird = root["customize_role_call_third"].asInt();
+			partSetting.customizeRoleCallFourth = root["customize_role_call_fourth"].asInt();
+			partSetting.customizeRoleCallFifth = root["customize_role_call_fifth"].asInt();
+			partSetting.customizeHospitalCallFirst = root["customize_hospital_call_first"].asInt();
+			partSetting.customizeHospitalCallFirstName = root["customize_hospital_call_first_name"].asString();
+			partSetting.customizeHospitalCallSecond = root["customize_hospital_call_second"].asInt();
+			partSetting.customizeHospitalCallSecondName = root["customize_hospital_second_name"].asString();
+			partSetting.customizeHospitalCallThird = root["customize_hospital_call_third"].asInt();
+			partSetting.customizeHospitalCallThirdName = root["customize_hospital_call_third_name"].asString();
+			partSetting.doctorTitle = root["doctor_title"].asString();
+			partSetting.doctorValid = root["doctor_valid"].asInt();
+			partSetting.nurseTitle = root["nurse_title"].asString();
+			partSetting.nurseValid = root["nurse_valid"].asInt();
+			partSetting.doorNurseTitle = root["door_nurse_title"].asString();
+			partSetting.doorNurseValid = root["door_nurse_valid"].asInt();
+			partSetting.doorNursingTitle = root["door_nursing_title"].asString();
+			partSetting.doorNursingValid = root["door_nursing_valid"].asInt();
+			partSetting.upSeconds = root["up_seconds"].asInt();
+			partSetting.autoAccept = root["auto_accept"].asInt();
+			partSetting.eventForward = root["event_forward"].asInt();
+			partSetting.nursingColorRgb = root["nursing_color_rgb"].asString();
+			partSetting.twoColorDoorLightValid = root["two_color_door_light_valid"].asInt();
+			partSetting.qrUrl = root["qr_url"].asString();
+			partSetting.screenLight = root["screen_light"].asInt();
+			partSetting.roomCallBed = root["room_call_bed"].asInt();
+			partSetting.autoPosition = root["auto_position"].asInt();
+	        partSetting.customerAgeHiddenOnDoor = root["customer_age_hidden_on_door"].asInt();
+
+			if (root.isMember("linux_bed_volume_native")) {
+				partSetting.linuxDoorVolumeNative = root["linux_door_volume_native"].asInt();
+				partSetting.linuxDoorGainSize = root["linux_door_gain_size"].asInt();
+
+				zk_audio_input_set_volume_native(0, 0);
+				zk_audio_input_set_volume_native(1, partSetting.linuxDoorVolumeNative);
+				GetTelephone()->SetInputPcmGainSize(partSetting.linuxDoorGainSize);
+
+				StoragePreferences::putInt(STORE_VOLUME_NATIVE, partSetting.linuxDoorVolumeNative);
+				StoragePreferences::putInt(STORE_GAIN_SIZE, partSetting.linuxDoorGainSize);
+			}
 
-static void getPartSetting(string partId){
-	string url = getHttpGateway() + "/deviceBed/getPartSetting/" + partId;
-	LOGD("请求科室信息. url = %s", url.c_str());
-	//发起HTTP GET请求
-	RestClient::Response r = RestClient::get(url);
-	LOGD("获得科室信息. result = %s", r.body.c_str());
-	//解析json
-	Json::Reader reader;
-	Json::Value root;
-	if (reader.parse(r.body, root, false)){
-		partSetting.partId = root["part_id"].asInt();
-		partSetting.dayStart = root["day_start"].asString();
-		partSetting.dayLight = root["day_light"].asInt();
-		partSetting.dayVol = root["day_vol"].asInt();
-		partSetting.dayRingVol = root["day_ring_vol"].asInt();
-		partSetting.dayRingTimes = root["day_ring_times"].asInt();
-		partSetting.dayNurseLed = root["day_nurse_led"].asInt();
-		partSetting.dayDoorVol = root["day_door_vol"].asInt();
-		partSetting.dayBedVol = root["day_bed_vol"].asInt();
-		partSetting.dayTransferBoxVol = root["day_transfer_box_vol"].asInt();
-		partSetting.dayTransferBoxSystemVol = root["day_transfer_box_system_vol"].asInt();
-		partSetting.nightStart = root["night_start"].asString();
-		partSetting.nightLight = root["night_light"].asInt();
-		partSetting.nightVol = root["night_vol"].asInt();
-		partSetting.nightRingVol = root["night_ring_vol"].asInt();
-		partSetting.nightRingTimes = root["night_ring_times"].asInt();
-		partSetting.nightNurseLed = root["night_nurse_led"].asInt();
-		partSetting.nightDoorVol = root["night_door_vol"].asInt();
-		partSetting.nightBedVol = root["night_bed_vol"].asInt();
-		partSetting.nightTransferBoxVol = root["night_transfer_box_vol"].asInt();
-		partSetting.nightTransferBoxSystemVol = root["night_transfer_box_system_vol"].asInt();
-		partSetting.sleepSecondsNurse = root["sleep_seconds_nurse"].asInt();
-		partSetting.sleepSecondsDoor = root["sleep_seconds_door"].asInt();
-		partSetting.sleepSecondsBed = root["sleep_seconds_bed"].asInt();
-		partSetting.sipOvertime = root["sip_overtime"].asInt();
-		partSetting.transferDuration = root["transfer_duration"].asInt();
-		partSetting.transferDurationLeader = root["transfer_duration_leader"].asInt();
-		partSetting.communicationModeBed = root["communication_mode_bed"].asInt();
-		partSetting.communicationModeNurse = root["communication_mode_nurse"].asInt();
-		partSetting.communicationModeMobile = root["communication_model_mobile"].asInt();
-		partSetting.customizeRoleCallFirst = root["customize_role_call_first"].asInt();
-		partSetting.customizeRoleCallSecond = root["customize_role_call_second"].asInt();
-		partSetting.customizeRoleCallThird = root["customize_role_call_third"].asInt();
-		partSetting.customizeRoleCallFourth = root["customize_role_call_fourth"].asInt();
-		partSetting.customizeRoleCallFifth = root["customize_role_call_fifth"].asInt();
-		partSetting.customizeHospitalCallFirst = root["customize_hospital_call_first"].asInt();
-		partSetting.customizeHospitalCallFirstName = root["customize_hospital_call_first_name"].asString();
-		partSetting.customizeHospitalCallSecond = root["customize_hospital_call_second"].asInt();
-		partSetting.customizeHospitalCallSecondName = root["customize_hospital_second_name"].asString();
-		partSetting.customizeHospitalCallThird = root["customize_hospital_call_third"].asInt();
-		partSetting.customizeHospitalCallThirdName = root["customize_hospital_call_third_name"].asString();
-		partSetting.doctorTitle = root["doctor_title"].asString();
-		partSetting.doctorValid = root["doctor_valid"].asInt();
-		partSetting.nurseTitle = root["nurse_title"].asString();
-		partSetting.nurseValid = root["nurse_valid"].asInt();
-		partSetting.doorNurseTitle = root["door_nurse_title"].asString();
-		partSetting.doorNurseValid = root["door_nurse_valid"].asInt();
-		partSetting.doorNursingTitle = root["door_nursing_title"].asString();
-		partSetting.doorNursingValid = root["door_nursing_valid"].asInt();
-		partSetting.upSeconds = root["up_seconds"].asInt();
-		partSetting.autoAccept = root["auto_accept"].asInt();
-		partSetting.eventForward = root["event_forward"].asInt();
-		partSetting.nursingColorRgb = root["nursing_color_rgb"].asString();
-		partSetting.twoColorDoorLightValid = root["two_color_door_light_valid"].asInt();
-		partSetting.qrUrl = root["qr_url"].asString();
-		partSetting.screenLight = root["screen_light"].asInt();
-		partSetting.roomCallBed = root["room_call_bed"].asInt();
-		partSetting.autoPosition = root["auto_position"].asInt();
-        partSetting.customerAgeHiddenOnDoor = root["customer_age_hidden_on_door"].asInt();
-
-		if (root.isMember("linux_bed_volume_native")) {
-			partSetting.linuxDoorVolumeNative = root["linux_door_volume_native"].asInt();
-			partSetting.linuxDoorGainSize = root["linux_door_gain_size"].asInt();
-
-			zk_audio_input_set_volume_native(0, 0);
-			zk_audio_input_set_volume_native(1, partSetting.linuxDoorVolumeNative);
-			GetTelephone()->SetInputPcmGainSize(partSetting.linuxDoorGainSize);
-
-			StoragePreferences::putInt(STORE_VOLUME_NATIVE, partSetting.linuxDoorVolumeNative);
-			StoragePreferences::putInt(STORE_GAIN_SIZE, partSetting.linuxDoorGainSize);
-		}
-
-		StoragePreferences::putString(STORE_DAY_START, partSetting.dayStart);
-		StoragePreferences::putInt(STORE_DAY_LIGHT,partSetting.dayLight);
-		StoragePreferences::putInt(STORE_DAY_VOL,partSetting.dayBedVol);
-		StoragePreferences::putInt(STORE_DAY_RING_TIMES,partSetting.dayRingTimes);
-
-		StoragePreferences::putString(STORE_NIGHT_START, partSetting.nightStart);
-		StoragePreferences::putInt(STORE_NIGHT_LIGHT,partSetting.nightLight);
-		StoragePreferences::putInt(STORE_NIGHT_VOL,partSetting.nightBedVol);
-		StoragePreferences::putInt(STORE_NIGHT_RING_TIMES,partSetting.nightRingTimes);
-
-		StoragePreferences::putInt(STORE_SLEEP_TIME, partSetting.sleepSecondsDoor);
-
-		StoragePreferences::putString(STORE_DOCTOR_TITLE, partSetting.doctorTitle);
-		StoragePreferences::putBool(STORE_DOCTOR_VISIBLE, partSetting.doctorValid==1);
-		StoragePreferences::putString(STORE_NURSE_TITLE, partSetting.nurseTitle);
-		StoragePreferences::putBool(STORE_NURSE_VISIBLE, partSetting.nurseValid==1);
-
-		StoragePreferences::putString(STORE_NURSING_COLOR_RGB, partSetting.nursingColorRgb);
-		StoragePreferences::putBool(STORE_AUDO_ANSWER, partSetting.autoAccept==1);
-		StoragePreferences::putInt(STORE_SCREEN_LIGHT, partSetting.screenLight);
-		StoragePreferences::putInt(STORE_ROOM_CALL_BED, partSetting.roomCallBed);
-		StoragePreferences::putInt(STORE_AUTO_POSITION, partSetting.autoPosition);
-
-		setRightTitle(root);
-		callBedButtonSetVisible();
-
-		getFrameRoom(frameInfo["frame_id"].asInt());
-
-		dataInit = true;
-	}
-}
+			StoragePreferences::putString(STORE_DAY_START, partSetting.dayStart);
+			StoragePreferences::putInt(STORE_DAY_LIGHT,partSetting.dayLight);
+			StoragePreferences::putInt(STORE_DAY_VOL,partSetting.dayBedVol);
+			StoragePreferences::putInt(STORE_DAY_RING_TIMES,partSetting.dayRingTimes);
 
-static void getVersion() {
-	std::string url = getHttpGateway() + "/deviceRoom/get_app_version?device_type=403&part_id=" + StoragePreferences::getString(STORE_PARTID, "");
-	std::string content_type = std::string("application/json");
+			StoragePreferences::putString(STORE_NIGHT_START, partSetting.nightStart);
+			StoragePreferences::putInt(STORE_NIGHT_LIGHT,partSetting.nightLight);
+			StoragePreferences::putInt(STORE_NIGHT_VOL,partSetting.nightBedVol);
+			StoragePreferences::putInt(STORE_NIGHT_RING_TIMES,partSetting.nightRingTimes);
 
-	LOGD("请求版本信息. url = %s", url.c_str());
-	//发起HTTP POST请求
-	RestClient::Response r = RestClient::post(url, content_type, "");
-	if (r.code != 200) {
-		LOGD("请求版本信息-> 错误代码: %d", r.code);
-		return;
-	}
+			StoragePreferences::putInt(STORE_SLEEP_TIME, partSetting.sleepSecondsDoor);
+
+			StoragePreferences::putString(STORE_DOCTOR_TITLE, partSetting.doctorTitle);
+			StoragePreferences::putBool(STORE_DOCTOR_VISIBLE, partSetting.doctorValid==1);
+			StoragePreferences::putString(STORE_NURSE_TITLE, partSetting.nurseTitle);
+			StoragePreferences::putBool(STORE_NURSE_VISIBLE, partSetting.nurseValid==1);
+
+			StoragePreferences::putString(STORE_NURSING_COLOR_RGB, partSetting.nursingColorRgb);
+			StoragePreferences::putBool(STORE_AUDO_ANSWER, partSetting.autoAccept==1);
+			StoragePreferences::putInt(STORE_SCREEN_LIGHT, partSetting.screenLight);
+			StoragePreferences::putInt(STORE_ROOM_CALL_BED, partSetting.roomCallBed);
+			StoragePreferences::putInt(STORE_AUTO_POSITION, partSetting.autoPosition);
 
-	LOGD("获得版本信息. result = %s", r.body.c_str());
-	//解析json
-	Json::Reader reader;
-	Json::Value root;
+			setRightTitle(root);
+			callBedButtonSetVisible();
 
-	if(reader.parse(r.body, root, false)) {
-		int currentVersionNo = getVersionNo();
-		int responseVersionNo = root["version_no"].asInt();
-		std::string responseVersion = root["version_code"].asString();
-		LOGD("服务器版本 : %s %d, 当前设备版本: %d", responseVersion.c_str(), responseVersionNo, currentVersionNo);
+			getFrameRoom(frameInfo["frame_id"].asInt());
 
-		if (currentVersionNo < responseVersionNo) {
-			Intent* intent = new Intent();
-			intent->putExtra(appUpdate, "true");
-			EASYUICONTEXT->openActivity("updateActivity", intent);
+			dataInit = true;
 		}
 	}
-}
 
-static void getNfcInteraction() {
-	std::string url = getHttpGateway() + "/deviceRoom/get_nfc_interaction_end_time_is_null/" + to_string(StoragePreferences::getInt(STORE_DEVICE_ID,0));
+	static void getVersion() {
+		std::string url = getHttpGateway() + "/deviceRoom/get_app_version?device_type=403&part_id=" + StoragePreferences::getString(STORE_PARTID, "");
+		std::string content_type = std::string("application/json");
 
-	LOGD("请求未完成的nfc记录. url = %s", url.c_str());
-	//发起HTTP POST请求
-	RestClient::Response r = RestClient::get(url);
-	if (r.code != 200) {
-		LOGD("请求未完成的nfc记录-> 错误代码: %d", r.code);
-		return;
-	}
+		LOGD("请求版本信息. url = %s", url.c_str());
+		//发起HTTP POST请求
+		RestClient::Response r = RestClient::post(url, content_type, "");
+		if (r.code != 200) {
+			LOGD("请求版本信息-> 错误代码: %d", r.code);
+			return;
+		}
 
-	LOGD("获得未完成的nfc记录. result = %s", r.body.c_str());
-	//解析json
-	Json::Reader reader;
-	Json::Value root;
-
-	if(reader.parse(r.body, root, false)) {
-		int clerkId = 0;
-		for (int i = 0; i < root.size(); i++) {
-			if (root[i]["components_type"].asCString() == TcpType::AUTH) {
-				clerkId = root[i]["clerk_id"].asInt();
-				setClerk(root[i]["clerk_name"].asCString(), root[i]["pass_no"].asCString(), root[i]["id"].asInt());
-			}
-			else if (root[i]["components_type"].asString() == "POSITION_COMPONENT") {
-				setPosistionItId(root[i]["id"].asInt());
-				setPositionButton(true);
+		LOGD("获得版本信息. result = %s", r.body.c_str());
+		//解析json
+		Json::Reader reader;
+		Json::Value root;
+
+		if(reader.parse(r.body, root, false)) {
+			int currentVersionNo = getVersionNo();
+			int responseVersionNo = root["version_no"].asInt();
+			std::string responseVersion = root["version_code"].asString();
+			LOGD("服务器版本 : %s %d, 当前设备版本: %d", responseVersion.c_str(), responseVersionNo, currentVersionNo);
+
+			if (currentVersionNo < responseVersionNo) {
+				Intent* intent = new Intent();
+				intent->putExtra(appUpdate, "true");
+				EASYUICONTEXT->openActivity("updateActivity", intent);
 			}
-			else if (root[i]["components_type"].asString() == "ROOMCHECK_COMPONENT") {
-				setRoomCheckItId(root[i]["id"].asInt());
-				setRoomPatrolButton(true);
-			}
-			else if (root[i]["components_type"].asString() == "SCREEN_TIP_SET_COMPONENT") {
-				time_t now = TimeHelper::getDateline();
-				if (now <= 0) {
-					continue;
-				}
+		}
+	}
 
-				Json::Reader Reader;
-				Json::Value operationData;
-				Reader.parse(root[i]["operation_data"].asString(), operationData);
-				int seconds = operationData["seconds"].asInt();
+	static void getNfcInteraction() {
+		std::string url = getHttpGateway() + "/deviceRoom/get_nfc_interaction_end_time_is_null/" + to_string(StoragePreferences::getInt(STORE_DEVICE_ID,0));
 
-				if (now - root[i]["start_time"].asInt() < seconds) {
-					setPromptTimeItId(root[i]["id"].asInt());
+		LOGD("请求未完成的nfc记录. url = %s", url.c_str());
+		//发起HTTP POST请求
+		RestClient::Response r = RestClient::get(url);
+		if (r.code != 200) {
+			LOGD("请求未完成的nfc记录-> 错误代码: %d", r.code);
+			return;
+		}
 
-					Intent* intent = new Intent();
-					intent->putExtra(promptText2, operationData["tips"].asString());
-					intent->putExtra(promptTime2, to_string(seconds - (now - root[i]["start_time"].asInt())));
-					EASYUICONTEXT->openActivity("promptActivity", intent);
+		LOGD("获得未完成的nfc记录. result = %s", r.body.c_str());
+		//解析json
+		Json::Reader reader;
+		Json::Value root;
+
+		if(reader.parse(r.body, root, false)) {
+			int clerkId = 0;
+			for (int i = 0; i < root.size(); i++) {
+				if (root[i]["components_type"].asCString() == TcpType::AUTH) {
+					clerkId = root[i]["clerk_id"].asInt();
+					setClerk(root[i]["clerk_name"].asCString(), root[i]["pass_no"].asCString(), root[i]["id"].asInt());
 				}
-				else {
-					sendPromptQuit(root[i]["id"].asInt());
+				else if (root[i]["components_type"].asString() == "POSITION_COMPONENT") {
+					setPosistionItId(root[i]["id"].asInt());
+					setPositionButton(true);
+				}
+				else if (root[i]["components_type"].asString() == "ROOMCHECK_COMPONENT") {
+					setRoomCheckItId(root[i]["id"].asInt());
+					setRoomPatrolButton(true);
+				}
+				else if (root[i]["components_type"].asString() == "SCREEN_TIP_SET_COMPONENT") {
+					time_t now = TimeHelper::getDateline();
+					if (now <= 0) {
+						continue;
+					}
+
+					Json::Reader Reader;
+					Json::Value operationData;
+					Reader.parse(root[i]["operation_data"].asString(), operationData);
+					int seconds = operationData["seconds"].asInt();
+
+					if (now - root[i]["start_time"].asInt() < seconds) {
+						setPromptTimeItId(root[i]["id"].asInt());
+
+						Intent* intent = new Intent();
+						intent->putExtra(promptText2, operationData["tips"].asString());
+						intent->putExtra(promptTime2, to_string(seconds - (now - root[i]["start_time"].asInt())));
+						EASYUICONTEXT->openActivity("promptActivity", intent);
+					}
+					else {
+						sendPromptQuit(root[i]["id"].asInt());
+					}
 				}
 			}
-		}
-		if (clerkId != 0) {
-			goCare();
+			if (clerkId != 0) {
+				goCare();
+			}
 		}
 	}
-}
 
-static void getDeviceInfo(){
-	if (dataInit){
-		getFrameInfo();
-		getBedCount();
-		return;
+	/**
+	 * 线程创建成功后会调用该函数,可以在该函数中做一些初始化操作
+	 * return true   继续线程
+	 *        false  退出线程
+	 */
+	virtual bool readyToRun() {
+		LOGD("Thread 已经创建完成");
+		return true;
 	}
-	string url = getHttpGateway() + "/deviceRoom/get_device_by_eth_mac/" + StoragePreferences::getString(STORE_MAC_ADDR, "0.0.0.0");
-	LOGD("请求设备信息. url = %s", url.c_str());
-	//发起HTTP GET请求
-	RestClient::Response r = RestClient::get(url);
-	LOGD("获得设备信息. result = %s", r.body.c_str());
-	//解析json
-	Json::Reader reader;
-	Json::Value root;
-	if (reader.parse(r.body, root, false)){
-		string partName = root["part_display"].asString();
-		StoragePreferences::putString(STORE_PARTNAME,partName);
-		NavibarSetPartName(partName);
-		//设备
-		StoragePreferences::putInt(STORE_DEVICE_ID, root["id"].asInt());
-		StoragePreferences::putInt(STORE_DEVICE_TYPE, root["device_type"].asInt());
-
-		//SIP存储
-//			StoragePreferences::putString(SIP_REG_DOMAIN, root["sip_ip"].asString());	// 应该去找配置文件里的sip-ip
-		StoragePreferences::putString(SIP_REG_ACCOUNT,root["sip_id"].asString());
-		StoragePreferences::putString(SIP_REG_PASSWORD, root["sip_password"].asString());
-
-		frameInfo["frame_id"] = root["frame_id"].asInt();
-		frameInfo["full_name"] = root["full_name"].asString();
-		frameInfo["part_id"] = root["part_id"].asInt();
-		getFrameInfo();
-
-		//获取科室设置
-		string partId = root["part_id"].asString();
-		StoragePreferences::putString(STORE_PARTID, partId);
-		getPartSetting(partId);
-		getVersion();
-		getNfcInteraction();
+
+	/**
+	 * 线程循环函数
+	 *
+	 * return true  继续线程循环
+	 *        false 推出线程
+	 */
+	virtual bool threadLoop() {
+		LOGD("线程循环函数");
+
+		//检查是否有退出线程的请求,如果有,则返回false,立即退出线程
+		if (exitPending()) {
+			return false;
+		}
+
+		udpConn = net::Dial("udp", "192.168.1.255:10010");
+		if (udpConn) {
+			byte buf[1024] = {0};
+			const char* req = "search_server";
+			//发送
+			udpConn->Write((byte*)req, strlen(req));
+			while (true && !exitPending()) {
+				//读取,超时10*1000毫秒
+				int n = udpConn->Read(buf, sizeof(buf) - 1, 10*1000);
+				if (n > 0) {
+					buf[n] = 0;
+					char serverStr[1024];
+					sprintf(serverStr,"%s",buf);
+					LOGD("读取 %d字节: %s", n, serverStr);
+
+					//解析json
+					Json::Reader reader;
+					Json::Value root;
+					if (reader.parse(serverStr, root, false)){
+						if (root.isMember("success") && root["success"].asBool()){
+							serverIP = root["data"]["third_server"].asString();
+							serverHttpPort = root["data"]["third_server_port"].asInt();
+
+							StoragePreferences::putString(STORE_GATEWAY, serverIP);
+							StoragePreferences::putInt(STORE_HTTP_PORT, serverHttpPort);
+
+							//先获取服务器信息
+							//getServerInfo();
+							//就当在获取服务器信息完成后获取用户信息,这里测试用
+							//getCustomerInfo();
+							//退出UDP线程
+							pthread_exit(NULL);
+							break;
+						}
+					}
+				} else if (n == 0) {
+					LOGD("连接正常断开");
+					break;
+				} else if (n == net::E_TIMEOUT) {
+					udpConn->Write((byte*)req, strlen(req));
+					LOGD("读取超时");
+				} else {
+					LOGD("出错");
+					break;
+				}
+			}
+			//关闭连接
+			udpConn->Close();
+			//释放内存
+			delete udpConn;
+			udpConn = NULL;
+		}
+
+		//返回真,继续下次线程循环
+		return true;
 	}
-}
+};
+
+static UdpThread udp_thread;
+
+
 
 Json::Value getFrame() {
 	return frameRoom;
@@ -458,15 +549,15 @@ void dataRefresh() {
 	}
 
 	if (serverInfo) {
-		getServerInfo();
+		udp_thread.getServerInfo();
 	}
 	dataInit = false;
-	getDeviceInfo();
+	udp_thread.getDeviceInfo();
 	mBedListViewPtr->refreshListView();
 }
 
 void getPartSetting() {
-	getPartSetting(StoragePreferences::getString(STORE_PARTID, ""));
+	udp_thread.getPartSetting(StoragePreferences::getString(STORE_PARTID, ""));
 }
 
 
@@ -487,12 +578,10 @@ static void onUI_init(){
 	//run("this is thread name");
 	//测试用
 	LOGD("进入mainLogic页面, 触发 onUI_init");
-	if (ETHERNETMANAGER->isConnected() || WIFIMANAGER->isConnected()) {
-		if(serverInfo) {	// 如果是false,就是不需要
-			getServerInfo();
-		}
-		getDeviceInfo();
-	}
+    if(serverInfo && isConnectServer()) {    // 如果是false,就是不需要
+        udp_thread.getServerInfo();
+    }
+    udp_thread.getDeviceInfo();
 
 }
 

+ 18 - 9
jni/logic/startLogic.cc

@@ -26,6 +26,8 @@ static bool isNursing = false;	// 用于启动时判断是否处于护理状态
 static bool isNetreset = false;
 static int netresetInt = 0;
 static string callTid = "";
+Json::Value sosInteraction;
+
 #define FUNCTION_TIMER_HANDLE 3	// 增援的定时器id
 #define SOS_CLICK_TIME_HANDLE 4	// sos的定时器id
 #define SOS_LAMP_TIME_HANDLE 5	// sos的门灯定时器id
@@ -215,14 +217,6 @@ void lightControl(std::string typeStr, std::string lightColorStr) {
 
 // 接收tcp消息
 void handleMsg(byte* inBytes){
-	LOGD("TCP received: %s", inBytes);
-	const char* cstr = reinterpret_cast<const char*>(inBytes);
-	string str = cstr;
-	if (str == "1"){
-		LOGD("get a heart beat");
-		return;
-	}
-
 	TcpModel tcpModel;
 	tcpModel = getTcpModel(inBytes);
 	LOGD("tcp model: %s, %s", tcpModel.type.c_str(), tcpModel.action.c_str());
@@ -450,6 +444,9 @@ void handleMsg(byte* inBytes){
 			mActivityPtr->registerUserTimer(SOS_CLICK_TIME_HANDLE, 10000);		// 10秒后才能触发
 			mActivityPtr->registerUserTimer(SOS_LAMP_TIME_HANDLE, 120000);		// 2分钟后才能触发
 
+			if (tcpModel.json["fromEthMac"].asString() == StoragePreferences::getString(STORE_MAC_ADDR, "0.0.0.0")) {
+                sosInteraction = tcpModel.json;
+            }
 		}
 		else if (tcpModel.action == SideAction::SOS_CANCEL) {
 			// 进行门灯还原
@@ -700,7 +697,6 @@ static void onUI_init(){
 	//TCP启动
 	TcpClient::instance()->startTcp();
 	//监听SIP信令
-//	GetTelephone()->AddCallStateListener(OnCallStateChanged);
     addSipCallStateListener();
 
 	//开启网页
@@ -900,6 +896,10 @@ static void onProtocolDataUpdate(const SProtocolData &data) {
 
 					mActivityPtr->registerUserTimer(SOS_CLICK_TIME_HANDLE, 10000);		// 10秒后才能触发
 					mActivityPtr->registerUserTimer(SOS_LAMP_TIME_HANDLE, 120000);		// 2分钟后才能触发
+
+			        Intent* intent = new Intent();
+			        intent->putExtra(functionWindows, "sosCall");
+			        EASYUICONTEXT->openActivity("functionActivity", intent);
 				}
 			}
 
@@ -977,6 +977,15 @@ static void onProtocolDataUpdate(const SProtocolData &data) {
 //				heartStr = "DOORLED,111F";
 				lightControl("DOORLED", "111F");
 			}
+			else if (data.cmd == "KEY@") {
+				scrrenOn();
+			    LOGD("Trigger sos cancel");
+			    if (sosInteraction > 0 && sosInteraction.isMember("id")) {
+			        sendSosCancel(sosInteraction["id"].asString());
+
+			        sosInteraction = Json::Value();
+			    }
+			}
 			else {
 				if (isSleep) {
 					scrrenOn();

+ 16 - 5
jni/logic/statusbar.cc

@@ -43,6 +43,9 @@
  *mDashbroadView1->setTargetAngle(120) 在控件mDashbroadView1上指针显示角度调整到120度
 
  */
+#define ETHERNETMANAGER		NETMANAGER->getEthernetManager()
+#define WIFIMANAGER			NETMANAGER->getWifiManager()
+
 
 static bool networkConnect = false;
 static bool networkNowConnect = false;
@@ -51,6 +54,17 @@ static bool tcpNowConnect = false;
 static bool sipConnect = true;
 static bool sipNowConnect = false;
 
+
+bool isConnectServer() {
+    if (ETHERNETMANAGER->isConnected() || WIFIMANAGER->isConnected()) {
+        if (tcpConnect) {
+            return true;
+        }
+    }
+    return false;
+}
+
+
 void statusLight() {
     if (!networkConnect) {
         lightControl("CALLLED", "200F");
@@ -71,9 +85,6 @@ void statusLight() {
 }
 
 
-#define ETHERNETMANAGER		NETMANAGER->getEthernetManager()
-#define WIFIMANAGER			NETMANAGER->getWifiManager()
-
 #define SYS_RESTART 10	// 重启
 
 static bool isLight = false;
@@ -189,7 +200,7 @@ static void updateNetState(){
 		mRestartTimeTextViewPtr->setText(restartTimeStr);
 	}
 
-	if (ETHERNETMANAGER->isConnected() || WIFIMANAGER->isConnected()){
+	if (isConnectServer()){
 		netOffCount = 0;
 		if (isDataRefresh) {
 			dataRefresh();
@@ -326,7 +337,7 @@ void addSipRegisterStateListener() {
 
 
 void tcpStatus(){
-	if (TcpClient::instance()->connected()){
+	if (TcpClient::instance()->isConnect()){
 		mTextViewTCPPtr->setBackgroundColor(0xFF37C127);
 		tcpConnect = true;
         if (tcpNowConnect != tcpConnect) {

+ 28 - 1
jni/net/tcp_client.cpp

@@ -37,6 +37,8 @@ TcpClient* TcpClient::instance() {
 }
 
 static net::Conn* conn;
+static bool isTcpConnect = false;
+static int heartbeatTime = 0;
 
 void TcpClient::sendMsg(const char* msg){
 	instance()->internalSendMsg(msg);
@@ -123,15 +125,35 @@ public:
 			while (true && !exitPending()) {
 				//读取,超时1000毫秒
 				int n = conn->Read(buf, sizeof(buf) - 1, 1000);
+
+                heartbeatTime += 1;
+                if (heartbeatTime >= 90) {
+                    isTcpConnect = false;
+                    heartbeatTime = 0;
+                    LOGD("心跳超时断开");
+                    break;
+                }
 				if (n > 0) {
-					buf[n] = 0;
+                    isTcpConnect = true;
+                    buf[n] = 0;
+
+                    LOGD("TCP received: %s", buf);
+                    const char* cstr = reinterpret_cast<const char*>(buf);
+                    std::string str = cstr;
+                    if (str == "1"){
+                        heartbeatTime = 0;
+                        LOGD("get a heart beat");
+                        continue;
+                    }
 					handleMsg(buf);
 				} else if (n == 0) {
+                    isTcpConnect = false;
 					LOGD("连接正常断开");
 					break;
 				} else if (n == net::E_TIMEOUT) {
 //					LOGD("读取超时");
 				} else {
+                    isTcpConnect = false;
 					LOGD("出错");
 					break;
 				}
@@ -174,4 +196,9 @@ bool TcpClient::connected() {
 	return conn != NULL;
 }
 
+bool TcpClient::isConnect() {
+    return isTcpConnect;
+}
+
+
 

+ 1 - 0
jni/net/tcp_client.h

@@ -26,6 +26,7 @@ public:
   void sendMsgWithCb(const char* msg, TcpCallback callback);
 
   static bool connected();
+  static bool isConnect();
   static bool busy();
 private:
   TcpClient();

+ 1 - 1
jni/net/tcp_model.cpp

@@ -44,7 +44,7 @@ std::string getTcpModelString(TcpModel model){
 
 TcpModel getTcpModel(byte* inBytes){
 	//解析json
-	Json::Reader reader;
+	Json::Reader reader(Json::Features::strictMode());
 	Json::Value root;
 	TcpModel tcpModel;
 	const char* str = reinterpret_cast<const char*>(inBytes);

+ 4 - 2
jni/service/BusinessConfig.h

@@ -13,6 +13,7 @@
 #include <atomic>
 #include "net/tcp_client.h"
 #include "net/tcp_model.h"
+#include "net/tcp_util.h"
 #include <map>
 
 #ifndef JNI_SERVICE_BUSINESSCONFIG_H_
@@ -78,8 +79,8 @@ static uint32_t whiteColour = 0xFFFFFF;
 static int defaultThemeInt = 1;
 static int defaultModeInt = 1;
 
-static std::string versionCode = "v1.0.47";
-static int versionNo = 47;
+static std::string versionCode = "v1.0.49";
+static int versionNo = 49;
 static std::string serverIP = "172.28.100.100";
 static std::string tcpIP = "172.28.100.100";
 static int serverHttpPort = 8006;
@@ -193,6 +194,7 @@ void setClerk(std::string clerk_name, std::string pass_no, int _authItid);
 void goHome();
 
 void systemRestart();
+bool isConnectServer();
 
 enum CallFinishType {
 	CANCEL,

BIN
libs/armeabi/libzkgui.so


BIN
obj/activity/callActivity.o


BIN
obj/activity/deviceInfoActivity.o


BIN
obj/activity/functionActivity.o


BIN
obj/activity/mainActivity.o


BIN
obj/activity/medicalCareActivity.o


BIN
obj/activity/moreActivity.o


BIN
obj/activity/navibar.o


BIN
obj/activity/promptActivity.o


BIN
obj/activity/settingActivity.o


BIN
obj/activity/sipTestActivity.o


BIN
obj/activity/startActivity.o


BIN
obj/activity/statusbar.o


BIN
obj/activity/updateActivity.o


BIN
obj/core/update_assistant.o


BIN
obj/net/tcp_client.o


BIN
obj/net/tcp_model.o


BIN
obj/net/tcp_util.o


BIN
obj/server/http_server.o


BIN
obj/service/BusinessConfig.o


BIN
obj/service/time.o


BIN
obj/uart/UartContext.o


BIN
resources/Harmony_231030.ttf


BIN
resources/icon/sos.png


BIN
resources/sos4.MP3