1 #ifndef __MARNAV__NMEA__MTW__HPP__
2 #define __MARNAV__NMEA__MTW__HPP__
4 #include <marnav/nmea/sentence.hpp>
5 #include <marnav/utils/optional.hpp>
11 MARNAV_NMEA_DECLARE_SENTENCE_PARSE_FUNC(mtw
)
13 /// @brief MTW - Mean Temperature of Water
18 /// $--MTW,x.x,C*hh<CR><LF>
23 /// 2. Unit of Measurement
26 class mtw
: public sentence
28 MARNAV_NMEA_SENTENCE_FRIENDS(mtw
)
31 constexpr static const sentence_id ID
= sentence_id::MTW
;
32 constexpr static const char * TAG
= "MTW";
35 mtw(const mtw
&) = default;
36 mtw
& operator=(const mtw
&) = default;
37 mtw(mtw
&&) = default;
38 mtw
& operator=(mtw
&&) = default;
41 mtw(talker talk
, fields::const_iterator first
, fields::const_iterator last
);
42 virtual std::vector
<std::string
> get_data() const override
;
45 utils::optional
<double> temperature
; // water temperature
46 utils::optional
<unit::temperature
> temperature_unit
; // unit degrees, C:celcius
49 decltype(temperature
) get_temperature() const { return temperature
; }
50 decltype(temperature_unit
) get_temperature_unit() const { return temperature_unit
; }
52 void set_temperature(double t
) noexcept
;