1 #include <marnav/ais/message_13.hpp>
7 constexpr message_id
message_13::ID
;
8 constexpr std::size_t message_13::SIZE_BITS_MIN
;
9 constexpr std::size_t message_13::SIZE_BITS_MAX
;
11 message_13::message_13()
16 message_13::message_13(const raw
& bits
)
19 if ((bits
.size() < SIZE_BITS_MIN
) || (bits
.size() > SIZE_BITS_MAX
))
20 throw std::invalid_argument
{"invalid number of bits in ais/message_13"};
24 void message_13::read_data(const raw
& bits
)
26 get(bits
, repeat_indicator
);
29 get(bits
, mmsi_seq_1
);
31 if (bits
.size() > SIZE_BITS_MIN
+ 1 * 32) {
33 get(bits
, mmsi_seq_2
);
35 if (bits
.size() > SIZE_BITS_MIN
+ 2 * 32) {
37 get(bits
, mmsi_seq_3
);
39 if (bits
.size() > SIZE_BITS_MIN
+ 3 * 32) {
41 get(bits
, mmsi_seq_4
);
45 raw
message_13::get_data() const
47 raw
bits(SIZE_BITS_MIN
);
48 bits
.set(type(), 0, 6);
49 set(bits
, repeat_indicator
);
52 set(bits
, mmsi_seq_1
);
55 set(bits
, mmsi_seq_2
);
59 set(bits
, mmsi_seq_3
);
63 set(bits
, mmsi_seq_4
);