1 #include <marnav/ais/message_06.hpp>
5 constexpr message_id
message_06::ID
;
6 constexpr std::size_t message_06::SIZE_BITS_HEAD
;
7 constexpr std::size_t message_06::SIZE_BITS_MAX
;
9 message_06::message_06()
14 message_06::message_06(const raw
& bits
)
17 if ((bits
.size() < SIZE_BITS_HEAD
) || (bits
.size() > SIZE_BITS_MAX
))
18 throw std::invalid_argument
{"invalid number of bits in ais/message_06"};
22 void message_06::read_data(const raw
& bits
)
24 get(bits
, repeat_indicator_
);
26 get(bits
, sequence_no_
);
27 get(bits
, dest_mmsi_
);
28 get(bits
, retransmit_flag_
);
32 payload_
= raw
{bits
.begin() + SIZE_BITS_HEAD
, bits
.end()};
35 raw
message_06::get_data() const
37 raw
bits(SIZE_BITS_HEAD
);
39 bits
.set(type(), 0, 6);
40 set(bits
, repeat_indicator_
);
42 set(bits
, sequence_no_
);
43 set(bits
, dest_mmsi_
);
44 set(bits
, retransmit_flag_
);
48 bits
.append(payload_
);