Read a encodable value in a array
-
For "dp3_prio8", a priority array is an object, not a sequence. It's a tricky thing i guess because the object happens to be a type of a sequence (accessed as an array), but i suppose you need to request the object without an index, cast to a PriorityArray, and then pull the value you want out of it.
For "noti1", similar problem. The property is a bit string, not a sequence. Solution is similar to above.
-
but i suppose you need to request the object without an index
I need just one value , the value Priorityarray.get(index)
Bacnet4j should be able to do that ?
-
Like this:
ReadPropertyRequest req = new ReadPropertyRequest(new ObjectIdentifier(ObjectType.analogOutput, 1234), PropertyIdentifier.priorityArray); ReadPropertyAck ack = localDevice.send(remoteDevice, req); PriorityArray priorityArray = (PriorityArray) ack.getValue(); int priority = priorityArray.get(16).getIntegerValue().intValue();
-
Note that it is the remote device that is imposing this, not BACnet4J (unless BACnet4J is the implementation in the remote device). The error message about "Property is not an array/list" is being returned by the equipment, which is why you need to do it this way.
-
Please see the attached file that show the equipement answer.
The error is created by the stack, because of the PriorityArray is not a sequence
add(ObjectType.analogOutput, PropertyIdentifier.priorityArray, PriorityArray.class, false, true, new PriorityArray());
Attachment: download link
-
Ah, i see. Can you send me the full byte stream and i'll take a look.
-
Yes Monday (or tomorrow) i can send you the full byte stream (I have not the station here sorry)
Thanks for help and good week-end !
-
No problem. If you can please include the request byte stream as well, that may be useful.
-
-
K. I think it should be better now. This was an issue only with PriorityArray i believe. Changes have been checked into CVS. Please let me know if it helps.
-
Thanks it's help !