[josm-dev] livegps plugin update for new gpsd 2.9x (future 3.0) protocol

Timo Juhani Lindfors timo.lindfors at iki.fi
Mon Jun 21 11:24:27 BST 2010


Gleb Smirnoff <glebius at glebius.int.ru> writes:
>   Here is update. I've made LiveGpsAcquirer to support both old and
> new protocols. Also a lot of code was tossed, rewritten and cleaned
> up. So better look at the final file than at a diff. See it in attach.

Btw, the python-gps library seems to do the autodetection of old and
new version in a pretty similar way:

if self.response.startswith("{") and self.response.endswith("}\r\n"):
    self.json_unpack(self.response)
    self.__oldstyle_shim()
    self.newstyle = True
    self.valid |= PACKET_SET
elif self.response.startswith("GPSD"):
    self.__oldstyle_unpack(self.response)
    self.valid |= PACKET_SET






More information about the josm-dev mailing list