gpsd-users
[Top][All Lists]
Advanced

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

Re: [gpsd-users] issues with libgps(-dev)


From: Charles Curley
Subject: Re: [gpsd-users] issues with libgps(-dev)
Date: Fri, 17 May 2013 07:36:06 -0600

On Thu, 25 Apr 2013 22:00:51 +0200
Folkert van Heusden <address@hidden> wrote:

> Hi,
> 
> I have a small issue with libgps (I use the C library):
> 
> I found that the "status"-field in the structure, if that field is not
> STATUS_NO_FIX, that does not neccessarily mean that there's a fix.
> So what I now do is check if LATLON_SET is set in the 'set'-field AND
> also if status != STATUS_NO_FIX.
> Is that the way to go you think?
> 
> 
> regards
> 

Yep. What I do is:


if (gpsdata.set & MODE_SET) {
    switch (gpsdata.fix.mode) {

...

    case MODE_2D:
        if ((gpsdata.set & LATLON_SET)) {
            formatLat (gpsdata.fix.latitude);
            formatLong (gpsdata.fix.longitude);

...

    case MODE_3D:
        if ((gpsdata.set & (LATLON_SET|ALTITUDE_SET))) {
            formatLat (gpsdata.fix.latitude);
            formatLong (gpsdata.fix.longitude);

...


http://charlescurley.com/blog/articles/gnome-gps_a_simple_gtk_gps_monitor/index.html

-- 

Charles Curley                  /"\    ASCII Ribbon Campaign
Looking for fine software       \ /    Respect for open standards
and/or writing?                  X     No HTML/RTF in email
http://www.charlescurley.com    / \    No M$ Word docs in email

Key fingerprint = CE5C 6645 A45A 64E4 94C0  809C FFF6 4C48 4ECD DFDB



reply via email to

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