DeviceSensorReading Class
A reading of a sensor of the device (https://w3c.github.io/sensors/#sensor-reading), given to DeviceSensor.Update. Create it with the factory method of the shape of the sensor: DeviceSensorReading.FromXyz (the motion sensors and the magnetometer), DeviceSensorReading.FromUncalibratedMagnetometer, DeviceSensorReading.FromIlluminance, DeviceSensorReading.FromProximity or DeviceSensorReading.FromEulerAngles (the orientation sensors). The documents see the values quantized as the specifications require (e.g. the accelerations rounded to 0.1 m/s², the illuminance to 50 lux).
public sealed class DeviceSensorReadingProperties
| Name | Description |
|---|---|
| Alpha | Gets the rotation around the Z axis in degrees, in [0, 360) (orientation sensors), or null. |
| Beta | Gets the rotation around the X axis in degrees, in [-180, 180) (orientation sensors), or null. |
| Distance | Gets the distance to the closest object in cm (proximity sensor), or null. |
| Gamma | Gets the rotation around the Y axis in degrees, in [-90, 90) (orientation sensors), or null. |
| Illuminance | Gets the illuminance in lux (ambient light sensor), or null. |
| Max | Gets the maximum sensing range in cm (proximity sensor), or null. |
| Near | Gets whether an object is near (proximity sensor), or null. |
| X | Gets the value along the X axis (the acceleration, the angular velocity or the magnetic field), or null. |
| XBias | Gets the hard iron distortion correction along the X axis (uncalibrated magnetometer), or null. |
| Y | Gets the value along the Y axis, or null. |
| YBias | Gets the hard iron distortion correction along the Y axis (uncalibrated magnetometer), or null. |
| Z | Gets the value along the Z axis, or null. |
| ZBias | Gets the hard iron distortion correction along the Z axis (uncalibrated magnetometer), or null. |
Distance
DeviceSensorProvider.csIlluminance
DeviceSensorProvider.csMethods
| Name | Description |
|---|---|
| FromEulerAngles(double, double, double) | Creates a reading of an orientation sensor (https://w3c.github.io/deviceorientation/#parse-orientation-data-reading), as intrinsic Tait-Bryan angles Z - X' - Y'' in degrees. |
| FromIlluminance(double) | Creates a reading of the ambient light sensor (https://w3c.github.io/ambient-light/#ambient-light-reading-parsing-algorithm), in lux. |
| FromProximity(double, double, bool) | Creates a reading of the proximity sensor (https://w3c.github.io/proximity/#proximity-reading-parsing-algorithm), in cm. |
| FromUncalibratedMagnetometer(double, double, double, double, double, double) | Creates a reading of the uncalibrated magnetometer (https://w3c.github.io/magnetometer/#uncalibrated-magnetometer-reading-parsing-algorithm), in µT. |
| FromXyz(double, double, double) | Creates a reading of three values along the axes (https://w3c.github.io/sensors/#parse-xyz-reading): the acceleration in m/s² (accelerometer, linear acceleration, gravity), the angular velocity in rad/s (gyroscope), or the magnetic field in µT (magnetometer). |
FromEulerAngles(double, double, double)
DeviceSensorProvider.csCreates a reading of an orientation sensor (https://w3c.github.io/deviceorientation/#parse-orientation-data-reading), as intrinsic Tait-Bryan angles Z - X' - Y'' in degrees.
public static DeviceSensorReading FromEulerAngles(double alpha, double beta, double gamma)FromIlluminance(double)
DeviceSensorProvider.csCreates a reading of the ambient light sensor (https://w3c.github.io/ambient-light/#ambient-light-reading-parsing-algorithm), in lux.
public static DeviceSensorReading FromIlluminance(double illuminance)FromProximity(double, double, bool)
DeviceSensorProvider.csCreates a reading of the proximity sensor (https://w3c.github.io/proximity/#proximity-reading-parsing-algorithm), in cm.
public static DeviceSensorReading FromProximity(double distance, double max, bool near)FromUncalibratedMagnetometer(double, double, double, double, double, double)
DeviceSensorProvider.csFromXyz(double, double, double)
DeviceSensorProvider.csCreates a reading of three values along the axes (https://w3c.github.io/sensors/#parse-xyz-reading): the acceleration in m/s² (accelerometer, linear acceleration, gravity), the angular velocity in rad/s (gyroscope), or the magnetic field in µT (magnetometer).
public static DeviceSensorReading FromXyz(double x, double y, double z)