Closed envas closed 3 years ago
Writing to NULL is allowed if and only if the object supports Command Prioritization. In your application merely adding priority array would not make the object commandable. There should be line similar to mv1.supportCommandable(new UnsignedInteger(1)); With the above line Commandablemixin is activated and checking NULL @PRI is validated at CommandableMixin.java @line 250. This is applicable to all commandable object types. Subsequently BACnet4J would function as intended.
Regards, Kishore
I know about supportCommanable and command prioritization was supported. The problem was my application error, sorry, nothing to do with multistate or any other objects.
Describe the bug Commandable multistate objects do not accept NULL as a new property value.
To Reproduce
Expected behavior I can write NULL value to level8
IMO the problem is in the multistate mixin - line 55 - when validating the property. New value must be between 1 .. numStates but there is no test for NULL values:
https://github.com/infiniteautomation/BACnet4J/blob/6d34e6dd9e83a6fdea0708a72d0a46017386bbeb/src/main/java/com/serotonin/bacnet4j/obj/mixin/MultistateMixin.java#L52-L57