[Top][All Lists]

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

Re: [gpsd-users] GPSCTL do more than you ask him to do.

From: Steve Bourland
Subject: Re: [gpsd-users] GPSCTL do more than you ask him to do.
Date: Fri, 16 Oct 2015 11:16:40 -0500 (CDT)
User-agent: Alpine 2.02 (DEB 1266 2009-07-14)

First I hope this works well, I have been lurking a long time on this list and not posting much at all, let alone in response to something...


Message: 6
Date: Thu, 15 Oct 2015 14:41:47 -0700
From: "Gary E. Miller" <address@hidden>
To: "Eric S. Raymond" <address@hidden>
Cc: Cuningan Re Set <address@hidden>,     gpsd-users
Subject: Re: [gpsd-users] GPSCTL do more than you ask him to do.
Message-ID: <address@hidden>
Content-Type: text/plain; charset="us-ascii"

Yo Eric!

On Thu, 15 Oct 2015 17:09:39 -0400
"Eric S. Raymond" <address@hidden> wrote:

Everytime I started to look at gpsctl I choked.

Why, in particular?

Hard to say what I don't understand about a subject I don't understand.  :-)

I would like a simple function, dependent on GPS type, that I could pass
a simple control string and it would do the checksum/framing/etc. and send
the string.  No more.

So I could code something like:

        gpsctl -t u-blox --set-pps-width 100

Then in main() maybe call that calls a function like:
        set_pps_width( 'u-blox', 100)

That would know the string to send to some GPS types, hopefully u-blox,
to set the PPS width to 100 mSec.

send_pps_width() would call a function like:
        send_ublox( 'XXYYZZ' );

send_ublox() would know how to checksum and frame XXYYZZ and sent to the

For some GPS, like garmin serial, a wait for ACK would also be needed, so
some primitive scheduler.

But not high on my TODo list.


Yo Gary!
I pretend to be a C programming at work at times, and get incredible utility out of gpsd so I would love to find a way to help.

My thinking on re-doing gpsctl would be to have it structured by devices then by command instead of command then device. My mental image is instead of having commands to send to u-blox in multiple locations (one is in the set-pps-width, another in set-nmea-output, another in some other command that the device may not have....), have main call a device handler and pass the command request and parameters to the handler in a generic manner (all device handlers have the same form). The handler will then know what the device can do (in one place) and have one set of code for formatting and sending the various commands. If devices don't offer an option, return that the option isn't available. Seems cleaner to me (on first read of your message to Eric)?

I haven't looked at the gpsctl code at all, so I have no idea what it looks like now. I have no idea if I can even offer up any help to try and restructure/clean it up. I would like to toss out the idea that I would love to try and give back to the project at some point...and this could be the entry point?

                                        Thanks for all your work,

reply via email to

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