1 #ifndef __NMEA__VDR__HPP__
2 #define __NMEA__VDR__HPP__
4 #include <marnav/nmea/sentence.hpp>
5 #include <marnav/utils/optional.hpp>
11 MARNAV_NMEA_DECLARE_SENTENCE_PARSE_FUNC(vdr
)
13 /// @brief VDR - Set and Drift
18 /// $--VDR,x.x,T,x.x,M,x.x,N*hh<CR><LF>
23 /// 2. Degress True reference
25 /// 3. Degrees Magnetic
26 /// 4. Degrees Magnetic reference
28 /// 5. Speed of current
29 /// 6. Speed of current unit
32 class vdr
: public sentence
34 MARNAV_NMEA_SENTENCE_FRIENDS(vdr
)
37 constexpr static const sentence_id ID
= sentence_id::VDR
;
38 constexpr static const char * TAG
= "VDR";
43 vdr(const vdr
&) = default;
44 vdr
& operator=(const vdr
&) = default;
47 vdr(const std::string
& talker
, fields::const_iterator first
, fields::const_iterator last
);
48 virtual std::vector
<std::string
> get_data() const override
;
51 utils::optional
<double> degrees_true
;
52 utils::optional
<reference
> degrees_true_ref
; // T:true
53 utils::optional
<double> degrees_mag
;
54 utils::optional
<reference
> degrees_mag_ref
; // M:magnetic
55 utils::optional
<double> speed
;
56 utils::optional
<unit::velocity
> speed_unit
; // N:knots
59 NMEA_GETTER(degrees_true
)
60 NMEA_GETTER(degrees_true_ref
)
61 NMEA_GETTER(degrees_mag
)
62 NMEA_GETTER(degrees_mag_ref
)
64 NMEA_GETTER(speed_unit
)
66 void set_degrees_true(double t
) noexcept
;
67 void set_degrees_mag(double t
) noexcept
;
68 void set_speed(double t
) noexcept
;