Dev: minor cleanup of include blockers, they are now consistent.
[marnav.git] / src / marnav / seatalk / message_00.hpp
blob04c0f6d8937c0ee9e8d84a70b86a4195a538f0c8
1 #ifndef __MARNAV__SEATALK__MESSAGE_00__HPP__
2 #define __MARNAV__SEATALK__MESSAGE_00__HPP__
4 #include <marnav/seatalk/message.hpp>
6 namespace marnav
8 namespace seatalk
11 /// @brief Depth below transducer
12 ///
13 /// @code
14 /// 00 02 YZ XX XX
15 ///
16 /// Depth below transducer: XXXX/10 feet
17 /// Flags in Y: Y&8 = 8: Anchor Alarm is active
18 /// Y&4 = 4: Metric display units or
19 /// Fathom display units if followed by command 65
20 /// Y&2 = 2: Used, unknown meaning
21 /// Flags in Z: Z&4 = 4: Transducer defective
22 /// Z&2 = 2: Deep Alarm is active
23 /// Z&1 = 1: Shallow Depth Alarm is active
24 /// @endcode
25 ///
26 /// Corresponding NMEA sentences: DPT, DBT
27 ///
28 class message_00 : public message
30 public:
31 constexpr static message_id ID = message_id::depth_below_transducer;
32 constexpr static size_t SIZE = 5;
34 message_00();
35 message_00(const message_00 &) = default;
36 message_00 & operator=(const message_00 &) = default;
38 virtual raw get_data() const override;
40 static std::unique_ptr<message> parse(const raw & data);
42 private:
43 bool anchor_alarm_active;
44 bool metric_display_units;
45 bool transducer_defective;
46 bool depth_alarm_active;
47 bool shallow_depth_alarm_active;
48 uint16_t depth; // in 1/10th of feet, 1 m = 3.2808 feet
50 public:
51 bool get_anchor_alarm_active() const noexcept { return anchor_alarm_active; }
52 bool get_metric_display_units() const noexcept { return metric_display_units; }
53 bool get_transducer_defective() const noexcept { return transducer_defective; }
54 bool get_depth_alarm_active() const noexcept { return depth_alarm_active; }
55 bool get_shallow_depth_alarm_active() const noexcept { return shallow_depth_alarm_active; }
56 uint16_t get_depth() const noexcept { return depth; }
58 void set_anchor_alarm_active(bool t) noexcept { anchor_alarm_active = t; }
59 void set_metric_display_units(bool t) noexcept { metric_display_units = t; }
60 void set_transducer_defective(bool t) noexcept { transducer_defective = t; }
61 void set_depth_alarm_active(bool t) noexcept { depth_alarm_active = t; }
62 void set_shallow_depth_alarm_active(bool t) noexcept { shallow_depth_alarm_active = t; }
63 void set_depth(uint16_t t) noexcept { depth = t; }
65 public:
66 double get_depth_meters() const noexcept;
67 void set_depth_meters(double t) noexcept;
72 #endif