diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2019-05-10 19:55:33 +0200 |
---|---|---|
committer | paolo <paolo.angelelli@qt.io> | 2019-08-15 10:08:13 +0200 |
commit | f613eb3a6031d6d4f3e5ee230fab3056314fa9a4 (patch) | |
tree | 804e4d47b2eed988c1af0847f023b81dae4afc96 /src/positioning/qlocationutils_p.h | |
parent | 3334c6f6d00255f6fd5690e4b9cb05416950fd4d (diff) | |
download | qtlocation-f613eb3a6031d6d4f3e5ee230fab3056314fa9a4.tar.gz |
Add Satellite support to serialnmea plugin
This adds a new class, QNmeaSatelliteInfoSource, locally
to the plugin, that behaves similarly to
QNmeaPositionInfoSource in the way of handling the
IODevice and producing the updates.
Change-Id: Id594152dd70514974ac79c7757ce6f0da4631191
Fixes: QTBUG-59274
Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
Diffstat (limited to 'src/positioning/qlocationutils_p.h')
-rw-r--r-- | src/positioning/qlocationutils_p.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/positioning/qlocationutils_p.h b/src/positioning/qlocationutils_p.h index e3881f6f..e2d739e7 100644 --- a/src/positioning/qlocationutils_p.h +++ b/src/positioning/qlocationutils_p.h @@ -65,6 +65,7 @@ class QTime; class QByteArray; class QGeoPositionInfo; +class QGeoSatelliteInfo; class Q_POSITIONING_PRIVATE_EXPORT QLocationUtils { public: @@ -94,7 +95,8 @@ public: NmeaSentenceGLL, // Lat/Lon data NmeaSentenceRMC, // Recommended minimum data for gps NmeaSentenceVTG, // Vector track an Speed over the Ground - NmeaSentenceZDA // Date and Time + NmeaSentenceZDA, // Date and Time + NmeaSentenceGSV // Per-Satellite Info }; inline static bool isValidLat(double lat) { @@ -282,6 +284,29 @@ public: bool *hasFix = nullptr); /* + Retruns a list of QGeoSatelliteInfo in the view. + + Note: this function has to be called repeatedly until it returns true. + Reason being that GSV sentences can be split into multiple samples, so getting the full data + requires parsing multiple sentences. + */ + enum GSVParseStatus { + GSVNotParsed, + GSVPartiallyParsed, + GSVFullyParsed + }; + static GSVParseStatus getSatInfoFromNmea(const char *data, + int size, + QList<QGeoSatelliteInfo> &infos); + + /* + Parses GSA for satellites in use. + */ + static bool getSatInUseFromNmea(const char *data, + int size, + QList<int> &pnrsInUse); + + /* Returns true if the given NMEA sentence has a valid checksum. */ static bool hasValidNmeaChecksum(const char *data, int size); |