-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnmea.h
51 lines (45 loc) · 1.46 KB
/
nmea.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
50
51
// definitions for types involved in implementing the NMEA protocol for GPS devices
#include <iosfwd>
#include <boost/optional.hpp>
#include <boost/fusion/include/adapt_struct.hpp>
// NMEA "sentence" describing GPS coordinates
// $GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,,*47
struct gga_t {
int timestamp;
double latitude;
char lat_hemi;
double longitude;
char long_hemi;
int quality;
int sat_count;
double dilution;
double altitude;
char alt_units;
double sea_level;
char sea_level_units;
boost::optional<int> time_since_dgps;
boost::optional<int> dgps_station_id;
int checksum;
};
// declare stream operators
std::istream& operator>>(std::istream&, gga_t&);
std::ostream& operator<<(std::ostream&, gga_t const&);
// adapt gga_t to make it accessible to Fusion
BOOST_FUSION_ADAPT_STRUCT(
gga_t,
(int, timestamp)
(double, latitude)
(char, lat_hemi)
(double, longitude)
(char, long_hemi)
(int, quality)
(int, sat_count)
(double, dilution)
(double, altitude)
(char, alt_units)
(double, sea_level)
(char, sea_level_units)
(boost::optional<int>, time_since_dgps)
(boost::optional<int>, dgps_station_id)
(int, checksum)
)