| | |
| | | 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;
|
| | |
| | | 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("广播信息给主网关成功!");
|
| | |
| | |
|
| | | }
|
| | | });
|
| | | HDLAuthSocket.getInstance().udpSendMsg(TopicConstant.BROADCAST, GsonConvert.getGson().toJson(request),true);
|
| | | }
|
| | |
|
| | | private static class SingletonInstance {
|
| | |
| | |
|
| | | public SocketBoot getTcp() throws RuntimeException {
|
| | | if (TextUtils.isEmpty(getTcpIp())) {
|
| | | LogUtils.e("请搜索网关");
|
| | | throw new RuntimeException("请搜索网关");
|
| | | }
|
| | | //如果没有初始化,或者网关IP更改了,就重新初始化
|