| | |
| | | * instance |
| | | */ |
| | | private volatile static HDLLinkConfig instance; |
| | | |
| | | /** |
| | | * getInstance |
| | | * |
| | |
| | | |
| | | /** |
| | | * 保存配置 |
| | | * |
| | | * @param localSecret |
| | | * @param gatewayId |
| | | * @param ipAddress |
| | |
| | | |
| | | /** |
| | | * 检测是否已经认证过 |
| | | * |
| | | * @return |
| | | */ |
| | | public boolean checkIfCertified(){ |
| | |
| | | |
| | | public void setCurrentGateway(GatewaySearchBean currentGateway) { |
| | | this.currentGateway = currentGateway; |
| | | if (this.currentGateway != null && !TextUtils.isEmpty(this.currentGateway.getIp_address())) { |
| | | if (!this.ipAddress.equals(this.currentGateway.getIp_address())) { |
| | | //如果IP地址有变化则更新 |
| | | this.ipAddress = this.currentGateway.getIp_address(); |
| | | SPUtils.put(AUTHENTICATE_IPADDRESS_KEY, ipAddress); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 判断当前主题数据是否需要加密 |
| | | * |
| | | * @param topicStr 当前主题 |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 拼接网关ID获取完整的主题 |
| | | * |
| | | * @param topicStr |
| | | * @return |
| | | */ |