Closed yaoguaijiao closed 2 years ago
The title is my wrong message
Here's my source code:
IpNetwork ipNetwork = new IpNetworkBuilder() .withLocalBindAddress("192.168.120.93")//本机的ip .withSubnet("255.255.255.0", 24) .withPort(47808) //Yabe默认的UDP端口 .withReuseAddress(true) .build(); LocalDevice localDevice = new LocalDevice(1, new DefaultTransport(ipNetwork)); localDevice.initialize(); localDevice.sendGlobalBroadcast(new WhoIsRequest()); Thread.sleep(1000); RemoteDevice remoteDeviceBlocking = localDevice.getRemoteDeviceBlocking(123); System.out.println("modelName=" + remoteDeviceBlocking.getDeviceProperty(PropertyIdentifier.modelName)); ObjectIdentifier objectIdentifier = new ObjectIdentifier(ObjectType.analogInput, 123); Encodable encodable = RequestUtils.readProperty(localDevice, remoteDeviceBlocking, objectIdentifier, PropertyIdentifier.presentValue, null); System.out.println(encodable.toString());
The real problem is the beginning of this line: Encodable encodable = RequestUtils.readProperty(localDevice, remoteDeviceBlocking, objectIdentifier, PropertyIdentifier.presentValue, null);
This is my misinformation
The error message indicates that remoteDeviceBlocking does not have object (AI,123).
我也出现了同样的问题,你解决了吗?是否是localDevice.terminate();的问题
The title is my wrong message
Here's my source code:
The real problem is the beginning of this line: Encodable encodable = RequestUtils.readProperty(localDevice, remoteDeviceBlocking, objectIdentifier, PropertyIdentifier.presentValue, null);
This is my misinformation![image](https://user-images.githubusercontent.com/48637361/117914561-3385ef00-b316-11eb-8fb2-f68473670ac1.png)