-
Notifications
You must be signed in to change notification settings - Fork 1
/
nmeaParse.h
49 lines (41 loc) · 1.61 KB
/
nmeaParse.h
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef _NMEA_PARSER
#define _NMEA_PARSER
#include "gpsPub.h" // for GPSPosition struct definition
class NMEAParser
{
public:
static bool GetTimeAndPosition(const char* buffer, GPSPosition* p);
private:
enum SentenceType {INVALID_SENTENCE, GPRMC, GPGGA};
enum FieldType
{
UNUSED, // we don't use this field in our parsing (to simplify)
TIME, // UTC hhmmss.[fff] e.g. "170834.123" = 17:08:34.123
DATE, // Date ddmmyy
STATUS, // "A" (active) or "V" (void)
LAT_VAL, // ddmm.mmmm, e.g. "4124.8963" = 41 deg 24.8963 min
LAT_REF, // "N" or "S"
LON_VAL, // dddmm.mmm, e.g. "08151.6838" = 81 deg 51.6838 min
LON_REF, // "E" or "W"
FIX_MODE, // GPGGA, "0", "1", "2" = invalid, GPS, DPGS
SAT_USED, // e.g. "05" = 5 satellites
ALT_VAL, // altitude "280.2" = 280.2
ALT_UNIT, // "M" = meter
HDOP,
GEO,
G_UNIT,
D_AGE,
D_REF,
SPD,
HDG,
MAG_VAR,
MAG_REF,
END // not a real field, used to mark end of templates
};
enum Status {INVALID_STATUS, ACTIVE, VOID};
enum UnitType {INVALID_UNIT, METERS}; // supported altitude unit types
// Templates for sentence types supported by this parser
static const FieldType GPRMC_TEMPLATE[];
static const FieldType GPGGA_TEMPLATE[];
}; // end class NMEAParser
#endif // _NMEA_PARSER