SeaTalk: message 54 added.
[marnav.git] / src / marnav / seatalk / message_30.hpp
blobc1b0e8a5b3c4a4f927dd554ad339122d78c04c0c
1 #ifndef __SEATALK__MESSAGE_30__HPP__
2 #define __SEATALK__MESSAGE_30__HPP__
4 #include <marnav/seatalk/message.hpp>
6 namespace marnav
8 namespace seatalk
11 /// @brief Set Lamp Intensity
12 ///
13 /// @code
14 /// 30 00 0X
15 ///
16 /// X = 0: L0
17 /// X = 4: L1
18 /// X = 8: L2
19 /// X = C: L3
20 /// @endcode
21 ///
22 /// only sent once when setting the lamp intensity
23 ///
24 class message_30 : public message
26 public:
27 constexpr static const message_id ID = message_id::set_lamp_intensity;
29 enum class intensity : uint8_t { L0 = 0x00, L1 = 0x04, L2 = 0x08, L3 = 0x0c };
31 message_30();
32 message_30(const message_30 &) = default;
33 message_30 & operator=(const message_30 &) = default;
35 virtual raw get_data() const override;
37 static std::unique_ptr<message> parse(const raw & data);
39 private:
40 intensity value;
42 public:
43 intensity get_intensity() const noexcept { return value; }
45 void set_intensity(intensity t) noexcept { value = t; }
50 #endif