Dev: minor cleanup of include blockers, they are now consistent.
[marnav.git] / src / marnav / nmea / fsi.hpp
blob5cd5020b696c6bb95ac4850cf1d829146495e950
1 #ifndef __MARNAV__NMEA__FSI__HPP__
2 #define __MARNAV__NMEA__FSI__HPP__
4 #include <marnav/nmea/sentence.hpp>
5 #include <marnav/utils/optional.hpp>
7 namespace marnav
9 namespace nmea
11 MARNAV_NMEA_DECLARE_SENTENCE_PARSE_FUNC(fsi)
13 /// @brief FSI - Frequency Set Information
14 ///
15 /// @code
16 /// 1 2 3 4 5
17 /// | | | | |
18 /// $--FSI,xxxxxx,xxxxxx,c,x,a*hh<CR><LF>
19 /// @endcode
20 ///
21 /// Field Number:
22 /// 1. Transmitting Frequency in 100Hz increments
23 /// 2. Receiving Frequency in 100Hz increments
24 /// 3. Mode of operation
25 /// 4. Power Level
26 /// - 0 = standby
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
31 ///
32 class fsi : public sentence
34 MARNAV_NMEA_SENTENCE_FRIENDS(fsi)
36 public:
37 constexpr static const sentence_id ID = sentence_id::FSI;
38 constexpr static const char * TAG = "FSI";
40 fsi();
41 fsi(const fsi &) = default;
42 fsi & operator=(const fsi &) = default;
43 fsi(fsi &&) = default;
44 fsi & operator=(fsi &&) = default;
46 protected:
47 fsi(const std::string & talker, fields::const_iterator first, fields::const_iterator last);
48 virtual std::vector<std::string> get_data() const override;
50 private:
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;
57 public:
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);
76 #endif