I am trying to perform network discovery for bacnet devices across multiple subnets without knowing what subnets are connected. Using Wireshark I am able to see that all the devices in my test environment are "chirping" on their subnets; broadcast IPs in response to my localDevice.sendGlobalBroadcast(new WhoIsRequest()), but it appears the Listener is not firing. I'm banging my head against my keyboard trying to sift through the empty JavaDoc for Bacnet4j. (Side note: is there a more fleshed-out JavaDoc relevant to vs 1.3 floating around somewhere?) Here is my code:
public static void main(String[] args) throws Exception {
IpNetwork network = new IpNetwork("255.255.255.255");
Transport transport = new Transport(network);
transport.setTimeout(1500);
transport.setSegTimeout(1500);
try {
localDevice = new LocalDevice(1234, transport);
localDevice.initialize();
localDevice.getEventHandler().addListener(new Listener());
localDevice.sendGlobalBroadcast(new WhoIsRequest());
Thread.sleep(3000);
for (RemoteDevice device : localDevice.getRemoteDevices()) {
readVitals(device);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
localDevice.terminate();
}
}
Devices on my local subnet populate instantly. Devices on other subnets sit behind their routers chirping uselessly at their gateways.
Please help.