W3C home > Mailing lists > Public > public-device-apis-log@w3.org > November 2016

Re: [magnetometer] Provide API to access uncalibrated magnetometer values

From: Rick Waldron via GitHub <sysbot+gh@w3.org>
Date: Fri, 04 Nov 2016 19:11:49 +0000
To: public-device-apis-log@w3.org
Message-ID: <issue_comment.created-258522515-1478286708-sysbot+gh@w3.org>
Option 4?

```webidl
[Constructor(optional MagnetometerSensorOptions sensorOptions)]
interface Magnetometer : Sensor {
  readonly attribute MagnetometerReading? reading;
};

dictionary MagnetometerSensorOptions : SensorOptions {
  boolean raw = false;
};

[Constructor(MagnetometerReadingInit magnetometerReadingInit)]
interface MagnetometerReading : SensorReading {
  readonly attribute double x;
  readonly attribute double y;
  readonly attribute double z;
  readonly attribute double xBias;
  readonly attribute double yBias;
  readonly attribute double zBias;
  readonly attribute boolean raw;
};

dictionary MagnetometerReadingInit {
  required double x = 0;
  required double y = 0;
  required double z = 0;
  required double xBias = 0;
  required double yBias = 0;
  required double zBias = 0;
  required boolean raw;
};
```


When `raw` is `false`, the value of the *Bias properties would default
 to 0 and remain 0. 


-- 
GitHub Notification of comment by rwaldron
Please view or discuss this issue at 
https://github.com/w3c/magnetometer/issues/16#issuecomment-258522515 
using your GitHub account
Received on Friday, 4 November 2016 19:11:56 UTC

This archive was generated by hypermail 2.4.0 : Monday, 4 July 2022 12:47:52 UTC