Semantic Firmware Versioning

Looking at the LAN Protocol documentation, the StateHostFirmware response has two fields*:

build: firmware build (absolute time in nanoseconds since epoch) 64-bit Integer
version: firmware version, 32-bit Integer

  • there’s a third 64-bit integer field but that’s just marked as “reserved” which I’m ignoring

When I go to the LIFX app however, there’s a nice human-readable semantic version string like “v2.1”. Anyone know if there’s any way to convert between the two representations?


The 32-bit Version can be thought of as two 16-bit integers (we’re considering changing the public docs to say that instead)

For now, the conversion is:

major = val >> 0x10
minor = val & 0xFFFF