Naively, I would expect each of the following four expressions, in device driver code, to evaluate to the same value, namely the string "7004010100000000"
zwave.configurationV1.configurationSet(configurationValue: [0 as Byte ]*4, parameterNumber: 1, size: 1).format()
zwave.configurationV1.configurationSet(configurationValue: [0 as Short ]*4, parameterNumber: 1, size: 1).format()
zwave.configurationV1.configurationSet(configurationValue: [0 as Integer ]*4, parameterNumber: 1, size: 1).format()
zwave.configurationV1.configurationSet(configurationValue: [0 as Long ]*4, parameterNumber: 1, size: 1).format()
What I actually observe is that expressions 2 and 3 do evaluate to the expected value, but expressions 1 and 4 evaluate to the string "70040101"
. The format()
method of the zwave.configurationV1.configurationSet class seems to be behaving incorrectly (or, at least, unexpectedly) in the case where the elements in the configurationValue list are Byte's or Long's . The particular values in the configurationValue list in the expressions above are just an example -- the same unexpected behavior seems to occur regardless of the values -- the type is what's important.
This unexpected behavior thwarted my attempts to set the configuration registers of a zwave device. The workaround was to explicitly cast the members of the configurationValue list to Short's before passing the list to the zwave.configurationV1.configurationSet constructor.