NMEA: sentence ACK added
[marnav.git] / src / marnav / nmea / ack.cpp
blob2da5449ad27b4c127ad11b742a551880d8dfb9bd
1 #include <marnav/nmea/ack.hpp>
2 #include <marnav/nmea/io.hpp>
4 namespace marnav
6 namespace nmea
8 constexpr sentence_id ack::ID;
9 constexpr const char * ack::TAG;
11 ack::ack()
12 : sentence(ID, TAG, talker::integrated_navigation)
16 ack::ack(talker talk)
17 : sentence(ID, TAG, talk)
21 ack::ack(talker talk, fields::const_iterator first, fields::const_iterator last)
22 : sentence(ID, TAG, talk)
24 if (std::distance(first, last) != 1)
25 throw std::invalid_argument{"invalid number of fields in ack"};
27 read(*(first + 0), number_);
30 void ack::append_data_to(std::string & s) const
32 append(s, to_string(number_));