我正在使用 bacnet4j 库来发现远程 BACnet 设备。在同一个网络中,一切都按预期工作。但我找不到位于不同网络中的 BACnet 控制器设备。
String hostAddress="10.8.102.28";
IpNetwork network = new IpNetworkBuilder().withPort(47808).withSubnet(hostAddress, 24).build();
Transport transport = new DefaultTransport(network);
LocalDevice localDevice = new LocalDevice(Integer.decode(this.settings.getDeviceId()), transport);
localDevice.initialize();
//Finding remote device
int remoteId=1234;
RemoteDeviceFuture remoteFuture = RemoteDeviceFinder.findDevice(localDevice, remoteId);
RemoteDevice remoteDevice = null;
try {
remoteDevice = remoteFuture.get(); //remote device is null here
} catch (Exception e) {
LOGGER.error("Remote device with id " + remoteId + " does NOT exist!");
}
上面的代码片段在同一网络中查找具有给定 remoteId 的远程设备。但它找不到位于不同网络中的设备。这里有什么问题吗?