From: TrillGates Date: Sat, 16 Jan 2021 06:06:06 +0000 (+0800) Subject: add some logs. X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=5aa595d566f7c90a3a5c3dc035a4a70510da4afb;p=protocol_srv.git add some logs. --- diff --git a/app/release/ICSer_V751_2101141810_release.apk b/app/release/ICSer_V752_2101151444_release.apk similarity index 78% rename from app/release/ICSer_V751_2101141810_release.apk rename to app/release/ICSer_V752_2101151444_release.apk index ae8df78c..4b896e11 100644 Binary files a/app/release/ICSer_V751_2101141810_release.apk and b/app/release/ICSer_V752_2101151444_release.apk differ diff --git a/app/release/output.json b/app/release/output.json index 4a90c635..2918b18b 100644 --- a/app/release/output.json +++ b/app/release/output.json @@ -1 +1 @@ -[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":751,"versionName":"2101141810","enabled":true,"outputFile":"ICSer_V751_2101141810_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V751_2101141810_release.apk","properties":{}}] \ No newline at end of file +[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":752,"versionName":"2101151444","enabled":true,"outputFile":"ICSer_V752_2101151444_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V752_2101151444_release.apk","properties":{}}] \ No newline at end of file diff --git a/app/src/main/aidl/com/ic/work/IHeartRateSensorService.aidl b/app/src/main/aidl/com/ic/work/IHeartRateSensorService.aidl index 6f63d6e6..e4b5e7e2 100644 --- a/app/src/main/aidl/com/ic/work/IHeartRateSensorService.aidl +++ b/app/src/main/aidl/com/ic/work/IHeartRateSensorService.aidl @@ -10,5 +10,5 @@ interface IHeartRateSensorService { //取消接口注册 void unRegisterCallback(in IHeartRateSensorCallback callback); //获取心率相关数据0表示Alarm,1表示客户端用户发出的,3表示服务端发出的单次获取指令 - oneway void getHeartRateInfo(int from,in String callbackTag); + void getHeartRateInfo(int from,in String callbackTag); } \ No newline at end of file diff --git a/app/src/main/aidl/com/ic/work/ITempSensorService.aidl b/app/src/main/aidl/com/ic/work/ITempSensorService.aidl index 3d1847ed..8a210e67 100644 --- a/app/src/main/aidl/com/ic/work/ITempSensorService.aidl +++ b/app/src/main/aidl/com/ic/work/ITempSensorService.aidl @@ -9,5 +9,5 @@ interface ITempSensorService { void unRegisterCallback(in ITempSensorCallback callback); //获取体温:0表示Alarm,1表示客户端用户发出的,3表示服务端发出的单次获取指令 //callbackTag,可以使用报名+类名的字符串组合 - oneway void getTemperatureInfo(int from,in String callbackTag); + void getTemperatureInfo(int from,in String callbackTag); } \ No newline at end of file diff --git a/app/src/main/java/com/enqualcomm/support/CoreService.java b/app/src/main/java/com/enqualcomm/support/CoreService.java index 64f0c044..4a6fab88 100644 --- a/app/src/main/java/com/enqualcomm/support/CoreService.java +++ b/app/src/main/java/com/enqualcomm/support/CoreService.java @@ -190,15 +190,10 @@ public class CoreService extends Service { runtime.getLocationInstance().setWorkingMod(EMERGNECY_MOD); //runtime.setPpgTestCycle(1); setLocationAlarm(runtime.getLocationInstance().getWorkingMod()); - //触发一次心率检测 setHeartRateDetectAlarm(1); - - setEmegencyLocationSTOPAlarm(5); } else if (ACTION_LOCAL_SOS_ACTION.endsWith(param1Intent.getAction())) { - - VibrateUtil.getInstance(runtime.getContextProxy().context).VibrateOn(true); // if( param1Intent.getIntExtra("type", 1) == 1) { boolean needHRSTestOnSOS = Util.getSystemProperties("persist.sys.needHRSOnSOS", "false").equals("true"); @@ -1449,6 +1444,7 @@ public class CoreService extends Service { ICLogger.i("setTempAlarm noTempSensor"); return; } + ICLogger.e("setTempAlarm cycle == > " + cycle); if (cycle > 1) { AlarmHelper.setRealTimeAlarmInSeconds(runtime.getContextProxy().context, cycle, TEMP_ALARM); sb.append(" setTempAlarm " + TEMP_ALARM + ", cycle " + cycle + " seconds"); 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 d42b5ab6..787df89c 100644 --- a/app/src/main/java/com/enqualcomm/support/bean/Runtime.java +++ b/app/src/main/java/com/enqualcomm/support/bean/Runtime.java @@ -116,6 +116,7 @@ public class Runtime { } public boolean isServerProtocolConnected() { + ICLogger.d("ServerHeartBeadReceived == > " + ServerHeartBeadReceived); return ServerHeartBeadReceived; } diff --git a/app/src/main/java/com/enqualcomm/support/service/Deliver.java b/app/src/main/java/com/enqualcomm/support/service/Deliver.java index 58aa4539..ebc67e72 100644 --- a/app/src/main/java/com/enqualcomm/support/service/Deliver.java +++ b/app/src/main/java/com/enqualcomm/support/service/Deliver.java @@ -133,7 +133,9 @@ public class Deliver extends AbstractConnectionService { // //如果信号不好,把msg放回去 // ret = false; // } - if (connection.isServerConnected() == false || !mRuntime.isServerProtocolConnected()) { + boolean serverConnected = connection.isServerConnected(); + ICLogger.d("serverConnected == > " + serverConnected); + if (!serverConnected || !mRuntime.isServerProtocolConnected()) { ICLogger.i("服务器无法访问,或者协议状态失常"); ret = false; } diff --git a/app/src/main/java/com/enqualcomm/support/service/HeartRateManager.java b/app/src/main/java/com/enqualcomm/support/service/HeartRateManager.java index fa10295a..448ffd6d 100644 --- a/app/src/main/java/com/enqualcomm/support/service/HeartRateManager.java +++ b/app/src/main/java/com/enqualcomm/support/service/HeartRateManager.java @@ -300,17 +300,19 @@ public class HeartRateManager extends AbstractInvokeHandlerService { if (CoreService.getInstance() != null) { if (CoreService.getInstance().getRuntime().Anti_off_flag == 1) { ICLogger.i("未佩戴,取消 triggerPPGtest!"); - //return; + return; } } //开始去测试 - try { - ICLogger.d("from == > " + from + " HeartRateManager "); - heartRateSensorService.getHeartRateInfo(from, HeartRateManager.class.getName()); - } catch (Exception e) { - e.printStackTrace(); - ICLogger.e("exception -- > ", e); - } + ICLogger.d("from == > " + from + " HeartRateManager "); + new Thread(() -> { + try { + heartRateSensorService.getHeartRateInfo(from, HeartRateManager.class.getName()); + } catch (Exception e) { + e.printStackTrace(); + ICLogger.e("exception -- > ", e); + } + }).start(); } diff --git a/app/src/main/java/com/enqualcomm/support/utils/NettyConnection.java b/app/src/main/java/com/enqualcomm/support/utils/NettyConnection.java index b5447955..e6a2b181 100644 --- a/app/src/main/java/com/enqualcomm/support/utils/NettyConnection.java +++ b/app/src/main/java/com/enqualcomm/support/utils/NettyConnection.java @@ -8,7 +8,6 @@ import android.os.SystemClock; import android.util.Log; import com.enqualcomm.support.Config; -import com.enqualcomm.support.bean.EventLooperHandlerThread; import com.enqualcomm.support.bean.Runtime; import com.enqualcomm.support.bean.StringMessage; import com.ic.protocols.protocolAPIHelper; @@ -146,7 +145,7 @@ public class NettyConnection implements Connection { public boolean isServerConnected() { - return (RxSocket.getInstance().getSocketStatus() == CONNECTED) ? true : false; + return RxSocket.getInstance().getSocketStatus() == CONNECTED; } public boolean sendMsg(String cmd) { diff --git a/app/src/main/java/com/enqualcomm/support/utils/RxSocket.java b/app/src/main/java/com/enqualcomm/support/utils/RxSocket.java index 213526b8..0a27dbe2 100644 --- a/app/src/main/java/com/enqualcomm/support/utils/RxSocket.java +++ b/app/src/main/java/com/enqualcomm/support/utils/RxSocket.java @@ -1,8 +1,6 @@ package com.enqualcomm.support.utils; import java.net.InetSocketAddress; -import java.net.SocketOptions; -import java.net.StandardSocketOptions; import java.nio.ByteBuffer; import java.nio.channels.SelectionKey; import java.nio.channels.Selector; @@ -10,7 +8,6 @@ import java.nio.channels.SocketChannel; import java.util.Iterator; import java.util.concurrent.TimeUnit; -//import chestnut.utils.LogUtils; import rx.Observable; import rx.Subscriber; import rx.schedulers.Schedulers; @@ -18,6 +15,8 @@ import rx.subjects.PublishSubject; import rx.subjects.SerializedSubject; import rx.subjects.Subject; +//import chestnut.utils.LogUtils; + /** *
  *     author: 栗子酱
@@ -36,22 +35,24 @@ import rx.subjects.Subject;
 public class RxSocket {
 
     /*  常量
-    * */
+     * */
     private String TAG = "RxSocket";
     private boolean OpenLog = true;
     private long WRITE_TIME_OUT = 3000;
     private long CONNECT_TIME_OUT = 3000;
 
     /*  单例
-    * */
-    private Subject readSubject;
-    private Subject connectStatus;
+     * */
+    private Subject readSubject;
+    private Subject connectStatus;
     private static volatile RxSocket defaultInstance;
+
     private RxSocket() {
         readSubject = new SerializedSubject(PublishSubject.create());
         connectStatus = new SerializedSubject(PublishSubject.create());
     }
-    public synchronized static  RxSocket getInstance() {
+
+    public synchronized static RxSocket getInstance() {
         RxSocket rxSocket = defaultInstance;
         if (defaultInstance == null) {
             synchronized (chestnut.RxSocket.RxSocket.class) {
@@ -66,7 +67,7 @@ public class RxSocket {
     }
 
     /*  变量
-    * */
+     * */
     private SocketStatus socketStatus = SocketStatus.DIS_CONNECT;
     private Selector selector = null;
     private SocketChannel socketChannel = null;
@@ -74,30 +75,34 @@ public class RxSocket {
     private ReadThread readThread = null;
     private boolean isReadThreadAlive = true;
     private SocketReconnectCallback socketReconnectCallback = null;
-    private SocketReadCallback socketReadCallback=null;
+    private SocketReadCallback socketReadCallback = null;
 //    private SocketConnectionListener conectionListener = null;
 
     /*  方法
-    * */
+     * */
+
     /**
      * 监听Socket的状态
+     *
      * @return Rx SocketStatus 状态
      */
-    public Observable socketStatusListener () {
+    public Observable socketStatusListener() {
         return connectStatus;
     }
 
-    public void setSocketReadCallback(SocketReadCallback callback){
-        socketReadCallback=callback;
+    public void setSocketReadCallback(SocketReadCallback callback) {
+        socketReadCallback = callback;
     }
 //    public void setConnectionListener(SocketConnectionListener callback){
 //        conectionListener=callback;
 //    }
+
     /**
      * 建立Socket连接,只是尝试建立一次
-     * @param ip    IP or 域名
-     * @param port  端口
-     * @return  Rx true or false
+     *
+     * @param ip   IP or 域名
+     * @param port 端口
+     * @return Rx true or false
      */
     public Observable connectRx(String ip, int port) {
         return Observable
@@ -105,47 +110,46 @@ public class RxSocket {
                     @Override
                     public void call(Subscriber subscriber) {
 
-                        ICLogger.log(TAG,"connectRx:"+"status:"+socketStatus.name());
-
+                        ICLogger.log(TAG, "connectRx:" + "status:" + socketStatus.name());
                         //正在连接
                         if (socketStatus == SocketStatus.CONNECTING) {
                             subscriber.onNext(false);
                             subscriber.onCompleted();
                             return;
                         }
-
+                        ICLogger.d("connectRx == > socketStatus = SocketStatus.DIS_CONNECT 未连接 | 已经连接,关闭Socket");
                         //未连接 | 已经连接,关闭Socket
                         socketStatus = SocketStatus.DIS_CONNECT;
                         isReadThreadAlive = false;
                         readThread = null;
-                        if (selector!=null)
+                        if (selector != null)
                             try {
                                 selector.close();
                             } catch (Exception e) {
-                                 ICLogger.log(TAG,"selector.close");
+                                ICLogger.log(TAG, "selector.close");
                             }
-                        if (selectionKey!=null)
+                        if (selectionKey != null)
                             try {
                                 selectionKey.cancel();
                             } catch (Exception e) {
-                                 ICLogger.log(TAG,"selectionKey.cancel");
+                                ICLogger.log(TAG, "selectionKey.cancel");
                             }
-                        if (socketChannel!=null)
+                        if (socketChannel != null)
                             try {
                                 socketChannel.close();
                             } catch (Exception e) {
-                                 ICLogger.log(TAG,"socketChannel.close");
+                                ICLogger.log(TAG, "socketChannel.close");
                             }
 
                         //重启Socket
                         isReadThreadAlive = true;
-                        readThread = new ReadThread(ip,port);
+                        readThread = new ReadThread(ip, port);
                         readThread.start();
 
                         socketReconnectCallback = new SocketReconnectCallback() {
                             @Override
                             public void onSuccess() {
-                                 ICLogger.log( TAG, "connectRx:" + "CONNECTED");
+                                ICLogger.log(TAG, "connectRx:" + "CONNECTED");
                                 socketStatus = SocketStatus.CONNECTED;
                                 subscriber.onNext(true);
                                 subscriber.onCompleted();
@@ -153,7 +157,7 @@ public class RxSocket {
 
                             @Override
                             public void onFail(String msg) {
-                                 ICLogger.log( TAG, "connectRx:" + msg);
+                                ICLogger.log(TAG, "connectRx:" + msg);
                                 subscriber.onNext(false);
                                 subscriber.onCompleted();
                             }
@@ -171,7 +175,8 @@ public class RxSocket {
 
     /**
      * 断开当前的Socket
-     *  还能再继续连接
+     * 还能再继续连接
+     *
      * @return Rx true or false
      */
     public Observable disConnect() {
@@ -179,31 +184,31 @@ public class RxSocket {
             @Override
             public void call(Subscriber subscriber) {
                 try {
-                    if (socketStatus == SocketStatus.DIS_CONNECT  || socketStatus == SocketStatus.DIS_CONNECT_BY_SERVERSIDE) {
+                    if (socketStatus == SocketStatus.DIS_CONNECT || socketStatus == SocketStatus.DIS_CONNECT_BY_SERVERSIDE) {
                         subscriber.onNext(true);
                         subscriber.onCompleted();
-                    }
-                    else {
+                    } else {
+                        ICLogger.d("disconnected === > DIS_CONNECT");
                         socketStatus = SocketStatus.DIS_CONNECT;
                         isReadThreadAlive = false;
                         readThread = null;
-                        if (selector!=null)
+                        if (selector != null)
                             try {
                                 selector.close();
                             } catch (Exception e) {
-                                 ICLogger.log(TAG,"selector.close");
+                                ICLogger.log(TAG, "selector.close");
                             }
-                        if (selectionKey!=null)
+                        if (selectionKey != null)
                             try {
                                 selectionKey.cancel();
                             } catch (Exception e) {
-                                 ICLogger.log(TAG,"selectionKey.cancel");
+                                ICLogger.log(TAG, "selectionKey.cancel");
                             }
-                        if (socketChannel!=null)
+                        if (socketChannel != null)
                             try {
                                 socketChannel.close();
                             } catch (Exception e) {
-                                 ICLogger.log(TAG,"socketChannel.close");
+                                ICLogger.log(TAG, "socketChannel.close");
                             }
                         subscriber.onNext(true);
                         subscriber.onCompleted();
@@ -218,7 +223,8 @@ public class RxSocket {
 
     /**
      * 读取Socket的消息
-     * @return  Rx error 或者 有数据
+     *
+     * @return Rx error 或者 有数据
      */
     public Observable read() {
         return readSubject;
@@ -226,8 +232,9 @@ public class RxSocket {
 
     /**
      * 向Socket写消息
-     * @param buffer    数据包
-     * @return  Rx true or false
+     *
+     * @param buffer 数据包
+     * @return Rx true or false
      */
     public Observable write(ByteBuffer buffer) {
         return Observable
@@ -235,33 +242,30 @@ public class RxSocket {
                     @Override
                     public void call(Subscriber subscriber) {
                         if (socketStatus != SocketStatus.CONNECTED) {
-                             ICLogger.log( TAG, "write." + "SocketStatus.DISCONNECTED");
+                            ICLogger.log(TAG, "write." + "SocketStatus.DISCONNECTED");
                             subscriber.onNext(false);
                             subscriber.onCompleted();
-                        }
-                        else {
-                            if (socketChannel!=null && socketChannel.isConnected()) {
+                        } else {
+                            if (socketChannel != null && socketChannel.isConnected()) {
                                 try {
                                     int result = socketChannel.write(buffer);
-                                    if (result<0) {
-                                         ICLogger.log( TAG, "write." + "发送出错");
+                                    if (result < 0) {
+                                        ICLogger.log(TAG, "write." + "发送出错");
                                         subscriber.onNext(false);
                                         subscriber.onCompleted();
-                                    }
-                                    else {
-                                         ICLogger.log( TAG, "write." + "success!");
+                                    } else {
+                                        ICLogger.log(TAG, "write." + "success!");
                                         subscriber.onNext(true);
                                         subscriber.onCompleted();
                                     }
                                 } catch (Exception e) {
-                                     ICLogger.log(TAG,"write exception ."+e.getMessage());
-                                     e.printStackTrace();
+                                    ICLogger.log(TAG, "write exception ." + e.getMessage());
+                                    e.printStackTrace();
                                     subscriber.onNext(false);
                                     subscriber.onCompleted();
                                 }
-                            }
-                            else {
-                                 ICLogger.log(TAG,"write."+"close");
+                            } else {
+                                ICLogger.log(TAG, "write." + "close");
                                 subscriber.onNext(false);
                                 subscriber.onCompleted();
                             }
@@ -274,24 +278,28 @@ public class RxSocket {
 
     /**
      * 获取Socket的链接状态
-     * @return  状态
+     *
+     * @return 状态
      */
     public SocketStatus getSocketStatus() {
+        ICLogger.d("getSocketStatus == > " + socketStatus);
         return socketStatus;
     }
 
     /*  类 && 枚举 && 接口
-        * */
+     * */
     private class ReadThread extends Thread {
         private String ip;
         private int port;
+
         ReadThread(String ip, int port) {
             this.ip = ip;
             this.port = port;
         }
+
         @Override
         public void run() {
-             ICLogger.log(TAG,"ReadThread:"+"start");
+            ICLogger.log(TAG, "ReadThread:" + "start");
             while (isReadThreadAlive) {
                 //连接
                 if (socketStatus == SocketStatus.DIS_CONNECT || socketStatus == SocketStatus.DIS_CONNECT_BY_SERVERSIDE) {
@@ -309,17 +317,17 @@ public class RxSocket {
                         connectStatus.onNext(SocketStatus.CONNECTING);
                     } catch (Exception e) {
                         isReadThreadAlive = false;
+                        ICLogger.d("exception so disconnected state.");
                         socketStatus = SocketStatus.DIS_CONNECT;
                         connectStatus.onNext(SocketStatus.DIS_CONNECT);
-                         ICLogger.log( TAG, "ReadThread:init exception:" + e);
-                         e.printStackTrace();
-                        if (socketReconnectCallback!=null)
+                        ICLogger.log(TAG, "ReadThread:init exception:" + e);
+                        e.printStackTrace();
+                        if (socketReconnectCallback != null)
                             socketReconnectCallback.onFail("SocketConnectFail1");
-
                     }
                 }
                 //读取
-                else if (socketStatus == SocketStatus.CONNECTING || socketStatus  == SocketStatus.CONNECTED) {
+                else if (socketStatus == SocketStatus.CONNECTING || socketStatus == SocketStatus.CONNECTED) {
                     try {
                         selector.select();
                         Iterator it = selector.selectedKeys().iterator();
@@ -338,6 +346,7 @@ public class RxSocket {
 
                                     } catch (Exception e) {
                                         isReadThreadAlive = false;
+                                        ICLogger.d("exception socket disconnected");
                                         socketStatus = SocketStatus.DIS_CONNECT;
                                         connectStatus.onNext(SocketStatus.DIS_CONNECT);
                                         ICLogger.log(TAG, "ReadThread:finish exception:" + e);
@@ -351,8 +360,8 @@ public class RxSocket {
                                 ByteBuffer buf = ByteBuffer.allocate(10000);
                                 int length = socketChannel.read(buf);
                                 if (length <= 0) {
-                                    ICLogger.log(TAG, "服务器主动断开链接!");
                                     isReadThreadAlive = false;
+                                    ICLogger.log(TAG, "服务器主动断开链接!");
                                     socketStatus = SocketStatus.DIS_CONNECT_BY_SERVERSIDE;
                                     connectStatus.onNext(SocketStatus.DIS_CONNECT_BY_SERVERSIDE);
                                     if (socketReconnectCallback != null)
@@ -373,12 +382,13 @@ public class RxSocket {
                         it.remove();
                     } catch (Exception e) {
                         isReadThreadAlive = false;
+                        ICLogger.d("disconnected in exception.");
                         socketStatus = SocketStatus.DIS_CONNECT;
                         connectStatus.onNext(SocketStatus.DIS_CONNECT);
-                         ICLogger.log( TAG, "ReadThread:read exception :" + e);
-                         e.printStackTrace();
+                        ICLogger.log(TAG, "ReadThread:read exception :" + e);
+                        e.printStackTrace();
 
-                        if (socketReconnectCallback!=null)
+                        if (socketReconnectCallback != null)
                             socketReconnectCallback.onFail("SocketConnectFail4");
 
                     }
@@ -396,10 +406,11 @@ public class RxSocket {
 
     private interface SocketReconnectCallback {
         void onSuccess();
+
         void onFail(String msg);
     }
 
-    public interface SocketReadCallback{
+    public interface SocketReadCallback {
         void onRecvMsg(byte[] bytes);
     }
 
diff --git a/app/src/main/java/com/enqualcomm/support/utils/TemperatureUtil.java b/app/src/main/java/com/enqualcomm/support/utils/TemperatureUtil.java
index 89ae10ab..3fa9fc12 100644
--- a/app/src/main/java/com/enqualcomm/support/utils/TemperatureUtil.java
+++ b/app/src/main/java/com/enqualcomm/support/utils/TemperatureUtil.java
@@ -155,24 +155,6 @@ public class TemperatureUtil {
         ThreadPool.getInstance().submitThreadPool(() -> DoTempTest(from));
     }
 
-    public static final String ACTION_TEMP_RESULT = "com.ic.action.temp_result";
-    public static final String KEY_TEMP_BODY = "body";  // double 体温
-    public static final String KEY_TEMP_WRIST = "wrist";  //  double 腕温
-    public static final String KEY_TEMP_OUT = "out"; //temp out
-    public static final String KEY_TEMP_BYPROTOCOL = "protocol"; //temp out
-
-    private void sendTempBroadcast(double value, double animal, double tempOut) {
-        Intent pedIntent = new Intent();
-        pedIntent.setAction(ACTION_TEMP_RESULT);
-        pedIntent.putExtra(KEY_TEMP_WRIST, value);
-        pedIntent.putExtra(KEY_TEMP_BODY, animal);
-        pedIntent.putExtra(KEY_TEMP_OUT, tempOut);
-        pedIntent.putExtra(KEY_TEMP_BYPROTOCOL, true);
-        if (CoreService.getInstance() != null)
-            CoreService.getInstance().sendBroadcast(pedIntent);
-    }
-
-
     /**
      * 不管是什么测试,后台指令,还是定时的,都会走这里。
      * 那这个地方,不再走本地进行测试,而是走远程IcWorkService进行测试
@@ -186,13 +168,16 @@ public class TemperatureUtil {
             ICLogger.i("未佩戴,取消TempTest!" + from);
             return;
         }
-        try {
-            if (temperatureRemoteService != null) {
-                ICLogger.d("get temperature info...");
-                temperatureRemoteService.getTemperatureInfo(from, TemperatureUtil.class.getName());
+        new Thread(() -> {
+            try {
+                if (temperatureRemoteService != null) {
+                    ICLogger.d("get temperature info...");
+                    temperatureRemoteService.getTemperatureInfo(from, TemperatureUtil.class.getName());
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+                ICLogger.e("exception  -- > ", e);
             }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
+        }).start();
     }
 }
diff --git a/app/src/main/java/com/enqualcomm/support/utils/mqttConnection.java b/app/src/main/java/com/enqualcomm/support/utils/mqttConnection.java
index b8d4d781..00cf02e6 100644
--- a/app/src/main/java/com/enqualcomm/support/utils/mqttConnection.java
+++ b/app/src/main/java/com/enqualcomm/support/utils/mqttConnection.java
@@ -1,81 +1,81 @@
 package com.enqualcomm.support.utils;
 
-import android.util.Log;
-
-import com.enqualcomm.support.Config;
 import com.enqualcomm.support.bean.Runtime;
 import com.enqualcomm.support.bean.StringMessage;
 import com.ic.protocols.protocolAPIHelper;
 import com.ic.protocols.protocol_mqtt_client;
 
 public class mqttConnection implements Connection {
-    private String topic_header="";
-    private protocol_mqtt_client.MqttCallbackInterface mqttcallback=new protocol_mqtt_client.MqttCallbackInterface() {
+    private String topic_header = "";
+    private protocol_mqtt_client.MqttCallbackInterface mqttcallback = new protocol_mqtt_client.MqttCallbackInterface() {
         @Override
         public void onMqttConnected() {
-            ICLogger.i( "onMqttConnected");
-            topic_header="WBG100/v1/"+mRuntime.IMEI()+"/";
-            ICLogger.i( "topic_header "+topic_header);
+            ICLogger.i("onMqttConnected");
+            topic_header = "WBG100/v1/" + mRuntime.IMEI() + "/";
+            ICLogger.i("topic_header " + topic_header);
             mqtt_client.setSubscriptTopicHeader(topic_header);
-            mqtt_client.attemptSubscribeToTopic(topic_header+"+");
-            isServerconnected=true;
+            mqtt_client.attemptSubscribeToTopic(topic_header + "+");
+            isServerconnected = true;
 //            mRuntime.setServerProtocolConnected(true);
-            if (listener!=null)
+            if (listener != null)
                 listener.onConnectionOpen();
 
         }
 
         @Override
         public void onMqttDisconnected() {
-            ICLogger.i( "onMqttDisconnected");
-            isServerconnected=false;
+            ICLogger.i("onMqttDisconnected");
+            isServerconnected = false;
             mRuntime.setServerProtocolConnected(false);
-            if (listener!=null)
+            if (listener != null)
                 listener.onConnectionClose("");
         }
 
         @Override
         public void handleMqttMessage(String cmdtype, byte[] msgdata) {
-            ICLogger.i( "handleMqttMessage "+cmdtype+" " +new String(msgdata));
-            API.parserCmd(cmdtype,msgdata);
+            ICLogger.i("handleMqttMessage " + cmdtype + " " + new String(msgdata));
+            API.parserCmd(cmdtype, msgdata);
         }
 
         @Override
         public void handleMqttMessage(String cmdtype, String msgdata) {
-            ICLogger.i( "handleMqttMessage "+cmdtype+" "+ msgdata);
-            API.parserCmd(cmdtype,msgdata.getBytes());
+            ICLogger.i("handleMqttMessage " + cmdtype + " " + msgdata);
+            API.parserCmd(cmdtype, msgdata.getBytes());
         }
     };
+
     public mqttConnection(ConnectionListener paramConnectionListener, Runtime runtime) {
         ICLogger.i("mqttConnection ");
-        mqtt_client=new protocol_mqtt_client(runtime.getContextProxy().context,mqttcallback);
-        listener=paramConnectionListener;
-        mRuntime=runtime;
-        if (API == null) API=new protocolAPIHelper(this,runtime );
+        mqtt_client = new protocol_mqtt_client(runtime.getContextProxy().context, mqttcallback);
+        listener = paramConnectionListener;
+        mRuntime = runtime;
+        if (API == null) API = new protocolAPIHelper(this, runtime);
 
     }
-    private Runtime mRuntime=null;
-    private protocol_mqtt_client mqtt_client=null;
 
-    private static boolean isServerconnected=false;
-    private protocolAPIHelper API=null;
-    private ConnectionListener listener=null;
+    private Runtime mRuntime = null;
+    private protocol_mqtt_client mqtt_client = null;
+
+    private static boolean isServerconnected = false;
+    private protocolAPIHelper API = null;
+    private ConnectionListener listener = null;
+
     @Override
-    public void close(){
+    public void close() {
 
     }
 
     @Override
-    public void connect(String serverip, int serverport){
+    public void connect(String serverip, int serverport) {
 //        mqtt_client.attemptConnectMqtt(paramString,"IC_"+mRuntime.IMEI(),paramInt);
-        ICLogger.i("mqttconnect " +serverip+" "+serverport+" cycle "+mRuntime.getHeartBeatCycle()*60+" as "+"IC_"+mRuntime.IMEI());
-        mqtt_client.configMqtt(serverip,serverport, mRuntime.getHeartBeatCycle()*60,"IC_"+mRuntime.IMEI());
+        ICLogger.i("mqttconnect " + serverip + " " + serverport + " cycle " + mRuntime.getHeartBeatCycle() * 60 + " as " + "IC_" + mRuntime.IMEI());
+        mqtt_client.configMqtt(serverip, serverport, mRuntime.getHeartBeatCycle() * 60, "IC_" + mRuntime.IMEI());
         mqtt_client.connectservice();
-       // if(isServerconnected) mqtt_client.attemptConnectMqtt();
+        // if(isServerconnected) mqtt_client.attemptConnectMqtt();
     }
 
     @Override
-    public void disconnect(){
+    public void disconnect() {
         disconnectServer();
     }
 
@@ -86,58 +86,58 @@ public class mqttConnection implements Connection {
     }
 
     @Override
-    public int getTimeout(){
+    public int getTimeout() {
 
         return 0;
     }
 
     @Override
-    public void open(){
+    public void open() {
 
     }
 
     @Override
-    public void send(StringMessage paramStringMessage){
+    public void send(StringMessage paramStringMessage) {
 
-        if(paramStringMessage==null)
-        {
+        if (paramStringMessage == null) {
             ICLogger.i("mqtt send StringMessage Null skip!");
             return;
         }
-        String topci=paramStringMessage.cmd();
-        String msgdata=paramStringMessage.isFromCache();
-        ICLogger.i("mqtt send "+topci+" "+msgdata);
+        String topci = paramStringMessage.cmd();
+        String msgdata = paramStringMessage.isFromCache();
+        ICLogger.i("mqtt send " + topci + " " + msgdata);
         if (topci.startsWith("WBG100/v1")) {
             mqtt_client.sendMessage(topci, msgdata);
-            ICLogger.logToFile("APILog","mqtt send "+topci+" "+msgdata);
-        }else{
-            ICLogger.i("mqtt topci foramt error "+topci);
+            ICLogger.logToFile("APILog", "mqtt send " + topci + " " + msgdata);
+        } else {
+            ICLogger.i("mqtt topci foramt error " + topci);
         }
     }
 
     @Override
-    public boolean sendBlocking(StringMessage paramStringMessage){
+    public boolean sendBlocking(StringMessage paramStringMessage) {
         send(paramStringMessage);
         return true;
     }
 
     @Override
-    public void setTimeout(int paramInt){
+    public void setTimeout(int paramInt) {
 
     }
 
     @Override
     public void DeliverCMDMessageToSystem(String cmd, String msg) {
-        if (this.listener!=null){
-            String[] msgArr=new String[]{cmd,msg};
-            StringMessage stringMessage=new StringMessage(msgArr);
+        if (this.listener != null) {
+            String[] msgArr = new String[]{cmd, msg};
+            StringMessage stringMessage = new StringMessage(msgArr);
             stringMessage.refresh(msg);
-            this.listener.onReceive(stringMessage );
+            this.listener.onReceive(stringMessage);
         }
     }
 
     @Override
     public boolean isServerConnected() {
+        ICLogger.d("isServerconnected == > " + isServerconnected);
         return isServerconnected;
     }
 
diff --git a/app/version_code.properties b/app/version_code.properties
index 1961391a..d5a7bfab 100644
--- a/app/version_code.properties
+++ b/app/version_code.properties
@@ -1,2 +1,2 @@
-#Thu Jan 14 18:10:27 CST 2021
-VERSION_CODE=751
+#Fri Jan 15 14:44:00 CST 2021
+VERSION_CODE=752