Hi Phildunlap,
Thanks, that helped. I ran different tests. There are devices from different vendors in the Bacnet network, I realised all the other Vendor devices except the ones I was interest in, Lutron, would respond to the broadcast. But I needed to register as a foreign device for the Lutron devices to respond back, but it only resonds 50% of the time, other 50 it times out.
This is the output I get now when it works:
RemoteDevice(instanceNumber=1761053, address=Address [networkNumber=3004, macAddress=[0,0,0,1a,df,1d]], maxAPDULengthAccepted=1476, segmentationSupported=no-segmentation, vendorId=176, vendorName=null, name=Superior Conference Room 1761053, servicesSupported=[false, false, false, false, false, true, false, false, false, false, false, false, true, false, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, true, false, false, false, false, false])
I'm supposed to be printing out the present value for the Occupancy state Object, but the getObject returns null. looks like I'm using the right objectype and instance. Not sure what I'm doing wrong, any hints or help would be appriciated.
Thanks!
/Alex
Here is the Device info from BQT:
int instance = Integer.parseInt(args[0]);
int timeout = Integer.parseInt(args[1]);
Integer deviceId = 1234;
int port = 0xBAC0;
String localBindAddress = "10.116.189.90";
IpNetworkBuilder builder = new IpNetworkBuilder();
builder.withPort(port);
builder.withLocalBindAddress(localBindAddress);
builder.withBroadcast("10.116.189.127", 26);
IpNetwork network = builder.build();
LocalDevice localDevice = new LocalDevice(deviceId, new DefaultTransport(network));
try {
localDevice.initialize();
network.registerAsForeignDevice(new java.net.InetSocketAddress(localBindAddress, 0xBAC0), 60);
} catch (Exception e) {
System.out.println("Unable to initialize localDevice");
e.printStackTrace();
}
RemoteDevice rd = null;
try {
rd = localDevice.getRemoteDeviceBlocking(instance, timeout);
} catch (BACnetException e) {
// TODO Auto-generated catch block
System.out.println("Unable to find device: "+ instance);
e.printStackTrace();
System.exit(1);
}
System.out.println("");
System.out.println(rd.toExtendedString());
RemoteObject ro = rd.getObject(new ObjectIdentifier(19,8));
if (ro != null)
{
Encodable value = ro.getProperty(PropertyIdentifier.presentValue);
System.out.println(ro.getObjectName() + " present value = " + value);
}
System.exit(0);