[ST Edge] Any plans to add support for Zigbee SinglePrecisionFloat?

Hi,
Do I understand correctly that IEEE 754 floating point data type is not supported yet?
Is there any roadmap for this?

Some devices report attributes with floating point numbers and without floating point support the the whole message that contains multiple attributes fails to decode.

Thanks

2 Likes

Floats are supported, though they are double precision instead of single precision. I Lua the number type can be either an integer or a float:

The type number uses two internal representations, or two subtypes, one called integer and the other called float . Lua has explicit rules about when each representation is used, but it also converts between them automatically as needed (see §3.4.3). Therefore, the programmer may choose to mostly ignore the difference between integers and floats or to assume complete control over the representation of each number. Standard Lua uses 64-bit integers and double-precision (64-bit) floats […]

[from: Lua 5.3 Reference Manual]

To understand how they’re handled, I’d suggesting going to ^ link and Ctrl-F’ing page for float. The description for how the two different internal representations are handled is spread across a few different places.

If you’re still having problems, could you post the error that you’re seeing. I’m not aware of any of our general purpose libraries that don’t support parsing floats.

1 Like

Hi @psbarrett

Thank you very much for your replay.
I meant Zigbee single precision data type, not Lua data type.
I’m sorry for not being clear enough.
I updated the title of the question.

Thanks

1 Like

Ah, that I’m not sure about.