w3c / proximity

Proximity
https://www.w3.org/TR/proximity/
Other
13 stars 13 forks source link

What's the distance value when the visible surface is beyond the max value? #30

Closed xiuqijix closed 6 years ago

xiuqijix commented 6 years ago

In previous version, the value is defined between the maximum sensing distance and the minimum sensing distance:

The current device proximity is a value that represents the proximity of the hosting device to a physical >object (i.e., some value between the maximum sensing distance and the minimum sensing distance).

In latest spec, the value isn't limited but there is a sensing range description:

Note: If the implementation is unable to provide the near value, it could infer the near value from the >value of distance. For example, if distance is not equal to max, it could imply there is an object in the >sensing range.

I want to know when there is no object in the sensing range, what's the distance value?

riju commented 6 years ago

From the Generic Sensor spec, since

The value of all latest reading entries is initially set to null

I would say, distance value would initially (or when there is no object in sensing range) be null

anssiko commented 6 years ago

It'd be logical for the attribute to be null if not within the sensing range.

Proposal: add the following to https://w3c.github.io/proximity/#proximity-sensor-distance:

If the object is outside the sensing distance, it must return null.

Comments?

xiuqijix commented 6 years ago

I agree, that will be clearer for end user.

anssiko commented 6 years ago

I submitted a PR to address this issue (and #29), see: https://github.com/w3c/proximity/pull/31

xiuqijix commented 6 years ago

Thanks @anssiko, the issue had been addressed in https://github.com/w3c/proximity/pull/31, close it.