我正在尝试实现这个蓝牙网状网络特性:
<!--
Copyright 2017 Bluetooth SIG, Inc. All rights reserved.
-->
<Characteristic xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://schemas.bluetooth.org/Documents/characteristic.xsd" name="Illuminance" type="org.bluetooth.characteristic.illuminance" uuid="2AFB" last-modified="2017-07-11" approved="Yes">
<InformativeText>
<Abstract>
The Illuminance characteristic is used to represent a measure of illuminance in units of lux.
</Abstract>
</InformativeText>
<Value>
<Field name="Illuminance">
<InformativeText>Unit is lux with a resolution of 0.01.</InformativeText>
<Format>uint24</Format>
<Unit>org.bluetooth.unit.lux</Unit>
<Minimum>0</Minimum>
<Maximum>167772.14</Maximum>
<DecimalExponent>-2</DecimalExponent>
<BinaryExponent>0</BinaryExponent>
<Multipler>1</Multipler>
<Description>
A value of 0xFFFFFF represents 'value is not known'. All other values are Prohibited.
</Description>
</Field>
</Value>
</Characteristic>
https://www.bluetooth.com/wp-content/uploads/Sitecore-Media-Library/Specifications/Mesh/Xml/Characteristics/org.bluetooth.characteristic.illuminance.xml。该特性以 3 个字节表示勒克斯值。
但我不知道如何将像 0x123456 这样的值转换为真正的浮点数。似乎没有使用标准的 IEEE 754 标准。我也不知道它们是什么意思DecimalExponent
and BinaryExponent
。
谁能帮帮我?亲切的问候,大安