| | |
| | | import com.hdl.sdk.common.utils.SPUtils;
|
| | | import com.hdl.sdk.common.utils.ThreadToolUtils;
|
| | | import com.hdl.sdk.common.utils.gson.GsonConvert;
|
| | | import com.hdl.sdk.connect.bean.AuthenticateRequest;
|
| | | import com.hdl.sdk.connect.bean.BaseLocalRequest;
|
| | | import com.hdl.sdk.connect.bean.BaseLocalResponse;
|
| | | import com.hdl.sdk.connect.bean.DeviceControlRequest;
|
| | |
| | | * 组播搜索
|
| | | */
|
| | | public void searchGateway(CallBack callBack) {
|
| | | gatewayId = "";//重置网关ID
|
| | | this.searchCallBack = callBack;
|
| | |
|
| | | if (searchGatewayThread != null) {
|
| | |
| | |
|
| | | String replyTopic = String.format(TopicConstant.PROPERTY_DOWN_REPLY, getGatewayId());
|
| | | try {
|
| | | sendMsg(message.toString().getBytes("utf-8"), replyTopic, callBack, new SendListener() {
|
| | | sendMsg(message.getSendBytes(), replyTopic, callBack, new SendListener() {
|
| | | @Override
|
| | | public void onSucceed() {
|
| | |
|
| | |
| | | }
|
| | | }
|
| | | });
|
| | | } catch (UnsupportedEncodingException e) {
|
| | | } catch (Exception e) {
|
| | | if (callBack != null) {
|
| | | callBack.onError("控制指令发送失败");
|
| | | }
|