Diffstat (limited to 'noncore/net/wellenreiter/gui/gps.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/gps.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/net/wellenreiter/gui/gps.cpp b/noncore/net/wellenreiter/gui/gps.cpp index 5b1b4a4..b845aa1 100644 --- a/noncore/net/wellenreiter/gui/gps.cpp +++ b/noncore/net/wellenreiter/gui/gps.cpp | |||
@@ -48,25 +48,25 @@ GpsLocation GPS::position() const | |||
48 | double lat = -111.0; | 48 | double lat = -111.0; |
49 | double lon = -111.0; | 49 | double lon = -111.0; |
50 | 50 | ||
51 | int result = _socket->writeBlock( "p\r\n", 3 ); | 51 | int result = _socket->writeBlock( "p\r\n", 3 ); |
52 | _socket->flush(); | 52 | _socket->flush(); |
53 | if ( result ) | 53 | if ( result ) |
54 | { | 54 | { |
55 | int numAvail = _socket->bytesAvailable(); | 55 | int numAvail = _socket->bytesAvailable(); |
56 | qDebug( "GPS write succeeded, %d bytes available for reading...", numAvail ); | 56 | qDebug( "GPS write succeeded, %d bytes available for reading...", numAvail ); |
57 | if ( numAvail ) | 57 | if ( numAvail ) |
58 | { | 58 | { |
59 | int numRead = _socket->readBlock( &buf[0], sizeof buf ); | 59 | int numRead = _socket->readBlock( &buf[0], sizeof buf ); |
60 | int numScan = sscanf( &buf[0], "GPSD,P=%lg %lg", &lat, &lon); | 60 | int numScan = ::sscanf( &buf[0], "GPSD,P=%lg %lg", &lat, &lon); |
61 | 61 | ||
62 | if ( numRead < 7 || numScan != 2 ) | 62 | if ( numRead < 7 || numScan != 2 ) |
63 | { | 63 | { |
64 | qDebug( "GPS read %d bytes succeeded, invalid response: '%s'", numRead, &buf[0] ); | 64 | qDebug( "GPS read %d bytes succeeded, invalid response: '%s'", numRead, &buf[0] ); |
65 | return GpsLocation( -111, -111 ); | 65 | return GpsLocation( -111, -111 ); |
66 | } | 66 | } |
67 | else | 67 | else |
68 | { | 68 | { |
69 | return GpsLocation( lat, lon ); | 69 | return GpsLocation( lat, lon ); |
70 | } | 70 | } |
71 | } | 71 | } |
72 | } | 72 | } |