SignalK / signalk-server

An implementation of a Signal K central server for boats.
http://signalk.org
Apache License 2.0
298 stars 150 forks source link

Uniform canboatjs:unparsed:object event payload #1667

Open tkurki opened 5 months ago

tkurki commented 5 months ago

Now the payload data over websocket can be a string or {pgn: number, data: {data: number[], lenght: number} or any format that canboatjs.fromPgn.parse can handle as the input from a pipedprovider.

The payload should be the input data and n2k metadata pgn, src, dest, priority so that any client interested in unparsed data can expect just one format.

One implementation idea is to use the callback argument to parse, first modifying fromPgn._parse to call it with uniform data.