1 #ifndef __NMEA__GLL__HPP__
2 #define __NMEA__GLL__HPP__
4 #include <marnav/nmea/sentence.hpp>
5 #include <marnav/nmea/angle.hpp>
6 #include <marnav/nmea/time.hpp>
7 #include <marnav/utils/optional.hpp>
13 MARNAV_NMEA_DECLARE_SENTENCE_PARSE_FUNC(gll
)
15 /// @brief GLL - Geographic Position - Latitude/Longitude
20 /// $--GLL,llll.ll,a,yyyyy.yy,a,hhmmss.ss,a,m*hh<CR><LF>
25 /// 2. Latitude hemipsphere
29 /// 4. Longitude hemisphere
32 /// 5. Time (UTC) of position
35 /// - V = Data Invalid
36 /// 7. Mode indicator (only in newer versions)
39 /// - D = Differential
41 class gll
: public sentence
43 MARNAV_NMEA_SENTENCE_FRIENDS(gll
)
46 constexpr static const sentence_id ID
= sentence_id::GLL
;
47 constexpr static const char * TAG
= "GLL";
52 gll(const gll
&) = default;
53 gll
& operator=(const gll
&) = default;
56 gll(const std::string
& talker
, fields::const_iterator first
, fields::const_iterator last
);
57 virtual std::vector
<std::string
> get_data() const override
;
60 utils::optional
<geo::latitude
> lat
;
61 utils::optional
<direction
> lat_hem
;
62 utils::optional
<geo::longitude
> lon
;
63 utils::optional
<direction
> lon_hem
;
64 utils::optional
<nmea::time
> time_utc
;
65 utils::optional
<status
> data_valid
;
66 utils::optional
<positioning_system_mode_indicator
> mode_indicator
;
74 NMEA_GETTER(data_valid
)
75 NMEA_GETTER(mode_indicator
)
77 void set_lat(const geo::latitude
& t
);
78 void set_lon(const geo::longitude
& t
);
79 void set_time_utc(const nmea::time
& t
) noexcept
{ time_utc
= t
; }
80 void set_data_valid(status t
) noexcept
{ data_valid
= t
; }
81 void set_mode_indicator(positioning_system_mode_indicator t
) noexcept