Class CNTRIPClient
Defined in File CNTRIPClient.h
Nested Relationships
Nested Types
Class Documentation
-
class CNTRIPClient
A client for NTRIP (HTTP) sources of differential GPS corrections from internet servers, or Global navigation satellite system (GNSS) internet radio. Usage:
To open the server, invoke “open” with the proper parameters. Then use “stream_data” to read the read data.
To obtain a list of all the mountpoints available at a given NTRIP Caster, call “retrieveListOfMountpoints” (it’s a static method).
It is not necessary to call “close”, the connection is ended at destruction.
Note
For a good reference of the NTRIP protocol, see http://gnss.itacyl.es/opencms/opencms/system/modules/es.jcyl.ita.site.gnss/resources/documentos_gnss/NtripDocumentation.pdf
Public Types
-
using TListMountPoints = std::list<TMountPoint>
Public Functions
-
CNTRIPClient()
Default constructor
-
virtual ~CNTRIPClient()
Default destructor
-
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 from it.
See also
- Returns:
false On any kind of error, with a description of the error in errmsg, if provided.
-
void sendBackToServer(const std::string &data)
Enqueues a string to be sent back to the NTRIP server (e.g. GGA frames)
Public Members
Public Static Functions
-
static bool retrieveListOfMountpoints(TListMountPoints &out_list, std::string &out_errmsg, const std::string &server, int port = 2101, const std::string &auth_user = std::string(), const std::string &auth_pass = std::string())
Connect to a given NTRIP caster and get the list of all available mountpoints and their parameters. Note that the authentication parameters “auth_user” and “auth_pass” will be left empty in most situations, since LISTING the Caster normally doesn’t require special rights.
Example:
CNTRIPClient::TListMountPoints lst; std::string errMsg; bool ret = *CNTRIPClient::retrieveListOfMountpoints(lst,errMsg,"www.euref-ip.net", 2101);
- Returns:
False on any error, then “errmsg” holds the reason.
Protected Types
Protected Functions
-
void private_ntrip_thread()
The working thread
Protected Attributes
-
std::thread m_thread
-
std::promise<void> m_sem_sock_closed
-
std::promise<void> m_sem_first_connect_done
-
mutable bool m_thread_exit = {false}
-
mutable bool m_thread_do_process = {false}
Will be “true” between “open” and “close”
-
mutable bool m_waiting_answer_connection = {false}
-
mutable TConnResult m_answer_connection = {connError}
-
struct NTRIPArgs
The arguments for connecting to a NTRIP stream, used in CNTRIPClient::open
Public Functions
-
NTRIPArgs() = default
Default params
-
NTRIPArgs() = default
-
struct TMountPoint
A descriptor of one stream in an NTRIP Caster - See CNTRIPClient::retrieveListOfMountpoints
Public Functions
-
TMountPoint() = default
Public Members
-
std::string mountpoint_name
-
std::string id
City name
-
std::string format
RTCM 2.3, RTCM 3, CMR+, etc…
-
std::string format_details
-
int carrier = {0}
0: No carrier phase, 1: L1, 2: L1+L2
GPS, …
-
std::string network
IGS, …
-
std::string country_code
ITA, ESP, DEU,…
-
double latitude = {0}
-
double longitude = {0}
-
bool needs_nmea = {false}
-
bool net_ref_stations = {false}
-
std::string generator_model
-
std::string compr_encryp
“none”
-
char authentication = {'B'}
“N”: none, “B”: basic, “D”: digest
-
bool pay_service = {false}
-
int stream_bitspersec = {0}
-
std::string extra_info
-
TMountPoint() = default