-
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
Overhaul frequency management in the specification #468
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit addresses a few issues with the way frequency management was handled in the specification: 1. "Sampling frequency" was interchangeably used as a number as well as an interval ("sampling frequency bounds"), and the latter was not even properly defined. 2. The actual bounds were not properly defined, and neither was the clamping process that used them. 3. There were too many frequency-related terms in use. Let us start with the changes in the concepts and definitions: - A platform sensor has a sampling frequency, a positive number or null. It represents the frequency at which the platform sensor attempts to retrieve data from the device sensor and it is calculated in an implementation-defined manner based on the `[[frequency]]` of the associated Sensor objects. It is therefore a mixture of the previous "sampling frequency" and "requested sampling frequency" definitions. . How the sampling process works is implementation-defined: it could be polling, or requesting updates at this interval, or something else entirely. - A device sensor has a sampling frequency. It is similar to the above, but operating system or hardware dependent and opaque to this specification. . As such, the device sensor may choose a sampling frequency that differs from the platform sensor's sampling frequency and we have no control over it. - A device sensor MAY report lower and/or upper sampling frequency bounds. With the above, the actual sampling bounds are defined and checked: - A sensor type MUST have lower and upper sampling frequency bounds. The lower bound is "max(implementation-defined value, optional spec-defined value)", and the upper bound is "min(implementation-defined value, optional spec-defined value)". - A new algorithm returns a platform sensor's lower and upper sampling bounds as a tuple "(max(optional device sensor lower bound, sensor type lower bound), min(optional device sensor upper bound, sensor type upper bound))". - A Sensor's `[[frequency]]` is always set to a value within a platform sensor's sampling bounds in "Connect to a sensor" (before that it might not have an associated platform sensor and should be in the "activated" state). - "Set sensor settings" requires that the platform sensor sampling value calculated based on its associated sensors' `[[frequency]]` values lies within its sampling bounds. The "optimal sampling frequency" and "requested sampling frequency" <dfn>s have been removed, and so has the "Find the reporting frequency of a sensor object" algorithm, which addresses point (3). The "Automation" section has only received enough changes to avoid Bikeshed errors and warnings, as the entire section is being rewritten. Related to #463.
rakuco
force-pushed
the
overhaul-frequency-management
branch
from
August 2, 2023 21:18
7414cd8
to
ab2e54f
Compare
rakuco
changed the title
overhaul frequency management
Overhaul frequency management in the specification
Aug 2, 2023
reillyeon
requested changes
Aug 8, 2023
Compared to the original suggestion: - The note was moved after we say that a device sensor's sampling rate is opaque. - The note has been word-wrapped at 100 characters. - I've added some `[=references=]` to terms from the spec.
reillyeon
approved these changes
Aug 8, 2023
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.
LGTM with nits
Co-authored-by: Reilly Grant <[email protected]>
Co-authored-by: Reilly Grant <[email protected]>
github-actions bot
added a commit
that referenced
this pull request
Aug 8, 2023
SHA: f0dca6f Reason: push, by rakuco Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit addresses a few issues with the way frequency management was
handled in the specification:
interval ("sampling frequency bounds"), and the latter was not even
properly defined.
process that used them.
Let us start with the changes in the concepts and definitions:
It represents the frequency at which the platform sensor attempts to
retrieve data from the device sensor and it is calculated in an
implementation-defined manner based on the
[[frequency]]
of theassociated Sensor objects. It is therefore a mixture of the previous
"sampling frequency" and "requested sampling frequency" definitions.
polling, or requesting updates at this interval, or something else
entirely.
operating system or hardware dependent and opaque to this specification.
from the platform sensor's sampling frequency and we have no control
over it.
With the above, the actual sampling bounds are defined and checked:
lower bound is "max(implementation-defined value, optional spec-defined
value)", and the upper bound is "min(implementation-defined value,
optional spec-defined value)".
bounds as a tuple "(max(optional device sensor lower bound, sensor type
lower bound), min(optional device sensor upper bound, sensor type upper
bound))".
[[frequency]]
is always set to a value within a platformsensor's sampling bounds in "Connect to a sensor" (before that it might
not have an associated platform sensor and should be in the "activated"
state).
calculated based on its associated sensors'
[[frequency]]
values lieswithin its sampling bounds.
The "optimal sampling frequency" and "requested sampling frequency" s
have been removed, and so has the "Find the reporting frequency of a sensor
object" algorithm, which addresses point (3).
The "Automation" section has only received enough changes to avoid Bikeshed
errors and warnings, as the entire section is being rewritten.
Related to #463.
Preview | Diff