Commit 7cf00d54 authored by Kyle Sunden's avatar Kyle Sunden
Browse files

Merge branch 'measurement-id' into 'master'

add get_measurement_id

See merge request !61
parents c840a8fe df3493d2
Pipeline #275332243 passed with stage
in 47 seconds
......@@ -2,10 +2,11 @@
yep: 302
title: is-sensor
author: Blaise Thompson
status: draft
status: accepted
tags: trait
post-history: 2020-04-22
2020-07-14
2021-03-17
---
# Abstract
......@@ -24,14 +25,34 @@ The is-sensor trait enforces a consistent interface across all measurement devic
# Proposal
Fundamentally `is-sensor` daemons expose one or many named channels to clients.
Each channel may be a scalar or a multidimensional array.
Each channel may have units.
In many cases a single sensor daemon exposes a large volume of information over the wire.
Clients who wish to poll for updates may find it impractical to read out the entire state of the sensor every time.
For this reason, yaq defines measurement_id, an integer that incriments when the channel values are changed.
A very lightweight message get_measurement_id is offered for clients to poll for updates.
The measurement_id is also returned alongside channel information when get_measured is called.
Clients should expect measurement_id to overflow and typically should only watch for changes.
Many is-sensor daemons also implement the closely related trait has-measure-trigger ([YEP-310](../310)).
Daemons which implement is-sensor without has-measure-trigger are sensors that update "spontaniously" and cannot be software triggered.
Because this trait has no setters, daemons implementing only this trait should always be busy.
Daemons that also implement other traits, e.g. has-measure-trigger, do implement setters and therefore may release busy.
## message: get_measured
response: {type: map, values: [float, ndarray]}
Get most recent measured value.
Returns map of channel_name to measured_value.
Always returns additional key measurement_id.
## message: get_measurement_id
response: {'type': 'int'}
Get current measurement_id.
Clients are encouraged to watch for this to be updated before calling get_measured to get entire measurement.
## message: get_channel_names
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment