[Marble-commits] KDE/kdeedu/marble/src/plugins/positionprovider/gpsd
Jens-Michael Hoffmann
jensmh at gmx.de
Fri Dec 18 22:03:42 CET 2009
SVN commit 1063585 by jmhoffmann:
Make gpsd positionprovider plugin compile with gpsd API 3, as of gpsd 2.90+.
M +11 -1 GpsdConnection.cpp
--- trunk/KDE/kdeedu/marble/src/plugins/positionprovider/gpsd/GpsdConnection.cpp #1063584:1063585
@@ -22,6 +22,9 @@
{
gps_data_t* data = m_gpsd.open();
if ( data ) {
+#if GPSD_API_MAJOR_VERSION == 3
+ m_gpsd.stream( WATCH_ENABLE );
+#endif
connect( &m_timer, SIGNAL( timeout() ), this, SLOT( update() ) );
m_timer.start( 1000 );
} else
@@ -30,7 +33,14 @@
void GpsdConnection::update()
{
- gps_data_t* data = m_gpsd.query( "o" );
+ gps_data_t* data;
+#if GPSD_API_MAJOR_VERSION == 2
+ data = m_gpsd.query( "o" );
+#elif GPSD_API_MAJOR_VERSION == 3
+ while ((data = m_gpsd.poll()) && !(data->set & POLICY_SET)) {
+ data = m_gpsd.poll();
+ }
+#endif
if ( data )
emit gpsdInfo( *data );
}
More information about the Marble-commits
mailing list