2 #include <marnav/nmea/io.hpp>
8 MARNAV_NMEA_DEFINE_SENTENCE_PARSE_FUNC(wcv
)
10 constexpr const char * wcv::TAG
;
13 : sentence(ID
, TAG
, talker_id::global_positioning_system
)
17 wcv::wcv(const std::string
& talker
, fields::const_iterator first
, fields::const_iterator last
)
18 : sentence(ID
, TAG
, talker
)
20 if (std::distance(first
, last
) != 3)
21 throw std::invalid_argument
{"invalid number of fields in wcv"};
23 read(*(first
+ 0), speed
);
24 read(*(first
+ 1), speed_unit
);
25 read(*(first
+ 2), waypoint_id
);
28 void wcv::set_speed(double t
) noexcept
31 speed_unit
= unit::velocity::knot
;
34 std::vector
<std::string
> wcv::get_data() const
36 return {format(speed
, 1), to_string(speed_unit
), to_string(waypoint_id
)};