1 #include <marnav/nmea/mta.hpp>
2 #include <marnav/nmea/io.hpp>
7 constexpr sentence_id
mta::ID
;
8 constexpr const char * mta::TAG
;
11 : sentence(ID
, TAG
, talker::integrated_instrumentation
)
15 mta::mta(talker talk
, fields::const_iterator first
, fields::const_iterator last
)
16 : sentence(ID
, TAG
, talk
)
18 if (std::distance(first
, last
) != 2)
19 throw std::invalid_argument
{"invalid number of fields in mta"};
21 unit::temperature temperature_unit
;
23 read(*(first
+ 0), temperature_
);
24 read(*(first
+ 1), temperature_unit
);
26 check_value(temperature_unit
, {unit::temperature::celsius
}, "temperature unit");
29 void mta::set_temperature(units::temperature t
) noexcept
31 temperature_
= t
.get
<units::celsius
>();
34 void mta::append_data_to(std::string
& s
, const version
&) const
36 append(s
, format(temperature_
, 1));
37 append(s
, to_string(unit::temperature::celsius
));