gpsd-users
[Top][All Lists]
Advanced

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

[gpsd-users] incorrect NMEA output with gps_data


From: Ulrich Betzenbichler
Subject: [gpsd-users] incorrect NMEA output with gps_data
Date: Mon, 10 Nov 2014 13:58:50 -0000

Hello,
 
I have a problem with reading NMEA data in a Qt program on an embedded system with Linux.
 
Here are some info about the used software:
Linux: Version 3.10.44
QT:  Version 4.8.1
Gpsd: Version 3.11
 
Basis of my program is the example application ‘qtgpsc’ (https://code.google.com/p/qtgpsc)
The program uses the routines out of library libgps.
 
After gps_open, I use a notifier to trigger an event whenever new data are available in ‘gpsdata.gps_fd’.
After this , I set ‘gps_stream(&gpsdata, WATCH_ENABLE|WATCH_NMEA,NULL)
 
When the event is triggered, I do the following code (this are only the important lines)
 
Int r= gps_read(&gps_data); 
QString lines = QString(gps_data(&gpsdata)
 
Then the string in ‘lines‘ is splitted on ‘\n’ and displayed in a textfield.
 
My observations are:
On each new NMEA (or JSON) line that is written by GPSD into the client, the notifier triggers an event.  (This is correct)
When I check variable r (result of gps_read), it shows the correct number of characters for the NMEA string (This is correct)
 
The error comes when I execute the next line ‘QString lines = QString(gps_data(&gpsdata)’.
This list of strings is up to 8194 characters long and contains up to 150 Strings.
Only the first string is the actual NMEA string, the other strings are older NMEA strings or parts of NMEA strings.
 
In my opinion, the error is the following:
When I execute the gps_data function, the content of the buffer must be reduced by the size of the NMEA string (either delete the line or set the buffer pointers accordingly).
It seems to me that this clearing of the buffer is not done.
8194 Characters seems to me is the max size of the Buffer.
When a new string is written to the Buffer, the start Pointer is set correctly to the begin of the NMEA string. The end Pointer is not set correctly and always, the whole buffer is read.
 
What I don’t understand is, that the same routine runs on my Ubuntu PC (GPSD version 3.4.)
 
Can you please help me to solve the problem or give me an idea what else I can check.
 
Best regards
 
Uli Betzenbichler
 
 
 
 
 
 
 
 
 
 
_____________________________________
Ulrich Betzenbichler
Senior System Engineer
CSR Technology GmbH
Marie-Curie-Str. 1
85055 Ingolstadt, Germany
Direct: +49 (0)841 9378041
Fax.: +49 (0841) 9378-010
 
 
 
 


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Keep up to date with CSR on our technical blog or CSR people blog, YouTube, Facebook or follow us on Twitter at twitter.com/CSR_plc.
New for 2014, you can now access the wide range of products powered by aptX.
reply via email to

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