forked from torriem/QtAgOpenGPS
-
Notifications
You must be signed in to change notification settings - Fork 1
/
testnmea.cpp
33 lines (20 loc) · 791 Bytes
/
testnmea.cpp
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
#ifdef TEST_NMEA
#include <QApplication>
#include "formgps.h"
#include "cnmea.h"
#include <iostream>
int main(int argc, char *argv[]) {
QApplication a(argc, argv);
FormGPS mf(0);
CNMEA cnmea(&mf);
//throw it some bad data
QByteArray nmea1("$GPGGA,225616.4,4952.005620,N,11143.030382,W,2,11,1.2,796.149,M,-17.686,M,1.0,007*76\r\n"
"$GPRMC,225616.4,A,4952.005620,asdfasdfsdf*10\r\n");
//"$GPRMC,225616.4,A,4952.005620,N,11143.030382,W,4.51,15.7,011116,0.0,E,D*10\r\n");
cnmea.rawBuffer = nmea1;
cnmea.parseNMEA();
std::cout << cnmea.latitude << ", " << cnmea.longitude << std::endl;
std::cout << cnmea.updatedGGA << ", " << cnmea.updatedRMC <<std::endl;
//GGA should update but RMC won't.
}
#endif