hxb
2021-12-21 93f13e7b2e046c6d86d10e7abc2ecaa4c4adabc3
HDLSDK/hdl-connect/src/main/java/com/hdl/sdk/connect/config/HDLLinkConfig.java
@@ -4,6 +4,7 @@
import com.hdl.sdk.common.config.TopicConstant;
import com.hdl.sdk.common.utils.SPUtils;
import com.hdl.sdk.connect.bean.request.AuthenticateRequest;
import com.hdl.sdk.connect.bean.response.GatewaySearchBean;
@@ -23,6 +24,8 @@
    private String ipAddress;
    private boolean isLocalEncrypt;//网关是否需要加密通讯
    private GatewaySearchBean currentGateway;//当前网关
    private AuthenticateRequest.AuthenticateDeviceInfoBean deviceInfoBean;//当前设备基本信息
    /**
     * instance
@@ -87,6 +90,13 @@
    }
    /**
     * 重新保存
     */
    public void reSaveConfig() {
        this.saveConfig(this.localSecret, this.gatewayId, this.ipAddress);
    }
    /**
     * 检测是否已经认证过
     *
     * @return
@@ -113,6 +123,9 @@
    public String getIpAddress() {
        return ipAddress;
    }
    public void setIpAddress(String ipAddress){
        this.ipAddress = ipAddress;
    }
    public boolean isLocalEncrypt() {
@@ -150,6 +163,7 @@
        return (!topicStr.contains(TopicConstant.GATEWAY_AUTH_BROADCAST) //网关广播入网指令
                && !topicStr.contains(TopicConstant.DEIVCE_AUTH_REQUEST) //入网认证
                && !topicStr.contains(TopicConstant.GATEWAY_SEARCH) //搜索网关主题
                && !topicStr.equals(TopicConstant.BROADCAST)
                && isLocalEncrypt//启用加密标志
        );
    }
@@ -164,4 +178,11 @@
        return String.format(topicStr, gatewayId);
    }
    public AuthenticateRequest.AuthenticateDeviceInfoBean getDeviceInfoBean() {
        return deviceInfoBean;
    }
    public void setDeviceInfoBean(AuthenticateRequest.AuthenticateDeviceInfoBean deviceInfoBean) {
        this.deviceInfoBean = deviceInfoBean;
    }
}