Although all values transferred over the VBus seem to be 32-bits in size when they are transferred using VBus 2.x datagrams, internally they are often stored in memory locations that are smaller. Temperatures for example often fit in signed 16-bit values.
The bitSize attribute in the XML declares, how large the memory location for the value is and what possible range the value can be before it gets truncated:
- bitSize=„1“ uses only one bit and values can be either 0 or 1
- bitSize=„7“ uses a signed 8-bit integer that can store values between -128 and 127
- bitSize=„8“ uses an unsigned 8-bit integer that can store values between 0 and 255
- bitSize=„15“ uses a signed 16-bit integer that can store values between -32768 and 32767
- bitSize=„16“ uses an unsigned 16-bit integer that can store values between 0 and 65535
- bitSize=„31“ uses a signed 32-bit integer that can store values between (-(2^31) and (2^31-1))
Best regards,
Daniel