[Xastir-dev] Fun with gpsd... not!

Curt, WE7U curt.we7u at gmail.com
Fri Jun 18 12:58:45 EDT 2010


I started down the path of writing to the new API that GPSD clients
are supposed to use.  The new autotools tweaks work to detect
whether the libgps and gps.h files are in place.  To get this to
work properly I had to rename our own src/gps.h to src/xastir_gps.h
(not checked in yet).

Now I'm in the middle of interface.c changes and find that my
version of libgps is pre-2.90 and therefore doesn't have the
gps_stream() call that the GPSD web pages recommend we use.

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.

In order to support this I may have to add more autotools tests to
check whether libgps is present, then to check which version of the
API we have.  I'm considering skipping protocol #1 above and
requiring libgps for GPSD support from now on, simplifing our code.
I think systems as old as fall of 2004 would be able to still use
GPSD this way, as long as they installed the gpsd client libraries
which include libgps.

The code in interface.c is going to get even uglier.  If anyone can
think of a good way to isolate this other than a bunch of #ifdef's,
please let me know.

I'm also wracking my brain over how to do the libgps API code in
separate threads like the rest of the interface code is written to
support.  Protocols 2 & 3 above appear to be set up for us to read
directly out of a structure when an "OK" flag is set for us, instead
of reading periodically from a socket stream as we do now.  All of
the interface.c code is set up to have a read thread and a write
thread to talk to each device or socket, but the libgps API takes
care of much of that for us.  I'll probably have to separate out the
libgps code from the rest of the interface.c code now as it's done
so differently.

-- 
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!"



More information about the Xastir-dev mailing list