1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
$NetBSD: patch-ab,v 1.1 2011/03/31 20:21:34 drochner Exp $
for gpsd-2.96
--- src/CDeviceGPSD.h.orig 2011-03-15 20:13:04.000000000 +0000
+++ src/CDeviceGPSD.h
@@ -56,7 +56,7 @@ class CGPSDThread : public QThread
protected:
virtual void run();
- gps_data_t* gpsdata;
+ gps_data_t* gpsdata, gpsdata_store;
bool decodeData();
$NetBSD: patch-ac,v 1.1 2011/03/31 20:21:34 drochner Exp $
for gpsd-2.96
--- src/CDeviceGPSD.cpp.orig 2011-03-15 20:13:04.000000000 +0000
+++ src/CDeviceGPSD.cpp
@@ -138,6 +138,7 @@ CGPSDThread::CGPSDThread( int _pipe_fd )
log_mutex( new QMutex() ),
pipe_fd( _pipe_fd )
{
+ gpsdata = &gpsdata_store;
}
@@ -149,8 +150,8 @@ CGPSDThread::~CGPSDThread()
void CGPSDThread::run()
{
- gpsdata = gps_open( "localhost", DEFAULT_GPSD_PORT );
- if( !gpsdata )
+ int res = gps_open( "localhost", DEFAULT_GPSD_PORT, gpsdata );
+ if( res )
{
// TODO: message box (from other thread)
qDebug() << "gps_open failed.";
@@ -187,7 +188,7 @@ void CGPSDThread::run()
} // if
else if( FD_ISSET( gpsdata->gps_fd, &fds ) )
{
- gps_poll( gpsdata );
+ gps_read( gpsdata );
if( !decodeData() ) break;
} // else if
} // else if
|