1 #ifndef __MARNAV__NMEA__FSI__HPP__
2 #define __MARNAV__NMEA__FSI__HPP__
4 #include <marnav/nmea/sentence.hpp>
5 #include <marnav/utils/optional.hpp>
11 MARNAV_NMEA_DECLARE_SENTENCE_PARSE_FUNC(fsi
)
13 /// @brief FSI - Frequency Set Information
18 /// $--FSI,xxxxxx,xxxxxx,c,x,a*hh<CR><LF>
22 /// 1. Transmitting Frequency in 100Hz increments
23 /// 2. Receiving Frequency in 100Hz increments
24 /// 3. Mode of operation
27 /// - 1..9 = intensity (1=lowest, 9=highest)
28 /// 5. Sentence Status Flag
29 /// - R = Report of current settings
30 /// - C = Configuration command to change settings
32 class fsi
: public sentence
34 MARNAV_NMEA_SENTENCE_FRIENDS(fsi
)
37 constexpr static const sentence_id ID
= sentence_id::FSI
;
38 constexpr static const char * TAG
= "FSI";
41 fsi(const fsi
&) = default;
42 fsi
& operator=(const fsi
&) = default;
43 fsi(fsi
&&) = default;
44 fsi
& operator=(fsi
&&) = default;
47 fsi(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
<uint32_t> tx_frequency
;
52 utils::optional
<uint32_t> rx_frequency
;
53 utils::optional
<char> communications_mode
;
54 utils::optional
<uint32_t> power_level
;
55 utils::optional
<char> sentence_status
;
58 decltype(tx_frequency
) get_tx_frequency() const { return tx_frequency
; }
59 decltype(rx_frequency
) get_rx_frequency() const { return rx_frequency
; }
60 decltype(communications_mode
) get_communications_mode() const
62 return communications_mode
;
64 decltype(power_level
) get_power_level() const { return power_level
; }
65 decltype(sentence_status
) get_sentence_status() const { return sentence_status
; }
67 void set_tx_frequency(uint32_t t
) noexcept
{ tx_frequency
= t
; }
68 void set_rx_frequency(uint32_t t
) noexcept
{ rx_frequency
= t
; }
69 void set_communications_mode(char t
) noexcept
{ communications_mode
= t
; }
70 void set_power_level(uint32_t t
);
71 void set_sentence_status(char t
);