This displays 17689 and 16680, the XBee manual for VR states;
VR Firmware Version. Read firmware version of the module.
The firmware version returns 4 hexadecimal values (2 bytes) “ABCD”. Digits ABC are the main release number and D is the revision number from the main release. “B” is a variant designator.
XBee and XBee-PRO ZB modules return:
0x2xxx versions.
XBee and XBee-PRO ZNet modules return:
0x1xxx versions. ZNet firmware is not compatible with ZB firmware.
I don’t think the hardware and version values are regular enough to “decode” in a smart, universal way - in the end you’ll end up with a large switch-statement with lots of constants & any new XBee will force you to change your code.
As part of an admin screen function to add additional sensors to my application I wanted to list this information. it may help with diagnostics etc if a particular sensor is problematic. I use DD to determine sensor type but would like to include at least firmware revision.
You may use a couple of methods in order to interpret the integers returned by the DDO commands you have unpacked. However, I would strongly recommend asserting that unpack use big-endian ordering for the integers. You may do this by prepending your format string with a “>” character. This makes your code: