2 #include <marnav/nmea/io.hpp>
8 MARNAV_NMEA_DEFINE_SENTENCE_PARSE_FUNC(msk
)
10 constexpr const char * msk::TAG
;
13 : sentence(ID
, TAG
, talker_id::global_positioning_system
)
17 msk::msk(talker talk
, fields::const_iterator first
, fields::const_iterator last
)
18 : sentence(ID
, TAG
, talk
)
20 if (std::distance(first
, last
) != 5)
21 throw std::invalid_argument
{"invalid number of fields in msk"};
23 read(*(first
+ 0), frequency
);
24 read(*(first
+ 1), frequency_mode
);
25 read(*(first
+ 2), bitrate
);
26 read(*(first
+ 3), bitrate_mode
);
27 read(*(first
+ 4), frequency_mss_status
);
30 void msk::set_frequency(uint32_t f
, selection_mode mode
) noexcept
33 frequency_mode
= mode
;
36 void msk::set_bitrate(uint32_t rate
, selection_mode mode
) noexcept
42 std::vector
<std::string
> msk::get_data() const
44 return {format(frequency
, 3), to_string(frequency_mode
), format(bitrate
, 3),
45 to_string(bitrate_mode
), format(frequency_mss_status
, 3)};