Build: add GCC-13, Clang-14, Clang-15, Clang-16, Clang-17
[marnav.git] / examples / parse_nmea.cpp
blob5064f4261b30b4b40db6d8f8a26288ccb2894dbd
1 #include <marnav/nmea/angle.hpp>
2 #include <marnav/nmea/io.hpp>
3 #include <marnav/nmea/nmea.hpp>
4 #include <marnav/nmea/rmc.hpp>
5 #include <iostream>
7 int main(int, char **)
9 using namespace marnav;
10 using namespace nmea;
12 std::string original
13 = "$GPRMC,201034,A,4702.4040,N,00818.3281,E,0.0,328.4,260807,0.6,E,A*17";
14 auto s = make_sentence(original);
15 auto rmc = sentence_cast<nmea::rmc>(s);
16 std::cout << "original : " << original << "\n";
17 std::cout << "tag : " << rmc->tag() << "\n";
18 std::cout << "time : " << to_string(rmc->get_time_utc()) << "\n";
19 std::cout << "status : " << to_string(rmc->get_status()) << "\n";
20 std::cout << "latitude : " << to_string(rmc->get_lat()) << "\n";
21 std::cout << "longitude: " << to_string(rmc->get_lon()) << "\n";