Re: GPSd again

<[email protected]>, [email protected] Tue, 10 Sep 2002 00:37:57 -0500 (CDT)
Newsgroups gmane.network.wireless.bsd.airtools
Message-ID <[email protected]>
> Back in the March archives someone mentioned a fix to allow dstumbler
> to work with GPSd instead of talking directly to the serial port (I
> have the binary-only Earthmate).  Is this around somewhere?  

I have a 'hack' for GPSd client, the code works, but is really ugly, and
I haven't had a chance to get the latest code from CVS and migrate my
changes to the latest dstumbler release code.

If anybody here would like to work on this, I've included my notes below.

Kevin Kadow


 
==========================================================================
Notes on GPSd             10September2002                [email protected]
==========================================================================

Summary:

Basically, I just added support for 'host:port' to the '-g' flag, where a
"device" that does not start with a "/" and contains a ":" indicates that
that host and port should be contacted using TCP as a gpsd server.

There is no 'connect' banner when talking to GPSd

Commands are case-insenstive, and responses start with GPSD, e.g.:

		$ telnet 127.0.0.1 2947
		Trying 127.0.0.1...
		Connected to localhost.
		Escape character is '^]'.
		S
		GPSD,S=0
		s
		GPSD,S=0
		P
		GPSD,P=0.000000 0.000000
		^C


The 'right' way to interface to GPSd:

When a position fix is needed, send a 's' command. If the result is 0
(see above), there is no GPS fix, so we're done. Otherwise, send a 'p'
command, which will result in "GPSD,P=LAT LONG".  The two values are
returned as floating point numbers, and are not in the NMEA
DegreesMinutesSeconds format.
	Advantage: No more extra load select()ing on the GPS fd.
	Drawbacks: No satellite status.
	           Returns 'wrong' format LAT/LONG values.


The 'raw' interface:

Lastly 'R' will put the session in 'raw' mode, where the client receives
all the sentences from the GPS device as they are processed by GPSd.
This appears to be the only way to get details on satellite count,
positions, and other such extended data.

	Drawbacks: Client does all the work.


Linking against 'libgpsd.a' is pretty much useless for developing
non-Motif clients, but the sample code in 'netlib.c' might be useful.


Kevin Kadow