The socketio protocol currently uses these events:
sensor <-> server:
sensor receives connected and sends back register-sensor
server receives register-sensor and
emits sensor-info to subscribers
sends back send-data to sensor
sensor receives send-data and emits sensor-reading in a loop
If/when the server disconnects from the sensor, the loop detects that, stops sending readings, and sits idle. If/when the server reconnects, the steps above are repeated again.
sensor <-> client:
client receives connected and sends back register-client
server receives register-client and
sends back hab-info and sensor-info
add the client to the list of subscribers
server sends step-batch to all subscribers in a loop
If/when the server disconnects from the client, the client stops receiving batches and sits idle. If/when the server reconnects, the steps above are repeated again.
Once the protocol is fully defined, it should be added to the documentation. For each event, it should specify when it's emitted, the kind of object sent with the event (if any), if it can be sent multiple times.
@hiyaryan suggests to add a sensor-status. This could either be a separate event that is only sent when the status of sensor changes, or it could be added in the each bundle, to make it easier to track the status for each individual bundle.
The socketio protocol currently uses these events:
sensor <-> server:
connected
and sends backregister-sensor
register-sensor
andsensor-info
to subscriberssend-data
to sensorsend-data
and emitssensor-reading
in a loopIf/when the server disconnects from the sensor, the loop detects that, stops sending readings, and sits idle. If/when the server reconnects, the steps above are repeated again.
sensor <-> client:
connected
and sends backregister-client
register-client
andhab-info
andsensor-info
step-batch
to all subscribers in a loopIf/when the server disconnects from the client, the client stops receiving batches and sits idle. If/when the server reconnects, the steps above are repeated again.
Once the protocol is fully defined, it should be added to the documentation. For each event, it should specify when it's emitted, the kind of object sent with the event (if any), if it can be sent multiple times.
@hiyaryan suggests to add a
sensor-status
. This could either be a separate event that is only sent when the status of sensor changes, or it could be added in the each bundle, to make it easier to track the status for each individual bundle.For reference, this is an example of
sensor-info
:and this is an example of reading: