From 0188dee359636723190f0f67a6b674b7b08f7bef Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期一, 21 三月 2022 09:55:01 +0800
Subject: [PATCH] 增加判断json数据格式

---
 HDLSDK/hdl-connect/src/main/java/com/hdl/sdk/connect/config/HDLLinkConfig.java |   29 ++++++++++++++++-------------
 1 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/HDLSDK/hdl-connect/src/main/java/com/hdl/sdk/connect/config/HDLLinkConfig.java b/HDLSDK/hdl-connect/src/main/java/com/hdl/sdk/connect/config/HDLLinkConfig.java
index dd5e830..a21c26c 100644
--- a/HDLSDK/hdl-connect/src/main/java/com/hdl/sdk/connect/config/HDLLinkConfig.java
+++ b/HDLSDK/hdl-connect/src/main/java/com/hdl/sdk/connect/config/HDLLinkConfig.java
@@ -3,7 +3,9 @@
 import android.text.TextUtils;
 
 import com.hdl.sdk.common.config.TopicConstant;
+import com.hdl.sdk.common.utils.LogUtils;
 import com.hdl.sdk.common.utils.SPUtils;
+import com.hdl.sdk.connect.bean.request.AuthenticateRequest;
 import com.hdl.sdk.connect.bean.response.GatewaySearchBean;
 
 
@@ -21,8 +23,9 @@
     private String localSecret;//鏈湴鍔犲瘑瀵嗛挜
     private String gatewayId;
     private String ipAddress;
-    private boolean isLocalEncrypt;//缃戝叧鏄惁闇�瑕佸姞瀵嗛�氳
     private GatewaySearchBean currentGateway;//褰撳墠缃戝叧
+
+    private AuthenticateRequest.AuthenticateDeviceInfoBean deviceInfoBean;//褰撳墠璁惧鍩烘湰淇℃伅
 
     /**
      * instance
@@ -53,7 +56,6 @@
         this.gatewayId = "";
         this.ipAddress = "";
         this.localSecret = "";
-        this.isLocalEncrypt = false;
         SPUtils.remove(AUTHENTICATE_LS_KEY);
         SPUtils.remove(AUTHENTICATE_GATEWAYID_KEY);
         SPUtils.remove(AUTHENTICATE_IPADDRESS_KEY);
@@ -67,7 +69,6 @@
         localSecret = SPUtils.getString(AUTHENTICATE_LS_KEY, "");
         gatewayId = SPUtils.getString(AUTHENTICATE_GATEWAYID_KEY, "");
         ipAddress = SPUtils.getString(AUTHENTICATE_IPADDRESS_KEY, "");
-        isLocalEncrypt = SPUtils.getBoolean(AUTHENTICATE_IS_LS_KEY, false);
     }
 
     /**
@@ -117,21 +118,15 @@
     public String getGatewayId() {
         return gatewayId;
     }
+    public void setGatewayId(String gatewayId) {
+        this.gatewayId=gatewayId;
+    }
 
     public String getIpAddress() {
         return ipAddress;
     }
     public void setIpAddress(String ipAddress){
         this.ipAddress = ipAddress;
-    }
-
-    public boolean isLocalEncrypt() {
-        return isLocalEncrypt;
-    }
-
-    public void setLocalEncrypt(boolean localEncrypt) {
-        isLocalEncrypt = localEncrypt;
-        SPUtils.put(AUTHENTICATE_IS_LS_KEY, isLocalEncrypt);
     }
 
     public GatewaySearchBean getCurrentGateway() {
@@ -160,7 +155,8 @@
         return (!topicStr.contains(TopicConstant.GATEWAY_AUTH_BROADCAST) //缃戝叧骞挎挱鍏ョ綉鎸囦护
                 && !topicStr.contains(TopicConstant.DEIVCE_AUTH_REQUEST) //鍏ョ綉璁よ瘉
                 && !topicStr.contains(TopicConstant.GATEWAY_SEARCH) //鎼滅储缃戝叧涓婚
-                && isLocalEncrypt//鍚敤鍔犲瘑鏍囧織
+                && !topicStr.contains(TopicConstant.BROADCAST)
+                && !TextUtils.isEmpty(localSecret) //鏈夊瘑閽ュ氨鏄姞瀵�
         );
     }
 
@@ -174,4 +170,11 @@
         return String.format(topicStr, gatewayId);
     }
 
+    public AuthenticateRequest.AuthenticateDeviceInfoBean getDeviceInfoBean() {
+        return deviceInfoBean;
+    }
+
+    public void setDeviceInfoBean(AuthenticateRequest.AuthenticateDeviceInfoBean deviceInfoBean) {
+        this.deviceInfoBean = deviceInfoBean;
+    }
 }

--
Gitblit v1.8.0