hxb
2022-02-16 845bb16392e6b47ec31147d0e7c6ddc39537f2e7
HDLSDK/hdl-connect/src/main/java/com/hdl/sdk/connect/socket/HDLSocket.java
@@ -1,6 +1,7 @@
package com.hdl.sdk.connect.socket;
import android.text.TextUtils;
import android.util.Log;
import com.google.gson.JsonObject;
import com.hdl.sdk.common.config.TopicConstant;
@@ -82,7 +83,8 @@
            return;
        }
        BroadcastRequest request = new BroadcastRequest(IdUtils.getUUId(), time, HDLLinkConfig.getInstance().getDeviceInfoBean(), "200");
        HDLAuthSocket.getInstance().udpSendMsg("/user/all/custom/gateway/broadcast", GsonConvert.getGson().toJson(request), true, new HDLLinkResponseCallBack() {
        HDLAuthSocket.getInstance().udpSendMsg(TopicConstant.BROADCAST, GsonConvert.getGson().toJson(request),true);
        HDLAuthSocket.getInstance().udpSendMsg(TopicConstant.BROADCAST, GsonConvert.getGson().toJson(request), true, new HDLLinkResponseCallBack() {
            @Override
            public void onSuccess(LinkResponse msg) {
                LogUtils.i("广播信息给主网关成功!");
@@ -93,6 +95,7 @@
            }
        });
        HDLAuthSocket.getInstance().udpSendMsg(TopicConstant.BROADCAST, GsonConvert.getGson().toJson(request),true);
    }
    private static class SingletonInstance {
@@ -404,6 +407,7 @@
    public SocketBoot getTcp() throws RuntimeException {
        if (TextUtils.isEmpty(getTcpIp())) {
            LogUtils.e("请搜索网关");
            throw new RuntimeException("请搜索网关");
        }
        //如果没有初始化,或者网关IP更改了,就重新初始化