1 #ifndef __MARNAV__NMEA__VBW__HPP__
2 #define __MARNAV__NMEA__VBW__HPP__
4 #include <marnav/nmea/sentence.hpp>
5 #include <marnav/utils/optional.hpp>
11 MARNAV_NMEA_DECLARE_SENTENCE_PARSE_FUNC(vbw
)
13 /// @brief VBW - Dual Ground/Water Speed
18 /// $--VBW,x.x,x.x,A,x.x,x.x,A*hh<CR><LF>
22 /// 1. Longitudinal water speed, "-" means astern
23 /// 2. Transverse water speed, "-" means port
24 /// 3. Status, A = Data Valid
27 /// 4. Longitudinal ground speed, "-" means astern
28 /// 5. Transverse ground speed, "-" means port
33 class vbw
: public sentence
35 MARNAV_NMEA_SENTENCE_FRIENDS(vbw
)
38 constexpr static const sentence_id ID
= sentence_id::VBW
;
39 constexpr static const char * TAG
= "VBW";
42 vbw(const vbw
&) = default;
43 vbw
& operator=(const vbw
&) = default;
44 vbw(vbw
&&) = default;
45 vbw
& operator=(vbw
&&) = default;
48 vbw(const std::string
& talker
, fields::const_iterator first
, fields::const_iterator last
);
49 virtual std::vector
<std::string
> get_data() const override
;
52 utils::optional
<double> water_speed_longitudinal
;
53 utils::optional
<double> water_speed_transveral
;
54 utils::optional
<status
> water_speed_status
;
55 utils::optional
<double> ground_speed_longitudinal
;
56 utils::optional
<double> ground_speed_transveral
;
57 utils::optional
<status
> ground_speed_status
;
60 decltype(water_speed_longitudinal
) get_water_speed_longitudinal() const
62 return water_speed_longitudinal
;
64 decltype(water_speed_transveral
) get_water_speed_transveral() const
66 return water_speed_transveral
;
68 decltype(water_speed_status
) get_water_speed_status() const { return water_speed_status
; }
69 decltype(ground_speed_longitudinal
) get_ground_speed_longitudinal() const
71 return ground_speed_longitudinal
;
73 decltype(ground_speed_transveral
) get_ground_speed_transveral() const
75 return ground_speed_transveral
;
77 decltype(ground_speed_status
) get_ground_speed_status() const
79 return ground_speed_status
;
82 void set_water_speed(double l
, double t
, status s
) noexcept
;
83 void set_ground_speed(double l
, double t
, status s
) noexcept
;