Support "event" sensor and sending "events" to the host #53
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 PR adds support for receiving published "events" (alternatively triggers or annotations).
event sensor
event
timestamp
:int64
, little endian, nanoseconds since unix epochbody length
:uint32
, little endian, number of bytes in bodyencoding
:uint32
, little endian, integer value representing encoding used to encode body0
(utf-8
) is supported.body length
bytes representing a string encoded withencoding
Sending "events" to the host
Hosts with an
event
sensor support receiving external events from clients. This is implemented via ZRE whispers whose content is a json encoded object with the following fields:"name"
: required, value is the event's title/label/name as a json string"timestamp"
: optional, value is the external event's timestamp in nanoseconds since Unix epoch as a json number. If this field is not provided, the host will use the reception time as timestamp.Valid events received by the host will be published to the
event
sensor. As a result, clients can receive an echo of their own events if they subscribe to theevent
sensor.This can be used by the client to calculate the round trip time and time offset to the host. The client procedure looks like this: