| | |
| | | import com.hdl.sdk.link.common.utils.gson.GsonConvert; |
| | | import com.hdl.sdk.link.core.config.HDLLinkConfig; |
| | | import com.hdl.sdk.link.core.protocol.LinkMessageDecoder; |
| | | import com.hdl.sdk.link.core.protocol.LinkMessageDecoderUdp; |
| | | import com.hdl.sdk.link.core.protocol.LinkMessageEncoder; |
| | | import com.hdl.sdk.link.socket.client.UdpClient; |
| | | import com.hdl.sdk.link.socket.codec.MessagePipeLine; |
| | |
| | | .getSystemService(Context.WIFI_SERVICE); |
| | | options.setWifiManager(manager); |
| | | final MessagePipeLine pipeLine = new MessagePipeLine(); |
| | | pipeLine.add(new LinkMessageDecoder()); |
| | | pipeLine.add(new LinkMessageEncoder()); |
| | | pipeLine.add(new LinkMessageDecoderUdp()); |
| | | // pipeLine.add(new LinkMessageEncoder()); |
| | | options.setHandleMessage(pipeLine); |
| | | return options; |
| | | } |
| | |
| | | }.getType()); |
| | | GatewayBean gateway = response.getObjects(); |
| | | if (gateway != null) { |
| | | if (!TextUtils.isEmpty(HDLLinkConfig.getInstance().getGatewayId()) |
| | | && !TextUtils.isEmpty(HDLLinkConfig.getInstance().getHomeId())) { |
| | | if (!TextUtils.isEmpty(gateway.getGatewayId()) |
| | | && !TextUtils.isEmpty(gateway.getHomeId())) { |
| | | //主网关并且是当前绑定的网关 |
| | | if ("true".equals(gateway.getMaster().toLowerCase())) { |
| | | if (gateway.getGatewayId().equals(HDLLinkConfig.getInstance().getGatewayId()) |