1 #ifndef __NMEA__RMC__HPP__
2 #define __NMEA__RMC__HPP__
4 #include <marnav/nmea/sentence.hpp>
5 #include <marnav/nmea/date.hpp>
6 #include <marnav/nmea/time.hpp>
7 #include <marnav/nmea/angle.hpp>
8 #include <marnav/utils/optional.hpp>
14 MARNAV_NMEA_DECLARE_SENTENCE_PARSE_FUNC(rmc
)
16 /// @brief RMC - Recommended Minimum Navigation Information
20 /// 1 2 3 4 5 6 7 8 9 10 11|
21 /// | | | | | | | | | | | |
22 /// $--RMC,hhmmss.ss,A,llll.ll,a,yyyyy.yy,a,x.x,x.x,xxxx,x.x,a,m,*hh<CR><LF>
27 /// 2. Status, V=Navigation receiver warning A=Valid
29 /// 4. Latitude hemisphere
33 /// 6. Longitude hemisphere
36 /// 7. Speed over ground, knots
37 /// 8. Track made good, degrees true
39 /// 10. Magnetic Variation, degrees
40 /// 11. Magnetic Variation, degrees, direction
43 /// 12. FAA mode indicator (NMEA 2.3 and later)
45 /// A status of V means the GPS has a valid fix that is below an internal quality
46 /// threshold, e.g. because the dilution of precision is too high or an elevation
49 class rmc
: public sentence
51 MARNAV_NMEA_SENTENCE_FRIENDS(rmc
)
54 constexpr static const sentence_id ID
= sentence_id::RMC
;
55 constexpr static const char * TAG
= "RMC";
60 rmc(const rmc
&) = default;
61 rmc
& operator=(const rmc
&) = default;
64 rmc(const std::string
& talker
, fields::const_iterator first
, fields::const_iterator last
);
65 virtual std::vector
<std::string
> get_data() const override
;
68 utils::optional
<nmea::time
> time_utc
;
69 utils::optional
<char> status
;
70 utils::optional
<geo::latitude
> lat
;
71 utils::optional
<direction
> lat_hem
;
72 utils::optional
<geo::longitude
> lon
;
73 utils::optional
<direction
> lon_hem
;
74 utils::optional
<double> sog
;
75 utils::optional
<double> heading
;
76 utils::optional
<nmea::date
> date
;
77 utils::optional
<double> mag
;
78 utils::optional
<direction
> mag_hem
;
79 utils::optional
<positioning_system_mode_indicator
> mode_indicator
;
89 NMEA_GETTER(mode_indicator
)
91 utils::optional
<geo::longitude
> get_longitude() const;
92 utils::optional
<geo::latitude
> get_latitude() const;
94 void set_time_utc(const time
& t
) noexcept
{ time_utc
= t
; }
95 void set_status(char t
) noexcept
{ status
= t
; }
96 void set_lat(const geo::latitude
& t
);
97 void set_lon(const geo::longitude
& t
);
98 void set_sog(double t
) noexcept
{ sog
= t
; }
99 void set_heading(double t
) noexcept
{ heading
= t
; }
100 void set_date(const nmea::date
& t
) noexcept
{ date
= t
; }
101 void set_mag(double t
, direction h
);
102 void set_mode_indicator(positioning_system_mode_indicator t
) noexcept