Hi,

as of version 2.90 the gpsd crew changed their protocol and API so
gps_poll() went away, causing compilation failures in src/CDeviceGPSD.cpp.

The following patch fixes that and should allow compilation with older
versions of gpsd as well (sorry, can't test that right now). From a
first cursory test, qlandkartegt still works with my patch :)
Sorry if this has been brought up before, but here is my patch:


Index: src/CDeviceGPSD.cpp
===================================================================
--- src/CDeviceGPSD.cpp (revision 2719)
+++ src/CDeviceGPSD.cpp (working copy)
@@ -138,6 +138,7 @@
 log_mutex( new QMutex() ),
 pipe_fd( _pipe_fd )
 {
+    gpsdata = NULL;
 }
 
 
@@ -149,7 +150,14 @@
 
 void CGPSDThread::run()
 {
+#if GPSD_API_MAJOR_VERSION >= 5
+       int socket;
+   
+    if( gpsdata = new gps_data_t )
+        socket = gps_open( "localhost", DEFAULT_GPSD_PORT, gpsdata );
+#else
     gpsdata = gps_open( "localhost", DEFAULT_GPSD_PORT );
+#endif
     if( !gpsdata )
     {
         // TODO: message box (from other thread)
@@ -187,13 +195,20 @@
             }                    // if
             else if( FD_ISSET( gpsdata->gps_fd, &fds ) )
             {
+#if GPSD_API_MAJOR_VERSION >= 5
+                gps_read( gpsdata );
+#else
                 gps_poll( gpsdata );
+#endif
                 if( !decodeData() ) break;
             }                    // else if
         }                        // else if
     }                            // while
 
     gps_close( gpsdata );
+#if GPSD_API_MAJOR_VERSION >= 5
+    delete gpsdata;
+#endif
     qDebug() << "thread done";
 }
 

Regards,
Christoph

-- 
Spare Space

------------------------------------------------------------------------------
Forrester Wave Report - Recovery time is now measured in hours and minutes
not days. Key insights are discussed in the 2010 Forrester Wave Report as
part of an in-depth evaluation of disaster recovery service providers.
Forrester found the best-in-class provider in terms of services and vision.
Read this report now!  http://p.sf.net/sfu/ibm-webcastpromo
_______________________________________________
Qlandkartegt-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qlandkartegt-users

Reply via email to