2 #include <marnav/nmea/checks.hpp>
3 #include <marnav/nmea/io.hpp>
9 MARNAV_NMEA_DEFINE_SENTENCE_PARSE_FUNC(fsi
)
11 constexpr const char * fsi::TAG
;
14 : sentence(ID
, TAG
, talker_id::global_positioning_system
)
18 fsi::fsi(talker talk
, fields::const_iterator first
, fields::const_iterator last
)
19 : sentence(ID
, TAG
, talk
)
21 if (std::distance(first
, last
) != 5)
22 throw std::invalid_argument
{"invalid number of fields in fsi"};
24 read(*(first
+ 0), tx_frequency
);
25 read(*(first
+ 1), rx_frequency
);
26 read(*(first
+ 2), communications_mode
);
27 read(*(first
+ 3), power_level
);
28 read(*(first
+ 4), sentence_status
);
31 void fsi::set_power_level(uint32_t t
)
34 throw std::invalid_argument
{"invalid value for power_level (0..9)"};
38 void fsi::set_sentence_status(char t
)
40 check_value(t
, {'R', 'C'}, "sentence_status");
44 std::vector
<std::string
> fsi::get_data() const
46 return {to_string(tx_frequency
), to_string(rx_frequency
), to_string(communications_mode
),
47 to_string(power_level
), to_string(sentence_status
)};