#include "rtcm.hh" #include "bits.hh" #include #include #include "nmmsender.hh" #include "CLI/CLI.hpp" #include "swrappers.hh" #include "sclasses.hh" #include "version.hh" using namespace std; bool RTCMReader::get(RTCMFrame& rf) { int c; bool skipped=false; while( ((c=fgetc(d_fp)) != -1) && c != 211) { skipped=true; cerr<<"."; continue; } if(skipped) cerr< buf(size); if((int)fread(&buf[0], 1, size, d_fp) != size) return false; // cout<<"Returning true"< destinations; bool doVERSION{false}, doSTDOUT{false}; CLI::App app(program); app.add_option("--destination,-d", destinations, "Send output to this IPv4/v6 address"); app.add_option("--station", g_srcid, "Station id")->required(); app.add_flag("--version", doVERSION, "show program version and copyright"); app.add_flag("--stdout", doSTDOUT, "Emit output to stdout"); try { app.parse(argc, argv); } catch(const CLI::Error &e) { return app.exit(e); } if(doVERSION) { showVersion(program, g_gitHash); exit(0); } signal(SIGPIPE, SIG_IGN); NMMSender ns; ns.d_debug = true; for(const auto& s : destinations) { auto res=resolveName(s, true, true); if(res.empty()) { cerr<<"Unable to resolve '"<set_contents(rf.payload); ns.emitNMM(nmm); // rm.parse(rf.payload); } }