Skip to content

Commit

Permalink
Merge pull request #73 from JuhaVainio/update-automation-section
Browse files Browse the repository at this point in the history
Rewrite Automation section after changes in Generic Sensor API spec
  • Loading branch information
anssiko authored Nov 2, 2023
2 parents a35f6d1 + 99ba593 commit 7cc9b19
Showing 1 changed file with 22 additions and 32 deletions.
54 changes: 22 additions & 32 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ urlPrefix: https://w3c.github.io/sensors/; spec: GENERIC-SENSOR
text: user identifying; url: user-identifying
text: generic mitigations; url: mitigation-strategies
text: supported sensor options
text: automation
text: mock sensor type
text: mock sensor reading values
urlPrefix: https://www.w3.org/TR/screen-orientation/; spec: SCREEN-ORIENTATION
type: dfn
text: current orientation type; url: dfn-current-orientation-type
Expand Down Expand Up @@ -428,42 +425,35 @@ Abstract Operations {#abstract-opertaions}

Automation {#automation}
==========
This section extends the [=automation=] section defined in the Generic Sensor API [[GENERIC-SENSOR]]
to provide mocking information about the [=acceleration=] applied to the X, Y and Z axis of a device
that hosts the sensor for the purposes of testing a user agent's implementation of {{Accelerometer}},
{{LinearAccelerationSensor}} and {{GravitySensor}} APIs.

<h3 id="mock-accelerometer-type">Mock Sensor Type</h3>
This section extends [[GENERIC-SENSOR#automation]] by providing [=Accelerometer=]-specific virtual sensor metadata.

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

<pre class="idl">
dictionary AccelerometerReadingValues {
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=]
:: "`accelerometer`"
: [=map/value=]
:: A [=virtual sensor metadata=] whose [=virtual sensor metadata/virtual sensor type=] is [=Accelerometer=] and [=reading parsing algorithm=] is [=parse xyz reading=].

The {{LinearAccelerationSensor}} class has an associated [=mock sensor type=] which is
<a for="MockSensorType" enum-value>"linear-acceleration"</a>, its [=mock sensor reading values=]
dictionary is defined as follows:
Linear Accelerometer automation {#linear-accelerometer-automation}
-----------------------

<pre class="idl">
dictionary LinearAccelerationReadingValues : AccelerometerReadingValues {
};
</pre>
The [=per-type virtual sensor metadata=] [=map=] must have the following [=map/entry=]:
: [=map/key=]
:: "`linear-acceleration`"
: [=map/value=]
:: A [=virtual sensor metadata=] whose [=virtual sensor metadata/virtual sensor type=] is [=Linear Acceleration Sensor=] and [=reading parsing algorithm=] is [=parse xyz reading=].

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

<pre class="idl">
dictionary GravityReadingValues : AccelerometerReadingValues {
};
</pre>
The [=per-type virtual sensor metadata=] [=map=] must have the following [=map/entry=]:
: [=map/key=]
:: "`gravity`"
: [=map/value=]
:: A [=virtual sensor metadata=] whose [=virtual sensor metadata/virtual sensor type=] is [=Gravity Sensor=] and [=reading parsing algorithm=] is [=parse xyz reading=].

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

0 comments on commit 7cc9b19

Please sign in to comment.