Version 0.6.1
[marnav.git] / examples / create_nmea_from_ais_2.cpp
blobaf3730a0a0a0a2a02cb81efcad0f2154afde0949
1 #include <iostream>
2 #include <marnav/ais/message_01.hpp>
3 #include <marnav/ais/ais.hpp>
4 #include <marnav/nmea/ais_helper.hpp>
6 int main(int, char **)
8 using namespace marnav;
10 // prepare AIS data
11 ais::message_01 pos_report;
12 pos_report.set_sog(82);
13 // ... most data not shown here
15 // create payload
16 auto payload = ais::encode_message(pos_report);
18 // create NMEA sentences
19 auto sentences = nmea::make_vdms(payload);
21 // process sentences, somehow...
22 for (auto const & sentence : sentences) {
23 std::cout << nmea::to_string(*sentence) << "\n";