1 #ifndef __MARNAV__AIS__MESSAGE_06__HPP__
2 #define __MARNAV__AIS__MESSAGE_06__HPP__
4 #include <marnav/ais/message.hpp>
5 #include <marnav/utils/mmsi.hpp>
11 MARNAV_AIS_DECLARE_MESSAGE_PARSE_FUNC(message_06
)
13 /// @brief Binary Addressed Message
14 class message_06
: public message
16 MARNAV_AIS_MESSAGE_FRIENDS(message_06
)
19 constexpr static const message_id ID
= message_id::binary_addressed_message
;
20 constexpr static const int SIZE_BITS_HEAD
= 88;
21 constexpr static const int SIZE_BITS_MAX
= 1008;
24 message_06(const message_06
&) = default;
25 message_06
& operator=(const message_06
&) = default;
26 message_06(message_06
&&) = default;
27 message_06
& operator=(message_06
&&) = default;
30 message_06(const raw
& bits
);
31 void read_data(const raw
& bits
);
32 virtual raw
get_data() const override
;
36 bitset_value
< 6, 2, uint32_t> repeat_indicator
= 0;
37 bitset_value
< 8, 30, uint32_t> mmsi
= 0;
38 bitset_value
<38, 2, uint32_t> sequence_no
= 0;
39 bitset_value
<40, 30, uint32_t> dest_mmsi
= 0;
40 bitset_value
<70, 1, bool > retransmit_flag
= false;
41 bitset_value
<72, 10, uint32_t> dac
= 0; ///< Designate Area Cod3
42 bitset_value
<82, 6, uint32_t> fid
= 0; ///< Functional ID
45 // unfortuanately std::variant is C++17, therefore we need to store
46 // the binary payload and parse it later.
50 uint32_t get_repeat_indicator() const noexcept
{ return repeat_indicator
; }
51 utils::mmsi
get_mmsi() const noexcept
{ return utils::mmsi
{mmsi
}; }
52 uint32_t get_sequnce_no() const noexcept
{ return sequence_no
; }
53 utils::mmsi
get_dest_mmsi() const noexcept
{ return utils::mmsi
{dest_mmsi
}; }
54 bool get_retransmit_flag() const noexcept
{ return retransmit_flag
; }
55 uint32_t get_dac() const noexcept
{ return dac
; }
56 uint32_t get_fid() const noexcept
{ return fid
; }
58 void set_repeat_indicator(uint32_t t
) noexcept
{ repeat_indicator
= t
; }
59 void set_mmsi(const utils::mmsi
& t
) noexcept
{ mmsi
= t
; }
60 void set_sequnce_no(uint32_t t
) noexcept
{ sequence_no
= t
; }
61 void set_dest_mmsi(const utils::mmsi
& t
) noexcept
{ dest_mmsi
= t
; }
62 void set_retransmit_flag(bool t
) noexcept
{ retransmit_flag
= t
; }
63 void set_dac(uint32_t t
) noexcept
{ dac
= t
; }
64 void set_fid(uint32_t t
) noexcept
{ fid
= t
; }