1 #ifndef __MARNAV__SEATALK__MESSAGE_00__HPP__
2 #define __MARNAV__SEATALK__MESSAGE_00__HPP__
4 #include <marnav/seatalk/message.hpp>
11 /// @brief Depth below transducer
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
26 /// Corresponding NMEA sentences: DPT, DBT
28 class message_00
: public message
31 constexpr static message_id ID
= message_id::depth_below_transducer
;
32 constexpr static size_t SIZE
= 5;
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
);
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
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
; }
66 double get_depth_meters() const noexcept
;
67 void set_depth_meters(double t
) noexcept
;