Skip to content

Commit

Permalink
Rewrite Automation section after w3c/sensors#470
Browse files Browse the repository at this point in the history
The Automation section in the Generic Sensor API specification was rewritten
and several terms and concepts have changed.

This commit adapts the Gyroscope spec to the changes:
* Remove references to "mock sensor type", "mock sensor reading values" and
  the "MockSensorType" enum.
* Define an entry in the per-type virtual sensor metadata map whose key is
  what used to be the "gyroscope" entry in MockSensorType and an appropriate
  virtual sensor metadata entry.

This is enough to integrate properly with the Generic Sensor spec and allow
Gyroscope virtual sensors to be created and used.

Fixes #51.
  • Loading branch information
Raphael Kubo da Costa committed Oct 17, 2023
1 parent 0d5f8b1 commit 537f841
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ urlPrefix: https://w3c.github.io/sensors/; spec: GENERIC-SENSOR
text: eavesdropping; url: eavesdropping
text: generic mitigations; url: mitigation-strategies
text: supported sensor options
text: automation
text: mock sensor type
text: mock sensor reading values
urlPrefix: https://w3c.github.io/accelerometer/; spec: ACCELEROMETER
type: dfn
text: device coordinate system
Expand Down Expand Up @@ -241,23 +238,13 @@ Abstract Operations {#abstract-operations}

Automation {#automation}
==========
This section extends the [=automation=] section defined in the Generic Sensor API [[GENERIC-SENSOR]]
to provide mocking information about the rate of rotation around the device's local three primary axes
for the purposes of testing a user agent's implementation of {{Gyroscope}} API.
This section extends [[GENERIC-SENSOR#automation]] by providing [=Gyroscope=]-specific virtual sensor metadata.

<h3 id="mock-gyroscope-type">Mock Sensor Type</h3>

The {{Gyroscope}} class has an associated [=mock sensor type=] which is
<a for="MockSensorType" enum-value>"gyroscope"</a>, its [=mock sensor reading values=]
dictionary is defined as follows:

<pre class="idl">
dictionary GyroscopeReadingValues {
required double? x;
required double? y;
required double? z;
};
</pre>
The [=per-type virtual sensor metadata=] [=map=] must have the following [=map/entry=]:
: [=map/key=]
:: "`gyroscope`"
: [=map/value=]
:: A [=virtual sensor metadata=] whose [=virtual sensor metadata/virtual sensor type=] is [=Gyroscope=] and [=reading parsing algorithm=] is [=parse xyz reading=].

Acknowledgements {#acknowledgements}
================
Expand Down

0 comments on commit 537f841

Please sign in to comment.