From 85ad5b0b0bd356196a08b8f901f6fa560322e908 Mon Sep 17 00:00:00 2001 From: TrillGates Date: Sat, 20 Nov 2021 10:59:12 +0800 Subject: [PATCH] =?utf8?q?=E8=B0=83=E6=95=B4=E4=BA=86=E4=BD=93=E6=B8=A9?= =?utf8?q?=E4=B8=8A=E4=BC=A0=E6=95=B0=E6=8D=AE=E7=9A=84=E4=BD=8D=E7=BD=AE?= =?utf8?q?=EF=BC=8C=E4=BD=93=E6=B8=A9=E5=92=8C=E8=85=95=E6=B8=A9=E5=AF=B9?= =?utf8?q?=E8=B0=83=EF=BC=8C=E6=89=8D=E7=AC=A6=E5=90=88=E5=8D=8F=E8=AE=AE?= =?utf8?q?=E7=9A=84=E8=A6=81=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../enqualcomm/support/LocationClient.java | 32 +++++++------------ .../com/ic/protocols/protocol_beehome.java | 2 +- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/app/src/main/java/com/enqualcomm/support/LocationClient.java b/app/src/main/java/com/enqualcomm/support/LocationClient.java index f178e01b..5f68a43c 100644 --- a/app/src/main/java/com/enqualcomm/support/LocationClient.java +++ b/app/src/main/java/com/enqualcomm/support/LocationClient.java @@ -623,38 +623,30 @@ public class LocationClient { if (checktimes > GPSLocationTimeoutInSeconds) { ICLogger.i("waitAndSendLocation " + checktimes + " timeout"); timeout = true; - } - if (NoMoveTimeout == true && (timeout == true || gps_nosignal == true)) { + if (NoMoveTimeout && (timeout || gps_nosignal)) { //没有移动,GPS超时或者没信号都会给 计数 加 1 gpsTimeoutCountOnNoMove++; } - timeCost = System.currentTimeMillis() - startCheckTime; - if ((startCheckTime != 0L) && (timeCost > 50 * 1000L)) { - //有时timer计数不准,则根据实际时间计算 - ICLogger.i("waitAndSendLocation " + timeCost + "> 50000ms timeout"); - //timeout=true; - } - // lbs only +timeout, lbs+wifi+gpsNosignal, libs+ , lbs+gps+wifi, Timeout can override wifi and gps - if ((lbs_ok && timeout == true) + if ((lbs_ok && timeout) || (gps_ok) - || (lbs_ok && (gps_ok || startSOSLocation == true)) - || (lbs_ok && (gps_ok || startSOSLocation == true) && wifi_ok) + || (lbs_ok && (gps_ok || startSOSLocation)) + || (lbs_ok && (gps_ok || startSOSLocation) && wifi_ok) || (lbs_ok && gps_nosignal && wifi_ok) ) { - String locationtype = "LBS"; + String locationType = "LBS"; if (gps_ok) { - locationtype = "GPS"; + locationType = "GPS"; } else if (wifi_ok) { - locationtype = "WiFi"; + locationType = "WiFi"; } - runtime.getLocationInstance().setLocationType(locationtype); + runtime.getLocationInstance().setLocationType(locationType); runtime.getLocationInstance().setLocationTime(TimeUtil.getSystemTime3()); - if (startSOSLocation == true) { + if (startSOSLocation) { StringMessage AP10_CMD = protocolAPIHelper.getWarningMSG(runtime); DeliverMessage(AP10_CMD); runtime.setAlarmType(Runtime.AlarmType.ALARM_REMOVE_SOS); @@ -678,10 +670,10 @@ public class LocationClient { String msg = "Location Fixed Type " + runtime.getLocationInstance().getLocationType() + " at " + runtime.getLocationInstance().getLocationTime() + " timeout " + timeout; ICLogger.i(msg); if (responseUrl != null) { - if (locationtype.equals("GPS")) { + if (locationType.equals("GPS")) { responseUrl.replyCallBack(runtime.getLocationInstance().getLocation().latGPSStr + "," + runtime.getLocationInstance().getLocation().lonGPSStr); } else { - responseUrl.replyCallBack("Location Fixed Type " + locationtype); + responseUrl.replyCallBack("Location Fixed Type " + locationType); } } @@ -689,7 +681,7 @@ public class LocationClient { ICLogger.logToFile("GPS", msg); - } else if (timeout == true) { + } else if (timeout) { //timeout + noLBS +noGPS ICLogger.i("timeout no location "); stopCheckLocationResult(); diff --git a/app/src/main/java/com/ic/protocols/protocol_beehome.java b/app/src/main/java/com/ic/protocols/protocol_beehome.java index 009e63c7..c0b990bc 100644 --- a/app/src/main/java/com/ic/protocols/protocol_beehome.java +++ b/app/src/main/java/com/ic/protocols/protocol_beehome.java @@ -1737,8 +1737,8 @@ public class protocol_beehome { //33,132:温补用的参数,此处不用,可以用0 来代替。 return genStringMessage(cmdMap.get(CMD_TYPE.APTP), new StringBuffer(CMDHEADER).append(cmdMap.get(CMD_TYPE.APTP)) - .append(CMDSPLIT).append(String.format("%1$.2f", body_temp)) .append(CMDSPLIT).append(String.format("%1$.2f", wrist_temp)) + .append(CMDSPLIT).append(String.format("%1$.2f", body_temp)) .append(CMDSPLIT).append(0) .append(CMDEND).toString()); } -- 2.17.1