Comment 4 for bug 1879272

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Repro steps:

Start without a device like /etc/defaul/gpsd
  DEVICES=""

Attach a json watcher like to gpsd like
$ telnet localhost 2947
then enter
?WATCH={"enable":true,"json":true};

This looks like:

$ telnet localhost 2947
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
{"class":"VERSION","release":"3.20","rev":"3.20","proto_major":3,"proto_minor":14}
?WATCH={"enable":true,"json":true};
{"class":"DEVICES","devices":[]}
{"class":"WATCH","enable":true,"json":true,"nmea":false,"raw":0,"scaled":false,"timing":false,"split24":false,"pps":false}

Then on another console attach the device:
$ sudo gpsdctl add /dev/ttyUSB0

In the telnet socket watch you will see:
  {"class":"DEVICE","path":"/dev/ttyUSB0","activated":2020-05-20T05:42:54.598Z}

And the last element in this is violating JSON.
With the fix this no more happens.