| | |
| | | rv.setLayoutManager(new LinearLayoutManager(this)); |
| | | |
| | | checkIfCertified(); |
| | | |
| | | registerAllTopicsListener(); |
| | | |
| | | ActivityResultLauncher<String[]> launcher = registerForActivityResult(new ActivityResultContracts.RequestMultiplePermissions(), new ActivityResultCallback<Map<String, Boolean>>() { |
| | |
| | | AuthenticateRequest.AuthenticateDeviceInfoBean infoBean = new AuthenticateRequest.AuthenticateDeviceInfoBean(); |
| | | infoBean.setDeviceMAC(macStr); |
| | | infoBean.setIPMAC(macStr); |
| | | infoBean.setDeviceName("HDL设备");//设备名字 |
| | | infoBean.setDeviceName("红外宝");//设备名字 |
| | | infoBean.setDeviceModel("HDL");// |
| | | infoBean.setAccessMode("WIFI"); |
| | | infoBean.setIPGateway("192.168.10.1"); |
| | |
| | | void getFunctionList(){ |
| | | tv.setText("获取功能列表中..."); |
| | | responseTv.setText(""); |
| | | HDLSocket.getInstance().getFunctionList(new HDLLinkCallBack() { |
| | | HDLLink.getInstance().getFunctionList(new HDLLinkCallBack() { |
| | | @Override |
| | | public void onError(HDLLinkException error) { |
| | | tv.setText(error.getMsg()); |
| | |
| | | tv.setText("功能属性读取"); |
| | | List<String> sids = new ArrayList<>(); |
| | | sids.add(testLightSid); |
| | | HDLSocket.getInstance().getFunctionAttribute(sids, new HDLLinkCallBack() { |
| | | HDLLink.getInstance().getFunctionAttribute(sids, new HDLLinkCallBack() { |
| | | @Override |
| | | public void onSuccess(String msg) { |
| | | responseTv.setText(msg); |
| | |
| | | tv.setText("读取状态中..."); |
| | | List<String> list = new ArrayList<>(); |
| | | list.add(testLightSid);//要读取设备的sid |
| | | HDLSocket.getInstance().propertyRead(list, new HDLLinkCallBack() { |
| | | HDLLink.getInstance().propertyRead(list, new HDLLinkCallBack() { |
| | | @Override |
| | | public void onSuccess(String data) { |
| | | tv.setText("读取成功"); |