2020-01-26, 10:02 PM
(2020-01-25, 08:06 PM)seandepagnier Wrote: So I am really just looking for a way to simplify the protocol in the most common case (single vessel single data source) but I don't know if it's possible, and pypilot can certainly be extended to support more of the signalk standard, changing key names or methods is no problem, but for now they are purposefully different.
For sending updates between processes the delta format is just the thing:
{"updates": {"$source": "GPS", "values": [{"path": "navigation.courseOverGround", "value": "3.14159"}]}}
OR
{
"updates": {
"$source": "GPS",
"values": [
{
"path": "navigation.courseOverGround",
"value": "3.14159"
}
]
}
}
A bit more verbose, but context is optional (assumed to be "self") and timestamp also. A bit more complexity in the format allows the format to be used to send several updates at a time. In the end this is key-values, with a bit of metadata on the envelope.
The format you quoted is the full format, that I practically never use when coding, except when debugging stuff, because it is very easy to use a browser to see what's going on and get a snapshot of the data.
With http you can request
everything: http://demo.signalk.org/signalk/v1/api/
just "self" data: http://demo.signalk.org/signalk/v1/api/vessels/self
a subtree: http://demo.signalk.org/signalk/v1/api/v...nvironment
but for streaming updates you want to do tcp or ws and deltas.