From: snickersun Date: Wed, 14 Oct 2020 13:44:21 +0000 (+0800) Subject: release V656 X-Git-Url: http://git.snicker.com.cn/sitemap.xml?a=commitdiff_plain;h=fb1e21630aaf25973cb695ea9eab9fd15761295f;p=protocol_srv.git release V656 优化 dump alarm message --- diff --git a/app/app.iml b/app/app.iml index e442bebb..497b2ac8 100644 --- a/app/app.iml +++ b/app/app.iml @@ -29,15 +29,15 @@ - + + - - - + + diff --git a/app/release/ICSer_V650_2010141931_release.apk b/app/release/ICSer_V656_2010142127_release.apk similarity index 78% rename from app/release/ICSer_V650_2010141931_release.apk rename to app/release/ICSer_V656_2010142127_release.apk index 140eb821..e38d86a5 100644 Binary files a/app/release/ICSer_V650_2010141931_release.apk and b/app/release/ICSer_V656_2010142127_release.apk differ diff --git a/app/release/output.json b/app/release/output.json index aad11516..d749bf7c 100644 --- a/app/release/output.json +++ b/app/release/output.json @@ -1 +1 @@ -[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":650,"versionName":"2010141931","enabled":true,"outputFile":"ICSer_V650_2010141931_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V650_2010141931_release.apk","properties":{}}] \ No newline at end of file +[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":656,"versionName":"2010142127","enabled":true,"outputFile":"ICSer_V656_2010142127_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V656_2010142127_release.apk","properties":{}}] \ No newline at end of file diff --git a/app/src/main/java/com/enqualcomm/support/LocationClient.java b/app/src/main/java/com/enqualcomm/support/LocationClient.java index 736f2420..9eb2fb63 100644 --- a/app/src/main/java/com/enqualcomm/support/LocationClient.java +++ b/app/src/main/java/com/enqualcomm/support/LocationClient.java @@ -167,11 +167,15 @@ public class LocationClient { //只有上一次在区域内,这次出区域才需要报警 ICLogger.i("BT 不在区域内,且上次在区域内,报警!"); //如果需要报警定位,则强制进行sos定位,不能通过triggerSOS,因为函数中调用了BLEScan会造成循环调用 - startSOSLocation=true;//启动SOS定位,为了快速响应,只要wifi定位即可。 - forceLocation=1; - startLocationProcess(ICLocation.NORMAL_MOD); -// StringMessage AL_CMD = protocolAPIHelper.getWarningMSG(runtime); -// DeliverMessage(AL_CMD); + if (donotScanWiFi){ + StringMessage AL_CMD = protocolAPIHelper.getWarningMSG(runtime); + DeliverMessage(AL_CMD); + }else { + startSOSLocation = true;//启动SOS定位,为了快速响应,只要wifi定位即可。 + forceLocation = 1; + startLocationProcess(ICLocation.NORMAL_MOD); + } + } }else{ ICLogger.i("BT 在区域内!"); @@ -184,18 +188,30 @@ public class LocationClient { if ( runtime.bleInfo.last_is_in_area==true) { //只有上一次在区域内,这次出区域才需要报警 ICLogger.i("BT 不在区域内,且上次在区域内,报警!"); -// StringMessage AL_CMD = protocolAPIHelper.getWarningMSG(runtime); -// DeliverMessage(AL_CMD); - //如果需要报警定位,则强制进行sos定位,不能通过triggerSOS,因为函数中调用了BLEScan会造成循环调用 - startSOSLocation=true;//启动SOS定位,为了快速响应,只要wifi定位即可。 - forceLocation=1; - startLocationProcess(ICLocation.NORMAL_MOD); - }else { - if(startSOSLocation){ - startLocationProcess(ICLocation.NORMAL_MOD); + if (donotScanWiFi){ + StringMessage AL_CMD = protocolAPIHelper.getWarningMSG(runtime); + DeliverMessage(AL_CMD); + startSOSLocation=false; }else { - startLocationProcess(runtime.getLocationInstance().getWorkingMod()); + //如果需要报警定位,则强制进行sos定位,不能通过triggerSOS,因为函数中调用了BLEScan会造成循环调用 + startSOSLocation = true;//启动SOS定位,为了快速响应,只要wifi定位即可。 + forceLocation = 1; + startLocationProcess(ICLocation.NORMAL_MOD); } + }else { + + if (startSOSLocation) { + if (donotScanWiFi) { + StringMessage AL_CMD = protocolAPIHelper.getWarningMSG(runtime); + DeliverMessage(AL_CMD); + startSOSLocation=false; + } else { + startLocationProcess(ICLocation.NORMAL_MOD); + } + } else { + startLocationProcess(runtime.getLocationInstance().getWorkingMod()); + } + } } else { ICLogger.i("BT 在区域内,直接发送区域坐标即可!"); @@ -292,8 +308,29 @@ public class LocationClient { mhandler.sendEmptyMessage(msgWhat_StartBLEProcess); } + private static boolean donotScanWiFi=true; public void triggerSOSLocationProcess(){ - mhandler.sendEmptyMessage(msgWhat_StartSOSLocationProcess); + + + if (donotScanWiFi){ + updateCellInfo(); + if (runtime.bleInfo.btMacList.size() > 0) { + //有蓝牙搜索要求则 先进行蓝牙扫描 + startSOSLocation=true;//启动SOS定位,为了快速响应,只要wifi定位即可。 + forceLocation=1; + if (needLocationForBT()) + btHelper.scanBLE(); + } else { + try{ + Thread.sleep(1000); + }catch (Exception e){} + StringMessage waningmsg=protocolAPIHelper.getWarningMSG(runtime); + DeliverMessage(waningmsg); + } + + }else { + mhandler.sendEmptyMessage(msgWhat_StartSOSLocationProcess); + } } private static int checktimes=0; diff --git a/app/src/main/java/com/enqualcomm/support/bean/Runtime.java b/app/src/main/java/com/enqualcomm/support/bean/Runtime.java index 9a9717aa..554addd2 100644 --- a/app/src/main/java/com/enqualcomm/support/bean/Runtime.java +++ b/app/src/main/java/com/enqualcomm/support/bean/Runtime.java @@ -443,6 +443,41 @@ public class Runtime { ICLogger.i("setFZDDevStatus "+String.format("0x%x",fzdDevStatus)+" "+fzdDevStatus); } + + public void dumpDevStatus(){ + StringBuilder sb=new StringBuilder("get FZDStatus "); + if( (fzdDevStatus & 0x00800000 ) > 0 ){ + sb.append("ALARM_POWER_OFF "); + } + if ((fzdDevStatus & 0x00040000 ) > 0 ){ + sb.append("ALARM_ESCAPE "); + } + if ((fzdDevStatus & 0x01000000 ) > 0 ){ + sb.append("ALARM_ABNORMAL_HEART_RATE "); + } + if ((fzdDevStatus & 0x00200000 ) > 0 ){ + sb.append("ALARM_FALL "); + } + if ((fzdDevStatus & 0x00100000 ) > 0 ){ + sb.append("ALARM_ILLEGAL_CUTOFF "); + } + if ((fzdDevStatus & 0x00100000 ) == 0 ){ + sb.append("ALARM_LOCK_WATCH "); + } + if ((fzdDevStatus & 0x00020000 ) > 0 ){ + sb.append("ALARM_LOWBATTERY "); + } + if ((fzdDevStatus & 0x00010000 ) > 0 ){ + sb.append("ALARM_SOS "); + } + if ((fzdDevStatus & 0x00000008 ) > 0 ){ + sb.append("ALARM_ANTIOFF "); + } + if ((fzdDevStatus & 0x00000008 ) == 0 ){ + sb.append("ALARM_WEARED "); + } + ICLogger.i(sb.toString()); + } public String preCdmaInfo; public String preCellInfo; diff --git a/app/src/main/java/com/ic/protocols/protocolAPIHelper.java b/app/src/main/java/com/ic/protocols/protocolAPIHelper.java index 9e193271..0ec4627b 100644 --- a/app/src/main/java/com/ic/protocols/protocolAPIHelper.java +++ b/app/src/main/java/com/ic/protocols/protocolAPIHelper.java @@ -196,6 +196,7 @@ public class protocolAPIHelper { public static StringMessage getWarningMSG(Runtime runtime){ if (is_protocol_not_Initialled()) return null; StringMessage ret=null; + runtime.dumpDevStatus(); switch(Config.protocol_no) { case Config.PROTOCOL_JIAI: diff --git a/app/version_code.properties b/app/version_code.properties index 8d1cbe1a..1c10b49d 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Wed Oct 14 19:31:29 CST 2020 -VERSION_CODE=650 +#Wed Oct 14 21:27:44 CST 2020 +VERSION_CODE=656