Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qlocationutils.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 Jolla Ltd.
2// Copyright (C) 2016 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4// Qt-Security score:critical reason:data-parser
5
9
10#include <QTime>
11#include <QList>
12#include <QByteArray>
13#include <QDateTime>
14#include <QDebug>
15#include <QTimeZone>
16
17#include <math.h>
18
19QT_BEGIN_NAMESPACE
20
21// converts e.g. 15306.0235 from NMEA sentence to 153.100392
22static double qlocationutils_nmeaDegreesToDecimal(double nmeaDegrees)
23{
24 double deg;
25 double min = 100.0 * modf(nmeaDegrees / 100.0, &deg);
26 return deg + (min / 60.0);
27}
28
29static void qlocationutils_readGga(QByteArrayView bv, QGeoPositionInfo *info, double uere,
30 bool *hasFix)
31{
32 const QList<QByteArray> parts = QByteArray::fromRawData(bv.data(), bv.size()).split(',');
33 QGeoCoordinate coord;
34
35 if (hasFix && parts.size() > 6 && !parts[6].isEmpty())
36 *hasFix = parts[6].toInt() > 0;
37
38 if (parts.size() > 1 && !parts[1].isEmpty()) {
39 QTime time;
40 if (QLocationUtils::getNmeaTime(parts[1], &time))
41 info->setTimestamp(QDateTime(QDate(), time, QTimeZone::UTC));
42 }
43
44 if (parts.size() > 5 && parts[3].size() == 1 && parts[5].size() == 1) {
45 double lat;
46 double lng;
47 if (QLocationUtils::getNmeaLatLong(parts[2], parts[3][0], parts[4], parts[5][0], &lat, &lng)) {
48 coord.setLatitude(lat);
49 coord.setLongitude(lng);
50 }
51 }
52
53 if (parts.size() > 8 && !parts[8].isEmpty()) {
54 bool hasHdop = false;
55 double hdop = parts[8].toDouble(&hasHdop);
56 if (hasHdop)
57 info->setAttribute(QGeoPositionInfo::HorizontalAccuracy, 2 * hdop * uere);
58 }
59
60 if (parts.size() > 9 && !parts[9].isEmpty()) {
61 bool hasAlt = false;
62 double alt = parts[9].toDouble(&hasAlt);
63 if (hasAlt)
64 coord.setAltitude(alt);
65 }
66
67 if (coord.type() != QGeoCoordinate::InvalidCoordinate)
68 info->setCoordinate(coord);
69}
70
71static void qlocationutils_readGsa(QByteArrayView bv, QGeoPositionInfo *info, double uere,
72 bool *hasFix)
73{
74 const QList<QByteArray> parts = QByteArray::fromRawData(bv.data(), bv.size()).split(',');
75
76 if (hasFix && parts.size() > 2 && !parts[2].isEmpty())
77 *hasFix = parts[2].toInt() > 0;
78
79 if (parts.size() > 16 && !parts[16].isEmpty()) {
80 bool hasHdop = false;
81 double hdop = parts[16].toDouble(&hasHdop);
82 if (hasHdop)
83 info->setAttribute(QGeoPositionInfo::HorizontalAccuracy, 2 * hdop * uere);
84 }
85
86 if (parts.size() > 17 && !parts[17].isEmpty()) {
87 bool hasVdop = false;
88 double vdop = parts[17].toDouble(&hasVdop);
89 if (hasVdop)
90 info->setAttribute(QGeoPositionInfo::VerticalAccuracy, 2 * vdop * uere);
91 }
92}
93
94static void qlocationutils_readGsa(QByteArrayView bv, QList<int> &pnrsInUse)
95{
96 const QList<QByteArray> parts = QByteArray::fromRawData(bv.data(), bv.size()).split(',');
97 pnrsInUse.clear();
98 if (parts.size() <= 2)
99 return;
100 bool ok;
101 for (qsizetype i = 3; i < qMin(15, parts.size()); ++i) {
102 const QByteArray &pnrString = parts.at(i);
103 if (pnrString.isEmpty())
104 continue;
105 int pnr = pnrString.toInt(&ok);
106 if (ok)
107 pnrsInUse.append(pnr);
108 }
109}
110
111static void qlocationutils_readGll(QByteArrayView bv, QGeoPositionInfo *info, bool *hasFix)
112{
113 const QList<QByteArray> parts = QByteArray::fromRawData(bv.data(), bv.size()).split(',');
114 QGeoCoordinate coord;
115
116 if (hasFix && parts.size() > 6 && !parts[6].isEmpty())
117 *hasFix = (parts[6][0] == 'A');
118
119 if (parts.size() > 5 && !parts[5].isEmpty()) {
120 QTime time;
121 if (QLocationUtils::getNmeaTime(parts[5], &time))
122 info->setTimestamp(QDateTime(QDate(), time, QTimeZone::UTC));
123 }
124
125 if (parts.size() > 4 && parts[2].size() == 1 && parts[4].size() == 1) {
126 double lat;
127 double lng;
128 if (QLocationUtils::getNmeaLatLong(parts[1], parts[2][0], parts[3], parts[4][0], &lat, &lng)) {
129 coord.setLatitude(lat);
130 coord.setLongitude(lng);
131 }
132 }
133
134 if (coord.type() != QGeoCoordinate::InvalidCoordinate)
135 info->setCoordinate(coord);
136}
137
138static void qlocationutils_readRmc(QByteArrayView bv, QGeoPositionInfo *info, bool *hasFix)
139{
140 const QList<QByteArray> parts = QByteArray::fromRawData(bv.data(), bv.size()).split(',');
141 QGeoCoordinate coord;
142 QDate date;
143 QTime time;
144
145 if (hasFix && parts.size() > 2 && !parts[2].isEmpty())
146 *hasFix = (parts[2][0] == 'A');
147
148 if (parts.size() > 9 && parts[9].size() == 6) {
149 date = QDate::fromString(QString::fromLatin1(parts[9]), QStringLiteral("ddMMyy"));
150 if (date.isValid())
151 date = date.addYears(100); // otherwise starts from 1900
152 }
153
154 if (parts.size() > 1 && !parts[1].isEmpty())
155 QLocationUtils::getNmeaTime(parts[1], &time);
156
157 if (parts.size() > 6 && parts[4].size() == 1 && parts[6].size() == 1) {
158 double lat;
159 double lng;
160 if (QLocationUtils::getNmeaLatLong(parts[3], parts[4][0], parts[5], parts[6][0], &lat, &lng)) {
161 coord.setLatitude(lat);
162 coord.setLongitude(lng);
163 }
164 }
165
166 bool parsed = false;
167 double value = 0.0;
168 if (parts.size() > 7 && !parts[7].isEmpty()) {
169 value = parts[7].toDouble(&parsed);
170 if (parsed)
171 info->setAttribute(QGeoPositionInfo::GroundSpeed, qreal(value * 1.852 / 3.6)); // knots -> m/s
172 }
173 if (parts.size() > 8 && !parts[8].isEmpty()) {
174 value = parts[8].toDouble(&parsed);
175 if (parsed)
176 info->setAttribute(QGeoPositionInfo::Direction, qreal(value));
177 }
178 if (parts.size() > 11 && parts[11].size() == 1
179 && (parts[11][0] == 'E' || parts[11][0] == 'W')) {
180 value = parts[10].toDouble(&parsed);
181 if (parsed) {
182 if (parts[11][0] == 'W')
183 value *= -1;
184 info->setAttribute(QGeoPositionInfo::MagneticVariation, qreal(value));
185 }
186 }
187
188 if (coord.type() != QGeoCoordinate::InvalidCoordinate)
189 info->setCoordinate(coord);
190
191 info->setTimestamp(QDateTime(date, time, QTimeZone::UTC));
192}
193
194static void qlocationutils_readVtg(QByteArrayView bv, QGeoPositionInfo *info, bool *hasFix)
195{
196 if (hasFix)
197 *hasFix = false;
198
199 const QList<QByteArray> parts = QByteArray::fromRawData(bv.data(), bv.size()).split(',');
200
201 bool parsed = false;
202 double value = 0.0;
203 if (parts.size() > 1 && !parts[1].isEmpty()) {
204 value = parts[1].toDouble(&parsed);
205 if (parsed)
206 info->setAttribute(QGeoPositionInfo::Direction, qreal(value));
207 }
208 if (parts.size() > 7 && !parts[7].isEmpty()) {
209 value = parts[7].toDouble(&parsed);
210 if (parsed)
211 info->setAttribute(QGeoPositionInfo::GroundSpeed, qreal(value / 3.6)); // km/h -> m/s
212 }
213}
214
215static void qlocationutils_readZda(QByteArrayView bv, QGeoPositionInfo *info, bool *hasFix)
216{
217 if (hasFix)
218 *hasFix = false;
219
220 const QList<QByteArray> parts = QByteArray::fromRawData(bv.data(), bv.size()).split(',');
221 QDate date;
222 QTime time;
223
224 if (parts.size() > 1 && !parts[1].isEmpty())
225 QLocationUtils::getNmeaTime(parts[1], &time);
226
227 if (parts.size() > 4 && !parts[2].isEmpty() && !parts[3].isEmpty()
228 && parts[4].size() == 4) { // must be full 4-digit year
229 int day = parts[2].toInt();
230 int month = parts[3].toInt();
231 int year = parts[4].toInt();
232 if (day > 0 && month > 0 && year > 0)
233 date.setDate(year, month, day);
234 }
235
236 info->setTimestamp(QDateTime(date, time, QTimeZone::UTC));
237}
238
239QLocationUtils::NmeaSentence QLocationUtils::getNmeaSentenceType(QByteArrayView bv)
240{
241 if (bv.size() < 6 || bv[0] != '$' || !hasValidNmeaChecksum(bv))
242 return NmeaSentenceInvalid;
243
244 QByteArrayView key = bv.sliced(3);
245
246 if (key.startsWith("GGA"))
247 return NmeaSentenceGGA;
248
249 if (key.startsWith("GSA"))
250 return NmeaSentenceGSA;
251
252 if (key.startsWith("GSV"))
253 return NmeaSentenceGSV;
254
255 if (key.startsWith("GLL"))
256 return NmeaSentenceGLL;
257
258 if (key.startsWith("RMC"))
259 return NmeaSentenceRMC;
260
261 if (key.startsWith("VTG"))
262 return NmeaSentenceVTG;
263
264 if (key.startsWith("ZDA"))
265 return NmeaSentenceZDA;
266
267 return NmeaSentenceInvalid;
268}
269
270QGeoSatelliteInfo::SatelliteSystem QLocationUtils::getSatelliteSystem(QByteArrayView bv)
271{
272 if (bv.size() < 6 || bv[0] != '$' || !hasValidNmeaChecksum(bv))
273 return QGeoSatelliteInfo::Undefined;
274
275 QByteArrayView key = bv.sliced(1);
276
277 // GPS: GP
278 if (key.startsWith("GP"))
279 return QGeoSatelliteInfo::GPS;
280
281 // GLONASS: GL
282 if (key.startsWith("GL"))
283 return QGeoSatelliteInfo::GLONASS;
284
285 // GALILEO: GA
286 if (key.startsWith("GA"))
287 return QGeoSatelliteInfo::GALILEO;
288
289 // BeiDou: BD or GB
290 if (key.startsWith("BD") || key.startsWith("GB"))
291 return QGeoSatelliteInfo::BEIDOU;
292
293 // QZSS: GQ, PQ, QZ
294 if (key.startsWith("GQ") || key.startsWith("PQ") || key.startsWith("QZ"))
295 return QGeoSatelliteInfo::QZSS;
296
297 // IRNSS: GI
298 if (key.startsWith("GI"))
299 return QGeoSatelliteInfo::IRNSS;
300
301 // SBAS: no talker id, should use satellite id range
302
303 // Multiple: GN
304 if (key.startsWith("GN"))
305 return QGeoSatelliteInfo::Multiple;
306
307 return QGeoSatelliteInfo::Undefined;
308}
309
310QGeoSatelliteInfo::SatelliteSystem QLocationUtils::getSatelliteSystemBySatelliteId(int satId)
311{
312 if (satId >= 1 && satId <= 32)
313 return QGeoSatelliteInfo::GPS;
314
315 if (satId >= 33 && satId <= 64)
316 return QGeoSatelliteInfo::SBAS;
317
318 if (satId >= 65 && satId <= 96) // including future extensions
319 return QGeoSatelliteInfo::GLONASS;
320
321 if (satId >= 193 && satId <= 200) // including future extensions
322 return QGeoSatelliteInfo::QZSS;
323
324 if ((satId >= 201 && satId <= 235) || (satId >= 401 && satId <= 437))
325 return QGeoSatelliteInfo::BEIDOU;
326
327 if (satId >= 301 && satId <= 336)
328 return QGeoSatelliteInfo::GALILEO;
329
330 return QGeoSatelliteInfo::Undefined;
331}
332
333bool QLocationUtils::getPosInfoFromNmea(QByteArrayView bv, QGeoPositionInfo *info,
334 double uere, bool *hasFix)
335{
336 if (!info)
337 return false;
338
339 if (hasFix)
340 *hasFix = false;
341
342 NmeaSentence nmeaType = getNmeaSentenceType(bv);
343 if (nmeaType == NmeaSentenceInvalid)
344 return false;
345
346 // Adjust size so that * and following characters are not parsed by the following functions.
347 qsizetype idx = bv.indexOf('*');
348 QByteArrayView key = idx < 0 ? bv : bv.first(idx);
349
350 switch (nmeaType) {
351 case NmeaSentenceGGA:
352 qlocationutils_readGga(key, info, uere, hasFix);
353 return true;
354 case NmeaSentenceGSA:
355 qlocationutils_readGsa(key, info, uere, hasFix);
356 return true;
357 case NmeaSentenceGLL:
358 qlocationutils_readGll(key, info, hasFix);
359 return true;
360 case NmeaSentenceRMC:
361 qlocationutils_readRmc(key, info, hasFix);
362 return true;
363 case NmeaSentenceVTG:
364 qlocationutils_readVtg(key, info, hasFix);
365 return true;
366 case NmeaSentenceZDA:
367 qlocationutils_readZda(key, info, hasFix);
368 return true;
369 default:
370 return false;
371 }
372}
373
374QNmeaSatelliteInfoSource::SatelliteInfoParseStatus
375QLocationUtils::getSatInfoFromNmea(QByteArrayView bv, QList<QGeoSatelliteInfo> &infos, QGeoSatelliteInfo::SatelliteSystem &system)
376{
377 if (bv.isEmpty())
378 return QNmeaSatelliteInfoSource::NotParsed;
379
380 NmeaSentence nmeaType = getNmeaSentenceType(bv);
381 if (nmeaType != NmeaSentenceGSV)
382 return QNmeaSatelliteInfoSource::NotParsed;
383
384 // Standard forbids using $GN talker id for GSV messages, so the system
385 // type here will be uniquely identified.
386 system = getSatelliteSystem(bv);
387
388 // Adjust size so that * and following characters are not parsed by the
389 // following code.
390 qsizetype idx = bv.indexOf('*');
391
392 const QList<QByteArray> parts = QByteArray::fromRawData(bv.data(),
393 idx < 0 ? bv.size() : idx).split(',');
394
395 if (parts.size() <= 3) {
396 infos.clear();
397 return QNmeaSatelliteInfoSource::FullyParsed; // Malformed sentence.
398 }
399
400 // The hard max limit for the number of sentences in one message is used
401 // to prevent malicious messages. The protocol does not seem to define any
402 // maximum, but this value provides an upper limit that is more than enough
403 // in practice.
404 static constexpr quint32 MaxTotalSentences = 250;
405 bool ok;
406 const quint32 totalSentences = parts.at(1).toUInt(&ok);
407 if (!ok || totalSentences > MaxTotalSentences) {
408 infos.clear();
409 return QNmeaSatelliteInfoSource::FullyParsed; // Malformed sentence.
410 }
411
412 const quint32 sentence = parts.at(2).toUInt(&ok);
413 if (!ok || sentence > totalSentences) {
414 infos.clear();
415 return QNmeaSatelliteInfoSource::FullyParsed; // Malformed sentence.
416 }
417
418 const quint32 totalSats = parts.at(3).toUInt(&ok);
419 if (!ok) {
420 infos.clear();
421 return QNmeaSatelliteInfoSource::FullyParsed; // Malformed sentence.
422 }
423
424 if (sentence == 1)
425 infos.clear();
426 else if (infos.isEmpty()) // sentences out of order or DDoS spotted earlier
427 return QNmeaSatelliteInfoSource::FullyParsed; // Malformed sentence.
428
429 static constexpr qsizetype MaxTotalSatellites = 1000;
430 const auto currentSatsSize = infos.size();
431 if (currentSatsSize > qint64(totalSats) || currentSatsSize > MaxTotalSatellites) {
432 // Maybe DDoS: otherwise, probably something is wrong; reject, either way.
433 infos.clear();
434 return QNmeaSatelliteInfoSource::FullyParsed; // Malformed sentence.
435 }
436
437 const qint64 numSatInSentence = qMin(sentence * 4, totalSats) - (sentence - 1) * 4;
438 if (parts.size() < (4 + numSatInSentence * 4)) {
439 infos.clear();
440 return QNmeaSatelliteInfoSource::FullyParsed; // Malformed sentence.
441 }
442
443 int field = 4;
444 for (qint64 i = 0; i < numSatInSentence; ++i) {
445 QGeoSatelliteInfo info;
446 info.setSatelliteSystem(system);
447 int prn = parts.at(field++).toInt(&ok);
448 // Quote from: https://gpsd.gitlab.io/gpsd/NMEA.html#_satellite_ids
449 // GLONASS satellite numbers come in two flavors. If a sentence has a GL
450 // talker ID, expect the skyviews to be GLONASS-only and in the range
451 // 1-32; you must add 64 to get a globally-unique NMEA ID. If the
452 // sentence has a GN talker ID, the device emits a multi-constellation
453 // skyview with GLONASS IDs already in the 65-96 range.
454 //
455 // However I don't observe such behavior with my device. So implementing
456 // a safe scenario.
457 if (ok && (system == QGeoSatelliteInfo::GLONASS)) {
458 if (prn <= 64)
459 prn += 64;
460 }
461
462 // If the system is unknown, try to determine it based on prn.
463 // Note that the new value can vary among the satellites, so *do not*
464 // update the out-variable 'system'.
465 if (ok && system == QGeoSatelliteInfo::Undefined)
466 info.setSatelliteSystem(getSatelliteSystemBySatelliteId(prn));
467
468 info.setSatelliteIdentifier((ok) ? prn : 0);
469 const int elevation = parts.at(field++).toInt(&ok);
470 info.setAttribute(QGeoSatelliteInfo::Elevation, (ok) ? elevation : 0);
471 const int azimuth = parts.at(field++).toInt(&ok);
472 info.setAttribute(QGeoSatelliteInfo::Azimuth, (ok) ? azimuth : 0);
473 const int snr = parts.at(field++).toInt(&ok);
474 info.setSignalStrength((ok) ? snr : -1);
475 infos.append(info);
476 }
477
478 if (sentence == totalSentences)
479 return QNmeaSatelliteInfoSource::FullyParsed;
480
481 return QNmeaSatelliteInfoSource::PartiallyParsed;
482}
483
484QGeoSatelliteInfo::SatelliteSystem QLocationUtils::getSatInUseFromNmea(QByteArrayView bv,
485 QList<int> &pnrsInUse)
486{
487 if (bv.isEmpty())
488 return QGeoSatelliteInfo::Undefined;
489
490 NmeaSentence nmeaType = getNmeaSentenceType(bv);
491 if (nmeaType != NmeaSentenceGSA)
492 return QGeoSatelliteInfo::Undefined;
493
494 auto systemType = getSatelliteSystem(bv);
495 if (systemType == QGeoSatelliteInfo::Undefined)
496 return systemType;
497
498 // The documentation states that we do not modify pnrsInUse if we could not
499 // parse the data
500 pnrsInUse.clear();
501
502 // Adjust size so that * and following characters are not parsed by the following functions.
503 qsizetype idx = bv.indexOf('*');
504 QByteArrayView key = idx < 0 ? bv : bv.first(idx);
505
506 qlocationutils_readGsa(key, pnrsInUse);
507
508 // Quote from: https://gpsd.gitlab.io/gpsd/NMEA.html#_satellite_ids
509 // GLONASS satellite numbers come in two flavors. If a sentence has a GL
510 // talker ID, expect the skyviews to be GLONASS-only and in the range 1-32;
511 // you must add 64 to get a globally-unique NMEA ID. If the sentence has a
512 // GN talker ID, the device emits a multi-constellation skyview with
513 // GLONASS IDs already in the 65-96 range.
514 //
515 // However I don't observe such behavior with my device. So implementing a
516 // safe scenario.
517 if (systemType == QGeoSatelliteInfo::GLONASS) {
518 std::for_each(pnrsInUse.begin(), pnrsInUse.end(), [](int &id) {
519 if (id <= 64)
520 id += 64;
521 });
522 }
523
524 if ((systemType == QGeoSatelliteInfo::Multiple) && !pnrsInUse.isEmpty()) {
525 // Standard claims that in case of multiple system types we will receive
526 // several GSA messages, each containing data from only one satellite
527 // system, so we can pick the first id to determine the system type.
528 auto tempSystemType = getSatelliteSystemBySatelliteId(pnrsInUse.front());
529 if (tempSystemType != QGeoSatelliteInfo::Undefined)
530 systemType = tempSystemType;
531 }
532
533 return systemType;
534}
535
536bool QLocationUtils::hasValidNmeaChecksum(QByteArrayView bv)
537{
538 qsizetype asteriskIndex = bv.indexOf('*');
539
540 constexpr qsizetype CSUM_LEN = 2;
541 if (asteriskIndex < 0 || asteriskIndex >= bv.size() - CSUM_LEN)
542 return false;
543
544 // XOR byte value of all characters between '$' and '*'
545 int result = 0;
546 for (qsizetype i = 1; i < asteriskIndex; ++i)
547 result ^= bv[i];
548 /*
549 char calc[CSUM_LEN + 1];
550 ::snprintf(calc, CSUM_LEN + 1, "%02x", result);
551 return ::strncmp(calc, &data[asteriskIndex+1], 2) == 0;
552 */
553
554 QByteArrayView checkSumBytes = bv.sliced(asteriskIndex + 1, 2);
555 bool ok = false;
556 int checksum = checkSumBytes.toInt(&ok,16);
557 return ok && checksum == result;
558}
559
560bool QLocationUtils::getNmeaTime(const QByteArray &bytes, QTime *time)
561{
562 QTime tempTime = QTime::fromString(QString::fromLatin1(bytes),
563 QStringView(bytes.size() > 6 && bytes[6] == '.'
564 ? u"hhmmss.z"
565 : u"hhmmss"));
566
567 if (tempTime.isValid()) {
568 *time = tempTime;
569 return true;
570 }
571 return false;
572}
573
574bool QLocationUtils::getNmeaLatLong(const QByteArray &latString, char latDirection, const QByteArray &lngString, char lngDirection, double *lat, double *lng)
575{
576 if ((latDirection != 'N' && latDirection != 'S')
577 || (lngDirection != 'E' && lngDirection != 'W')) {
578 return false;
579 }
580
581 bool hasLat = false;
582 bool hasLong = false;
583 double tempLat = latString.toDouble(&hasLat);
584 double tempLng = lngString.toDouble(&hasLong);
585 if (hasLat && hasLong) {
586 tempLat = qlocationutils_nmeaDegreesToDecimal(tempLat);
587 if (latDirection == 'S')
588 tempLat *= -1;
589 tempLng = qlocationutils_nmeaDegreesToDecimal(tempLng);
590 if (lngDirection == 'W')
591 tempLng *= -1;
592
593 if (isValidLat(tempLat) && isValidLong(tempLng)) {
594 *lat = tempLat;
595 *lng = tempLng;
596 return true;
597 }
598 }
599 return false;
600}
601
602QT_END_NAMESPACE
static void qlocationutils_readZda(QByteArrayView bv, QGeoPositionInfo *info, bool *hasFix)
static void qlocationutils_readVtg(QByteArrayView bv, QGeoPositionInfo *info, bool *hasFix)
static void qlocationutils_readRmc(QByteArrayView bv, QGeoPositionInfo *info, bool *hasFix)
static void qlocationutils_readGll(QByteArrayView bv, QGeoPositionInfo *info, bool *hasFix)
static void qlocationutils_readGsa(QByteArrayView bv, QList< int > &pnrsInUse)
static void qlocationutils_readGga(QByteArrayView bv, QGeoPositionInfo *info, double uere, bool *hasFix)
static void qlocationutils_readGsa(QByteArrayView bv, QGeoPositionInfo *info, double uere, bool *hasFix)