26 const string server =
"www.euref-ip.net";
27 const int server_port = 2101;
32 bool ret = CNTRIPClient::retrieveListOfMountpoints(
33 lst, errMsg, server, server_port);
37 cout <<
"Error: " << errMsg << endl;
43 cout <<
"Zero streams listed in caster...?" << endl;
49 for (CNTRIPClient::TListMountPoints::const_iterator it = lst.begin();
50 it != lst.end(); it++)
64 CNTRIPClient::TListMountPoints::iterator it = lst.begin();
67 cout <<
"Connecting to: " << it->mountpoint_name <<
" - " << it->id << endl;
68 params.mountpoint = it->mountpoint_name;
79 cout <<
"ERROR: " << msgerr << endl;
83 cout <<
"Reading stream... press any key to finish." << endl;
85 std::vector<uint8_t> dat;
89 cout <<
"Read " << dat.size() <<
" bytes." << endl;
90 std::this_thread::sleep_for(1000ms);
98 const string server =
"193.144.251.13";
99 const int server_port = 2101;
106 params.mountpoint =
"ACOR0";
108 params.port = server_port;
116 cout <<
"ERROR: " << msgerr << endl;
120 cout <<
"Reading stream... press any key to finish." << endl;
122 std::vector<uint8_t> dat;
126 cout <<
"Read " << dat.size() <<
" bytes." << endl;
127 std::this_thread::sleep_for(1000ms);
141 catch (
const std::exception& e)
bool open(const NTRIPArgs ¶ms, std::string &out_errmsg)
Tries to open a given NTRIP stream and, if successful, launches a thread for continuously reading fro...
std::string mountpoint_name
Contains classes for various device interfaces.
mrpt::vision::TStereoCalibParams params
A client for NTRIP (HTTP) sources of differential GPS corrections from internet servers, or Global navigation satellite system (GNSS) internet radio.
A descriptor of one stream in an NTRIP Caster - See CNTRIPClient::retrieveListOfMountpoints.
std::string format
RTCM 2.3, RTCM 3, CMR+, etc...
std::string country_code
ITA, ESP, DEU,...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
bool kbhit() noexcept
An OS-independent version of kbhit, which returns true if a key has been pushed.
std::string exception_to_str(const std::exception &e)
Builds a nice textual representation of a nested exception, which if generated using MRPT macros (THR...
void readAndClear(std::vector< uint8_t > &d)
Read the whole buffer and empty it.
std::list< TMountPoint > TListMountPoints
Used in CNTRIPClient::retrieveListOfMountpoints.
The arguments for connecting to a NTRIP stream, used in CNTRIPClient::open.
mrpt::containers::MT_buffer stream_data
The buffer with all the bytes so-far read from the NTRIP server stream.