gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-dev] gpsprof giving some errors


From: Nuno Gonçalves
Subject: [gpsd-dev] gpsprof giving some errors
Date: Sat, 22 Aug 2015 23:49:09 +0100

It seems there are some issues with the DEVICE object specification:

Consider this message produced by GPSD latest revision:

{"class":"DEVICE","path":"tcp://localhost:8932","driver":"NMEA0183","activated":"2015-08-22T22:02:47.576Z","flags":1}


But at http://www.catb.org/gpsd/gpsd_json.html, we see that the DEVICE
object MUST always contain a "parity" and "stopbit" elements. Since
they wouldn't make sense this case should be a documentation error.

Also, gpsprof assumes a serial connection, and will fail with a device
connected via TCP like this example.

The following patch would fix this:

diff --git a/gpsprof b/gpsprof
index 59db153..9d15e28 100755
--- a/gpsprof
+++ b/gpsprof
@@ -59,6 +59,10 @@ class plotter:

     def whatami(self):
         "How do we identify this plotting run?"
+       if 'bps' not in self.device:
+               return "%s, %s, %s" % \
+                       (gps.misc.isotime(self.start_time),
+                       self.device.get('driver', "unknown"),
self.device['path'])
         return "%s, %s, %d %dN%d, cycle %ds" % \
                (gps.misc.isotime(self.start_time),
                 self.device.get('driver', "unknown"), self.device['bps'],


And finally, gpsd always reports a error when gpsprof does its business:

gpsd:ERROR: response: {"class":"ERROR","message":"No such device as
None"}\x0d\x0a

Regards,
Nuno



reply via email to

[Prev in Thread] Current Thread [Next in Thread]