gpsd-dev
[Top][All Lists]
Advanced

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

[gpsd-dev] trouble with new gpsd API 5


From: Kevron Rees
Subject: [gpsd-dev] trouble with new gpsd API 5
Date: Thu, 29 Mar 2012 15:03:59 -0700
User-agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120313 Thunderbird/11.0

I seem to be having trouble with the new API on Ubuntu 12.04. I try to open up a connection to gpsd and I get a -1, unknown error. Here is the relevant code snippit:

#if(GPSD_API_MAJOR_VERSION >= 5)
    int ret = gps_open("localhost","2947", gps);

    if(ret != 0)
    {
        qWarning("failed to open gps");
        qDebug()<<"return value: "<<ret;
        (void)fprintf(stderr,"no gpsd running or network error: %d, %s\n",
                              errno, gps_errstr(errno));
        return;
    }
#else
    gps = gps_open("localhost","2947");

#endif

    if(gps)
    {
        gps_stream(gps, WATCH_ENABLE | WATCH_JSON, NULL);

        QTimer *timer = new QTimer(this);
        timer->setInterval(1000);

        connect(timer, SIGNAL(timeout()), this, SLOT(updateGpsposition()));

        timer->start();
    }

The old API still works. I'm wondering if I'm doing something obviously wrong with the new API.

cheers,




reply via email to

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