Skip to content
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

Merged
merged 1 commit into from
Oct 4, 2017

Conversation

pozdnyakov
Copy link

@pozdnyakov pozdnyakov commented Oct 3, 2017

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 Sensor discovery #7.

Preview | Diff

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

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?

Copy link
Author

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.

Copy link

@alexshalamov alexshalamov Oct 4, 2017

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.

Copy link
Member

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.

Copy link

@alexshalamov alexshalamov left a 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
Copy link
Member

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.
@pozdnyakov
Copy link
Author

@anssiko thanks for the catch! it is fixed now.

@pozdnyakov pozdnyakov merged commit 40b0b61 into w3c:master Oct 4, 2017
@pozdnyakov pozdnyakov deleted the dropIdentifyingParamaters branch November 29, 2017 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants