Access to the ambient light sensor in Microsoft Band

There is an ambient light sensor with the Microsoft Band, and some applications in the Windows Store show the ALS value in Lux, but I can not find a way in the Band SDK to read the ALS Lux value.

How can I access ALS?

+2
source share
4 answers

As already mentioned, this sensor is not opened by the public SDK - but it is apparently possible to get information (and a bunch of other things) using the raw Bluetooth interface - the public API is a kind of shell around the raw Bluetooth protocol.

So, if you are not afraid of reverse engineering and messing with raw bytes, you can figure out how to decode the sensor data. You can use the Windows.Devices.Bluetooth.Rfcomm library - there is a sample code from Microsoft that shows how to set up the basic rfccomm Bluetooth connection: https://code.msdn.microsoft.com/windowsapps/Bluetooth-Rfcomm-Chat-afcee559

+1
source

Win iOS, RFCOMM. . , . , - . Android, MS Health, , . (?) MS Health .

+2

Microsoft Band SDK ( NuGet v1.3.11121) .

if (bandClient.SensorManager.AmbientLight.IsSupported)
{
    bandClient.SensorManager.AmbientLight.ReadingChanged += (s, args) =>
    {
        Debug.WriteLine(bandClient.SensorManager.AmbientLight.Brightness);
    };
    await bandClient.SensorManager.AmbientLight.StartReadingsAsync();
    await Task.Delay(TimeSpan.FromSeconds(5));
    await bandClient.SensorManager.AmbientLight.StopReadingsAsync();
}
0
source

All Articles