-
Notifications
You must be signed in to change notification settings - Fork 30
Serialization Format
Devin Conley edited this page Feb 16, 2017
·
1 revision
(This information will likely only be useful if you are planning to write an alternative listener to handle graphing)
The library relies on flattened JSON to send information to the listener. There are two separate packet formats, a configuration format and a data-only format. The full configuration packet is only sent at a 50-count interval to cut down on data transfer costs. The keys to these packets are as follows:
- "t" : time (ms)
- "ng" : number of graphs
- "lu" : last updated (ms)
- "g" : JSON array of graph info
- "t" : graph title
- "xvy" : graph type ( 1: x vs y, 0: time graph )
- "pd" : graph points displayed
- "sz" : number of variables
- "l" : JSON array of variable labels (string)
- "c" : JSON array of variable colors (string)
- "d" : JSON array of variable data (double)
Full configuration packet
{
"t": 4533,
"ng": 1,
"lu": 1,
"g": [{
"t": "5 variable time graph",
"xvy": 0,
"pd": 1000,
"sz": 5,
"l": ["v label", "w label", "x label", "y label", "z label"],
"c": ["green", "orange", "cyan", "yellow", "pink"],
"d": [1.1532736, 4.0000000, -5.5478616, 5.8288255, -2.7687020]
}]
}
Data-only packet
{
"t": 4554,
"g": [{
"d": [1.2977701, 4.0000000, -5.3263960, 5.9243946, -2.6631980]
}]
}