1 #ifndef __NMEA__HDM__HPP__
2 #define __NMEA__HDM__HPP__
4 #include <marnav/nmea/sentence.hpp>
5 #include <marnav/utils/optional.hpp>
11 MARNAV_NMEA_DECLARE_SENTENCE_PARSE_FUNC(hdm
)
13 /// @brief HDM - Heading - Magnetic
15 /// Vessel heading in degrees with respect to magnetic north produced by any device
16 /// or system producing magnetic heading.
18 /// @note As of 2009, this sentence is designaged 'obsolete'. Older devices may
19 /// support them, therefore it makes sense to implement it.
24 /// $--HDM,x.x,M*hh<CR><LF>
28 /// 1. Heading Degrees magnetic
29 /// 2. Heading Degrees magnetic reference
32 class hdm
: public sentence
34 MARNAV_NMEA_SENTENCE_FRIENDS(hdm
)
37 constexpr static const sentence_id ID
= sentence_id::HDM
;
38 constexpr static const char * TAG
= "HDM";
43 hdm(const hdm
&) = default;
44 hdm
& operator=(const hdm
&) = default;
47 hdm(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> heading
; // magnetic sensor heading in deg
52 utils::optional
<reference
> heading_mag
;
56 NMEA_GETTER(heading_mag
)
58 void set_heading(double t
) noexcept
;