1 #ifndef __MARNAV__NMEA__DSE__HPP__
2 #define __MARNAV__NMEA__DSE__HPP__
4 #include <marnav/nmea/sentence.hpp>
5 #include <marnav/utils/optional.hpp>
6 #include <marnav/utils/mmsi.hpp>
12 MARNAV_NMEA_DECLARE_SENTENCE_PARSE_FUNC(dse
)
14 /// @brief DSE - Extended DSC
16 /// @note This class is @b EXPERIMENTAL
21 /// $--DSE,x,x,a,xxxxxxxxx,xx,c--c,...,xx,c--c*hh<CR><LF>
25 /// 1. Total number of messages
26 /// 2. Sentence number
27 /// 3. Query/Reply Flag
31 /// 4. Address (identical to DSC)
35 /// There may be a variable number of data sets (code, data)
37 /// @todo Implementation of data set fields
39 class dse
: public sentence
41 MARNAV_NMEA_SENTENCE_FRIENDS(dse
)
44 constexpr static const sentence_id ID
= sentence_id::DSE
;
45 constexpr static const char * TAG
= "DSE";
47 enum class query_flag
: char { query
, reply
, a
};
49 enum class code_id
: uint32_t {
50 enhanced_position_resolution
, ///< 100
51 source_and_data_of_position
, ///< 101
52 current_speed_of_vessel
, ///< 102
53 current_course_of_vessel
, ///< 103
54 additional_station_identification
, ///< 104
55 enhanced_geographic_area
, ///< 105
56 number_of_persons_on_board
///< 106
65 dse(const dse
&) = default;
66 dse
& operator=(const dse
&) = default;
67 dse(dse
&&) = default;
68 dse
& operator=(dse
&&) = default;
71 dse(talker talk
, fields::const_iterator first
, fields::const_iterator last
);
72 virtual std::vector
<std::string
> get_data() const override
;
75 uint32_t number_of_messages
= 1;
76 uint32_t sentence_number
= 1;
77 query_flag flag
= query_flag::query
;
81 decltype(number_of_messages
) get_number_of_messages() const { return number_of_messages
; }
82 decltype(sentence_number
) get_sentence_number() const { return sentence_number
; }
83 decltype(flag
) get_flag() const { return flag
; }
84 utils::mmsi
get_mmsi() const;
86 void set_number_of_messages(uint32_t t
) noexcept
{ number_of_messages
= t
; }
87 void set_sentence_number(uint32_t t
) noexcept
{ sentence_number
= t
; }
88 void set_flag(query_flag t
) noexcept
{ flag
= t
; }
89 void set_mmsi(const utils::mmsi
& t
) noexcept
;
92 std::string
to_string(dse::query_flag value
);
93 std::string
to_string(dse::code_id value
);