2 #include <marnav/nmea/io.hpp>
3 #include <marnav/utils/unique.hpp>
9 MARNAV_NMEA_DEFINE_SENTENCE_PARSE_FUNC(hfb
)
11 constexpr const char * hfb::TAG
;
14 : sentence(ID
, TAG
, talker_id::global_positioning_system
)
18 hfb::hfb(talker talk
, fields::const_iterator first
, fields::const_iterator last
)
19 : sentence(ID
, TAG
, talk
)
21 if (std::distance(first
, last
) != 4)
22 throw std::invalid_argument
{"invalid number of fields in hfb"};
24 read(*(first
+ 0), distance_head_foot
);
25 read(*(first
+ 1), distance_head_foot_unit
);
26 read(*(first
+ 2), distance_head_bottom
);
27 read(*(first
+ 3), distance_head_bottom_unit
);
30 std::vector
<std::string
> hfb::get_data() const
32 return {to_string(distance_head_foot
), to_string(distance_head_foot_unit
),
33 to_string(distance_head_bottom
), to_string(distance_head_bottom_unit
)};