Hi I am connecting to a bacnet simulator device of yabe in my local pc that is 192.168.1.9. the code gets to the listener of WhoIs with my device. from this point any request is timing out.
the same code is used for a serial port mstp bacnet device and it wokes good. my connection code is:
Network network =network = new IpNetworkBuilder()
.withLocalBindAddress("0.0.0.0")
.withBroadcast("192.168.1.9", 24)
.withPort(47808)
.withReuseAddress(true)
.build();
Transport transport = new DefaultTransport(network);
transport.setTimeout(Transport.DEFAULT_TIMEOUT);
transport.setSegTimeout(Transport.DEFAULT_SEG_TIMEOUT);
transport.setSegWindow(Transport.DEFAULT_SEG_WINDOW);
transport.setRetries(1);
localDevice = new LocalDevice(1, transport);
DeviceEventAdapter listener2 =new DeviceEventAdapter() {
@Override
public void iAmReceived(final RemoteDevice d) {
try {
// this line gets a time out
DiscoveryUtils.getExtendedDeviceInformation(localDevice, d);
// and if I remark this line and run this:
List<ObjectIdentifier> oids = ((SequenceOf<ObjectIdentifier>)
RequestUtils.sendReadPropertyAllowNull(
localDevice, rd, rd.getObjectIdentifier(),
PropertyIdentifier.objectList)).getValues();
PropertyReferences references = new PropertyReferences();
// or
ObjectIdentifier my = new ObjectIdentifier(ObjectType.analogInput,1);
List<ObjectIdentifier> oids1 = new ArrayList<ObjectIdentifier>();
oids1.add(my);
}catch (Exception es) {
es.printStackTrace();
}
}
};
localDevice.getEventHandler().addListener(listener2);
localDevice.initialize();
localDevice.sendGlobalBroadcast(new WhoIsRequest());
any try to take some data from the device is going to timeout any idea ow to fix it?
Thanks for everyone.