Build: enhance docker use, reducing build options, cleanup
[marnav.git] / src / marnav / seatalk / message_54.hpp
blobdbc5e68d468b525b17b384eb39cafbbc2b3e33a5
1 #ifndef MARNAV__SEATALK__MESSAGE_54__HPP
2 #define MARNAV__SEATALK__MESSAGE_54__HPP
4 #include <marnav/seatalk/message.hpp>
6 namespace marnav
8 namespace seatalk
11 /// @brief GMT-Time
12 ///
13 /// @code
14 /// 54 T1 RS HH
15 ///
16 /// GMT-time:
17 /// HH hours,
18 /// 6 MSBits of RST = minutes = (RS & 0xFC) / 4
19 /// 6 LSBits of RST = seconds = ST & 0x3F
20 /// @endcode
21 ///
22 /// Corresponding NMEA sentences: RMC, GAA, BWR, BWC
23 ///
24 class message_54 : public message
26 public:
27 constexpr static const message_id ID = message_id::gmt_time;
28 constexpr static size_t SIZE = 4;
30 message_54();
31 message_54(const message_54 &) = default;
32 message_54 & operator=(const message_54 &) = default;
34 virtual raw get_data() const override;
36 static std::unique_ptr<message> parse(const raw & data);
38 private:
39 uint8_t hour_;
40 uint8_t minute_;
41 uint8_t second_;
43 public:
44 uint8_t get_hour() const noexcept { return hour_; }
45 uint8_t get_minute() const noexcept { return minute_; }
46 uint8_t get_second() const noexcept { return second_; }
48 void set_time(uint8_t h, uint8_t m, uint8_t s) noexcept;
53 #endif