问题描述
有一个带有Microsoft Band的环境光传感器,并且Windows应用商店中的某些应用程序以Lux为单位显示ALS值,但是我无法在Band SDK中找到一种读取ALS Lux值的方法.
There is an Ambient Light Sensor with Microsoft Band, and some apps in the Windows Store show the ALS value in Lux, But I can't find a way in the Band SDK to read the ALS Lux value.
如何访问ALS?
推荐答案
如前所述,该传感器未由公共SDK公开-但显然可以通过使用原始蓝牙接口-公共API是原始蓝牙协议的一种包装.
因此,如果您不担心逆向工程和摆弄原始字节,则可以弄清楚如何解码传感器数据.您可以使用Windows.Devices.Bluetooth.Rfcomm库-来自Microsoft的代码示例显示了如何设置基本的蓝牙rfccomm通信: https://code.msdn.microsoft.com/windowsapps/Bluetooth-Rfcomm-Chat-afcee559
As mentioned, that sensor is not exposed by the public SDK - but it is apparently possible to get the information (and a heap of other stuff) by using the raw Bluetooth interface - the public API is a kind of wrapper around the raw Bluetooth protocol.
So, if you're not afraid of reverse-engineering and fiddling around with raw bytes you may be able to figure out how to decode the sensor data. You can use the Windows.Devices.Bluetooth.Rfcomm library - there's a code sample from Microsoft that shows how to setup basic Bluetooth rfccomm communication: https://code.msdn.microsoft.com/windowsapps/Bluetooth-Rfcomm-Chat-afcee559
这篇关于在Microsoft Band上访问环境光传感器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!