-
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
Clarify terminology #78
Comments
My knee-jerk response would be: |
Went for:
Still open to change but closing this as fixed. |
@timvolodine had alternate suggestions here. |
Seems to me the most comfortable name for the third sensor state is the one used in the text introducing that section: "listening". I'd go along with Anssi's choices with that change, so: onchange |
Regarding the 'onchange' event, generally I am inclined towards something with 'update' in it, e.g. 'onupdate', 'ondataupdate' etc.. That's because 'onchange' is a bit imprecise since a sensor can produce same readings for sequential timestamps. The state names all make sense. But apart from the naming however I am wondering how this would look like in case there is no sensor available. So upon construction the state would always be "idle" independent of whether the sensor can be activated? Once errored would it remain errored if we call stop()? // e.g. in normal case // in no-sensor case |
My understanding is |
Settled in #104 (comment). |
Event name
So there's going to be only one event name and this event is going to be fired either whenever the UA feels like it or at specific intervals depending on the reporting mode. What should we call it?
onchange
ondata
onupdate
onreading
onsensorreading
Sensor states
A
Sensor
instance can be in one of three states. It can be sitting around doing nothing. It can have manifested its intention to get data from its underlying sensor. Or it can be actively be listening to that sensor's output.What do we call those?
"idle"
|"activating"
|"active"
"inactive"
|"activating"
|"active"
"idle"
|"registering"
|"registered"
"idle"
|"starting"
|"started"
"idle"
|"starting"
|"running"
Start/Stop
Similarly,
Sensor
instances can walk through these states by calling one of two methods. The first method moves a sensor object from loitering to actually getting data (starting up the underlying sensor in the process if that one wasn't running already). The second method just signals that the sensor object is no longer interested in hearing about the underlying sensor's data output and that the latter is now free to shut down if there isn't someone else interested in its data.Of course, this ties in with sensor state names.
Proposals:
start
|stop
activate
|deactivate
register
|deregister
setup
|teardown
provision
|release
initialize
|release
The text was updated successfully, but these errors were encountered: