| | |
| | | responseTv.setText(""); |
| | | |
| | | // //正式服务器 |
| | | String appKey = "i8hR07jzrIS";//appkey |
| | | String appSecret = "BmnJ8RWTtaVEBk24zPPF4UMwfYu0lAWU";//appsecret |
| | | // String appKey = "i8hR07jzrIS";//appkey |
| | | // String appSecret = "BmnJ8RWTtaVEBk24zPPF4UMwfYu0lAWU";//appsecret |
| | | |
| | | //测试服务器 |
| | | // String appKey ="FcRyUJlLJFF"; |
| | | // String appSecret = "wz8wn75ABidx8vXcFGUotqhwFkTaYvvJ"; |
| | | String appKey ="FcRyUJlLJFF"; |
| | | String appSecret = "wz8wn75ABidx8vXcFGUotqhwFkTaYvvJ"; |
| | | |
| | | // String appKey = "L2OZliZRxHc"; |
| | | // String appSecret = "aCIWSvJDOukXfx3kivsKW11x9xdR3IbV"; |
| | |
| | | @Override |
| | | public void onMessage(Object msg) { |
| | | LinkResponse response = (LinkResponse) msg; |
| | | Log.i("onMessage", "response.getTopic():" + response.getTopic()); |
| | | if ("/user/all/custom/gateway/broadcast_reply".equals(response.getTopic())) { |
| | | localSecret.setText("密钥:" + HDLLinkConfig.getInstance().getLocalSecret()); |
| | | |
| | | } |
| | | } |
| | | }; |
| | |
| | | HDLLink.getInstance().removeAllTopicsListener(allTopicsListener); |
| | | } |
| | | |
| | | void initDeviceInfo() |
| | | { |
| | | void initDeviceInfo() { |
| | | AuthenticateRequest.AuthenticateDeviceInfoBean infoBean = new AuthenticateRequest.AuthenticateDeviceInfoBean(); |
| | | infoBean.setDeviceMAC("f2c5d8bad48f"); |
| | | infoBean.setIPMAC("f2c5d8bad48f"); |
| | |
| | | infoBean.setDeviceModel("HDLSDK");//设备型号 |
| | | infoBean.setAccessMode("WIFI"); |
| | | infoBean.setIPGateway("192.168.1.1"); |
| | | infoBean.setIPAddress("192.168.1.116"); |
| | | infoBean.setIPAddress("192.168.1.103"); |
| | | infoBean.setGateway_type("screen.touch"); |
| | | infoBean.setHw_version("HW2.0"); |
| | | infoBean.setFw_version("Fw1.0"); |
| | |
| | | void searchGatewayBroadcast() { |
| | | tv.setText("搜索网关中..."); |
| | | responseTv.setText(""); |
| | | HDLLinkConfig.getInstance().getGatewayId(); |
| | | HDLLink.getInstance().searchGatewayBroadcast(new HDLAuthSocket.SearchGatewayCallBack() { |
| | | @Override |
| | | public void onError(HDLLinkException e) { |
| | |
| | | statusBeanList.add(bean); |
| | | request.setStatus(statusBeanList); |
| | | requestList.add(request); |
| | | |
| | | HDLLink.getInstance().propertyDown(requestList, new HDLLinkCallBack() { |
| | | @Override |
| | | public void onSuccess(String data) { |
| | |
| | | AttributesRequest attributes = new AttributesRequest(); |
| | | attributes.setKey("on_off"); |
| | | attributes.setData_type("string"); |
| | | List<Object> valueList=new ArrayList<>(); |
| | | List<Object> valueList = new ArrayList<>(); |
| | | valueList.add("on"); |
| | | valueList.add("off"); |
| | | attributes.setValue(valueList); |