On Fri, 18 Jun 2010, Curt, WE7U wrote:
In other words I'm coding to an API that just changed within the
last few months and the API we've been using for the last six years
is no more, yet my systems have an API that's in-between those two.
I could code for three different GPSD API's:
1) Socket connect + send "R\n\r" (as we've done since 2004).
2) Pre-2.90 API that a lot of OS'es currently use.
3) Post-2.90 API.
Hah! There's a way. It's not the recommended way, but when did I
let that stop me?
We can do the below. '#' are things I do as root. '>' are things I
do as a normal user:
# Remove older GPSD & client RPM's
> ./configure; make; sudo make install GPSD 2.74
# ldconfig
# /usr/local/sbin/gpsd /dev/ttyS0
> telnet localhost 2947
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
{"class":"VERSION","release":"2.94","rev":"2010-06-18T21:38:28","proto_major":3,"proto_minor":2}
Then I type:
?WATCH={"enable":true,"nmea":true}
NMEA sentences start coming across.
We most likely can continue to use our current method of creating
separate threads for read & write for GPSD connections. We'd skip
using libgps, going against the recommendations of the GPSD folks.
Considering that GPSD is such a small part of what we do I'd rather
keep to the low-level socket interface instead of re-writing all of
our GPSD client code to work with their new API. If/when they break
their API on us again it should only require small tweaks to Xastir
to correspond.
We should be able to parse the returned strings from the connect:
"release":"2.94"
or
"proto_major":3,"proto_minor":2
To decide what strings to send to GPSD to get it to start spitting
out NMEA strings. What I don't know yet is whether this will work
with GPS USB hot-plugging, GPS'es using SiRF binary or other binary
modes.
The alternative, supporting 2 or 3 protocols and rewriting a bunch
of code to use libgps, is daunting. Particularly if we want to
support the protocol we had been using before as well.
--
Curt, WE7U. <http://www.eskimo.com/~archer>
APRS: Where it's at! <http://www.xastir.org>
Lotto: A tax on people who are bad at math. - unknown
Windows: Microsoft's tax on computer illiterates. - WE7U.
The world DOES revolve around me: I picked the coordinate system!"
_______________________________________________
Xastir-dev mailing list
[email protected]
http://lists.xastir.org/cgi-bin/mailman/listinfo/xastir-dev