1 #ifndef __MARNAV__NMEA__TLL__HPP__
2 #define __MARNAV__NMEA__TLL__HPP__
4 #include <marnav/nmea/sentence.hpp>
5 #include <marnav/nmea/time.hpp>
6 #include <marnav/nmea/waypoint.hpp>
7 #include <marnav/geo/angle.hpp>
8 #include <marnav/utils/optional.hpp>
14 MARNAV_NMEA_DECLARE_SENTENCE_PARSE_FUNC(tll
)
16 /// @brief TLL - Target latitude and longitude
21 /// $--TLL,xx,llll.lll,a,yyyyy.yyy,a,c--c,hhmmss.ss,a,a*hh<CR><LF>
25 /// 1. Target number 00 - 99
27 /// 3. Latitude hemisphere
31 /// 5. Longitude hemisphere
37 /// - L = lost,tracked target has beenlost
38 /// - Q = query,target in the process of acquisition
40 /// 9. Reference target
44 class tll
: public sentence
46 MARNAV_NMEA_SENTENCE_FRIENDS(tll
)
49 constexpr static const sentence_id ID
= sentence_id::TLL
;
50 constexpr static const char * TAG
= "TLL";
53 tll(const tll
&) = default;
54 tll
& operator=(const tll
&) = default;
55 tll(tll
&&) = default;
56 tll
& operator=(tll
&&) = default;
59 tll(talker talk
, fields::const_iterator first
, fields::const_iterator last
);
60 virtual std::vector
<std::string
> get_data() const override
;
65 direction lat_hem
= direction::north
;
67 direction lon_hem
= direction::east
;
70 target_status status
= target_status::tracking
;
71 utils::optional
<char> reference_target
;
74 decltype(number
) get_number() const { return number
; }
75 decltype(name
) get_name() const { return name
; }
76 decltype(time_utc
) get_time_utc() const { return time_utc
; }
77 decltype(status
) get_status() const { return status
; }
78 decltype(reference_target
) get_reference_target() const { return reference_target
; }
80 geo::longitude
get_longitude() const;
81 geo::latitude
get_latitude() const;
83 void set_number(uint32_t t
) noexcept
{ number
= t
; }
84 void set_lat(const geo::latitude
& t
);
85 void set_lon(const geo::longitude
& t
);
86 void set_name(const waypoint
& t
) { name
= t
; }
87 void set_time_utc(const nmea::time
& t
) noexcept
{ time_utc
= t
; }
88 void set_status(target_status t
) noexcept
{ status
= t
; }
89 void set_reference_target(char t
) noexcept
{ reference_target
= t
; }