1 #ifndef __SEATALK__MESSAGE_05__HPP__
2 #define __SEATALK__MESSAGE_05__HPP__
4 #include <marnav/seatalk/message.hpp>
11 /// @brief Engine RPM and PITCH
16 /// Engine RPM and PITCH:
17 /// X = 0: RPM & PITCH
18 /// X = 1: RPM & PITCH starboard
19 /// X = 2: PRM & PITCH port
20 /// YY*256+ZZ = RPM Value (signed value, example: YYZZ=0x0110=272 RPM, YYZZ=0xfef0= -272 RPM)
21 /// PP = % Pitch (signed value -128%...+127%, example 0x03=3%, 0xFD= -3%)
24 class message_05
: public message
27 constexpr static const message_id ID
= message_id::engine_rpm_and_pitch
;
29 enum class side_id
{ undefined
, starboard
, port
};
32 message_05(const message_05
&) = default;
33 message_05
& operator=(const message_05
&) = default;
35 virtual raw
get_data() const override
;
37 static std::unique_ptr
<message
> parse(const raw
& data
);
45 side_id
get_side() const noexcept
{ return side
; }
46 int16_t get_rpm() const noexcept
{ return rpm
; }
47 int8_t get_percent_pitch() const noexcept
{ return percent_pitch
; }
49 void set_side(side_id t
) noexcept
{ side
= t
; }
50 void set_rpm(int16_t t
) noexcept
{ rpm
= t
; }
51 void set_percent_pitch(int8_t t
) noexcept
{ percent_pitch
= t
; }