| | |
| | | public synchronized UdpSocketBoot initUdp() { |
| | | try { |
| | | if (udpSocketBoot == null) { |
| | | udpSocketBoot = UdpClient.init("0.0.0.0",UDP_PORT, getUdpOptions()); |
| | | udpSocketBoot = UdpClient.init("0.0.0.0", UDP_PORT, getUdpOptions()); |
| | | udpSocketBoot.bind(); |
| | | bindSuccess=true; |
| | | bindSuccess = true; |
| | | } |
| | | } catch (Exception e) { |
| | | LogUtils.e("初始化网关失败:"+e.getMessage()); |
| | | LogUtils.e("初始化网关失败:" + e.getMessage()); |
| | | return null; |
| | | } |
| | | |
| | |
| | | // infoBean.setAccessMode("HDL"); |
| | | // infoBean.setOID(getOid()); |
| | | // infoBean.setSid(getSid()); |
| | | //// infoBean.set |
| | | |
| | | /// / infoBean.set |
| | | // AuthenticateRequest.VersionBean[] versionBeans = new AuthenticateRequest.VersionBean[]{new AuthenticateRequest.VersionBean("FW", versionString), new AuthenticateRequest.VersionBean("HW", "1956F")}; |
| | | // infoBean.setVersions(versionBeans); |
| | | // AuthenticateRequest request = new AuthenticateRequest(IdUtils.getUUId(), time, infoBean, authbean); |
| | |
| | | |
| | | //没有绑定的网关或与当前绑定到当前住宅的网关,建立连接。后面如果考虑也显示其它住宅的网关,这个限制要去掉 |
| | | // if(TextUtils.isEmpty(gateway.getHomeId())||gateway.getHomeId().equals(HDLLinkConfig.getInstance().getHomeId())) { |
| | | HDLTcpConnect.initTcp(gateway.getIp_address());//初始化TCP连接 |
| | | HDLTcpConnect.initTcp(gateway.getIp_address());//初始化TCP连接 |
| | | // } |
| | | } |
| | | } |