1 #ifndef __NMEA__TLL__HPP__
2 #define __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";
55 tll(const tll
&) = default;
56 tll
& operator=(const tll
&) = default;
59 tll(const std::string
& talker
, fields::const_iterator first
, fields::const_iterator last
);
60 virtual std::vector
<std::string
> get_data() const override
;
63 uint32_t target_number
= 0;
65 direction lat_hem
= direction::north
;
67 direction lon_hem
= direction::east
;
70 char target_status
= 'T'; // @todo use an enumeration
71 utils::optional
<char> reference_target
;
74 NMEA_GETTER(target_number
)
75 NMEA_GETTER(target_name
)
77 NMEA_GETTER(target_status
)
78 NMEA_GETTER(reference_target
)
80 geo::longitude
get_longitude() const;
81 geo::latitude
get_latitude() const;
83 void set_target_number(uint32_t t
) noexcept
{ target_number
= t
; }
84 void set_lat(const geo::latitude
& t
);
85 void set_lon(const geo::longitude
& t
);
86 void set_target_name(const waypoint
& t
) { target_name
= t
; }
87 void set_time_utc(const nmea::time
& t
) noexcept
{ time_utc
= t
; }
88 void set_target_status(char t
) noexcept
{ target_status
= t
; }
89 void set_reference_target(char t
) noexcept
{ reference_target
= t
; }