-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework the 'Connect to Sensor' abstract operation #300
Conversation
1. Return true. | ||
1. If the device has multiple [=device sensors=] which can provide [=sensor readings|readings=] | ||
for |type|, then | ||
1. If |type| has an associated [=default sensor=], then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If platform does not have concept of default sensor, false would be returned, is that expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but that's not a platform concept, default sensor is defined in an extension API, e.g. here https://www.w3.org/TR/accelerometer/#model, so if a device has multiple accelerometers, the UA will assume one of them to be the default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, additional text addresses my concern about vague definition of default sensor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Outside this change in Sensor.start(), where you invoke this connect to sensor abstract operation, you should change:
let connected be the result of invoking connect to sensor.
To
let connected be the result of invoking connect to sensor with sensor_instance as argument.
Might be a separate patch, or could be rolled into this one since related.
eee447e
to
61be6d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing my concern!
1. Return true. | ||
1. If the device has multiple [=device sensors=] which can provide [=sensor readings|readings=] | ||
for |type|, then | ||
1. If |type| has an associated [=default sensor=], then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Outside this change in Sensor.start(), where you invoke this connect to sensor abstract operation, you should change:
let connected be the result of invoking connect to sensor.
To
let connected be the result of invoking connect to sensor with sensor_instance as argument.
Might be a separate patch, or could be rolled into this one since related.
This patch: - Reworks the 'Connect to Sensor' abstract operation, so that it properly handles multiple device sensors - Drops 'identifying parameters' as those are unnecessary unless the Sensor Discovery functionality is in place. We might put them back when fixing w3c#7.
61be6d7
to
7600ff4
Compare
@anssiko thanks for the catch! it is fixed now. |
This patch:
it properly handles multiple device sensors
unless the Sensor Discovery functionality is in place.
We might put them back when fixing Sensor discovery #7.
Preview | Diff