| | |
| | | |
| | | //断开mqtt连接 |
| | | if (MqttRecvClient.getInstance() != null) { |
| | | MqttRecvClient.getInstance().stop(); |
| | | MqttRecvClient.getInstance().disConnect(); |
| | | } |
| | | //断开所有tcp连接且清空连接缓存 |
| | | // TODO: 10/10/23 |
| | | // TcpSocketBoot.stopAllConnectLinkGateway(); |
| | | // if(null!=HDLUniMPSDKManager.getInstance().getUniMP()){ |
| | | // LogUtils.d("asdfasdfasdfsdf我被删除啦"); |
| | | // HDLUniMPSDKManager.getInstance().getUniMP().closeUniMP(); |
| | | // } |
| | | // initDCUniMPSDK(); |
| | | if (null != HDLUniMPSDKManager.getInstance().getUniMP()) { |
| | | HDLUniMPSDKManager.getInstance().getUniMP().closeUniMP(); |
| | | } |
| | | initDCUniMPSDK(); |
| | | Intent intent = new Intent(getInstance(), HomeLoginActivity.class); |
| | | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
| | | if (type == 1) { |
| | |
| | | HdlLogLogic.print("测试Mqtt连接服务端失败--->"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 初始化mqtt客户端 |
| | | */ |
| | | public void initMqttClient() { |
| | | |
| | | HdlMqttLogic.getInstance().getMqttRemoteInfo(HomeType.A, new CloudCallBeak<MqttInfo>() { |
| | | @Override |
| | | public void onSuccess(MqttInfo info) { |
| | | if (info != null) { |
| | | MqttRecvClient.init(HDLApp.getInstance(), info.getUrl(), info.getClientId(), info.getUserName(), info.getPassWord()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onFailure(HDLException e) { |
| | | HdlLogLogic.print("读取mqtt远程信息失败--->" + e.getMessage(), e.getCode(), true); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |