@mlohbihler said:
Use read property requests with the present value property identifier.
I did as you said :
public String getPresentValue(LocalDevice localDevice, ObjectIdentifier oid) throws Exception {
ReadPropertyRequest rpr = new ReadPropertyRequest(oid, PropertyIdentifier.presentValue);
ReadPropertyAck rpa = (ReadPropertyAck) localDevice.send(isa, null, 1476, Segmentation.segmentedReceive, rpr);
SequenceOf<ObjectIdentifier> sOis = (SequenceOf<ObjectIdentifier>) rpa.getValue();
List<ObjectIdentifier> ois = new ArrayList<ObjectIdentifier>();
for (ObjectIdentifier oi : sOis) {
System.out.println("--> " + oi.getObjectType().intValue());
}
return rpa.getValue().toString();
}
But it gives this follow error:
java.lang.ClassCastException: com.serotonin.bacnet4j.type.primitive.Real cannot be cast to com.serotonin.bacnet4j.type.constructed.SequenceOf
at brainset.bacnet4j.Supervisory.getPresentValue(Supervisory.java:123)
What I'm trying to do is scan my device and know what kind of points I have, if is a analog output, analog input, etc.
And store these points values in my List<...>.