Search code examples
.netsensorsmicrosoft-band

Accessing Ambient Light Sensor on Microsoft Band


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.

How can I access the ALS?


Solution

  • 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