JoelBender / BACpypes3

BACnet communications library
50 stars 10 forks source link

ArrayOf(ListOf(Thing)) not working #31

Open JoelBender opened 9 months ago

JoelBender commented 9 months ago

Reference Clause 20.2.20 Encoding of a BACnetARRAY of BACnetLIST datatype, the following example should work but doesn't:

    s = ListOf(Integer)
    t = ArrayOf(ListOf(Integer))
    x = t([[1,2,3], [], [4,5,6]])

The test where everything is explicitly created works:

    x = t([s([1,2,3]), s(), s([4,5,6])])

While there are no BACnetArray of BACnetList properties, the type was added in Addendum bu to ANSI/ASHRAE Standard 135-2016. This shows up in the AddListElement, RemoveListElement, and ReadRange services.

JoelBender commented 9 months ago

And more importantly, the encoding is wrong, it doesn't contain the opening and closing tags:

    t = x.encode()
    t.debug_contents()