Main MRPT website > C++ reference for MRPT 1.4.0
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes
mrpt::hwdrivers::CNTRIPClient Class Reference

Detailed Description

A client for NTRIP (HTTP) sources of differential GPS corrections from internet servers, or Global navigation satellite system (GNSS) internet radio.

Usage:

It is not neccesary 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

Definition at line 36 of file CNTRIPClient.h.

#include <mrpt/hwdrivers/CNTRIPClient.h>

Classes

struct  NTRIPArgs
 The arguments for connecting to a NTRIP stream, used in CNTRIPClient::open. More...
 
struct  TMountPoint
 A descriptor of one stream in an NTRIP Caster - See CNTRIPClient::retrieveListOfMountpoints. More...
 

Public Types

typedef std::list< TMountPointTListMountPoints
 Used in CNTRIPClient::retrieveListOfMountpoints.
 

Public Member Functions

 CNTRIPClient ()
 Default constructor.
 
virtual ~CNTRIPClient ()
 Default destructor.
 
bool open (const NTRIPArgs &params, std::string &out_errmsg)
 Tries to open a given NTRIP stream and, if successful, launches a thread for continuously reading from it.
 
void close ()
 Closes the connection.
 
void sendBackToServer (const std::string &data)
 Enqueues a string to be sent back to the NTRIP server (e.g.
 

Static Public Member 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.
 

Public Attributes

mrpt::synch::MT_buffer stream_data
 The buffer with all the bytes so-far read from the NTRIP server stream.
 

Protected Types

enum  TConnResult { connOk = 0 , connError , connUnauthorized }
 

Protected Member Functions

void private_ntrip_thread ()
 The working thread.
 

Protected Attributes

mrpt::system::TThreadHandle m_thread
 
mrpt::synch::CSemaphore m_sem_sock_closed
 
mrpt::synch::CSemaphore m_sem_first_connect_done
 
bool m_thread_exit
 
bool m_thread_do_process
 Will be "true" between "open" and "close".
 
bool m_waiting_answer_connection
 
TConnResult m_answer_connection
 
NTRIPArgs m_args
 All the parameters for the NTRIP connection.
 
mrpt::synch::MT_buffer m_upload_data
 Buffer for data to be sent back to the server.
 

Member Typedef Documentation

◆ TListMountPoints

Used in CNTRIPClient::retrieveListOfMountpoints.

Definition at line 75 of file CNTRIPClient.h.

Member Enumeration Documentation

◆ TConnResult

Enumerator
connOk 
connError 
connUnauthorized 

Definition at line 109 of file CNTRIPClient.h.

Constructor & Destructor Documentation

◆ CNTRIPClient()

mrpt::hwdrivers::CNTRIPClient::CNTRIPClient ( )

Default constructor.

◆ ~CNTRIPClient()

virtual mrpt::hwdrivers::CNTRIPClient::~CNTRIPClient ( )
virtual

Default destructor.

Member Function Documentation

◆ close()

void mrpt::hwdrivers::CNTRIPClient::close ( )

Closes the connection.

See also
open

◆ open()

bool mrpt::hwdrivers::CNTRIPClient::open ( const NTRIPArgs params,
std::string &  out_errmsg 
)

Tries to open a given NTRIP stream and, if successful, launches a thread for continuously reading from it.

See also
close, stream_data
Returns
false On any kind of error, with a description of the error in errmsg, if provided.

◆ private_ntrip_thread()

void mrpt::hwdrivers::CNTRIPClient::private_ntrip_thread ( )
protected

The working thread.

◆ retrieveListOfMountpoints()

static bool mrpt::hwdrivers::CNTRIPClient::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() 
)
static

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:

std::string errMsg;
bool ret = CNTRIPClient::retrieveListOfMountpoints(lst,errMsg,"www.euref-ip.net", 2101);
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.
std::list< TMountPoint > TListMountPoints
Used in CNTRIPClient::retrieveListOfMountpoints.
Definition: CNTRIPClient.h:75
Returns
False on any error, then "errmsg" holds the reason.

◆ sendBackToServer()

void mrpt::hwdrivers::CNTRIPClient::sendBackToServer ( const std::string &  data)

Enqueues a string to be sent back to the NTRIP server (e.g.

GGA frames)

Member Data Documentation

◆ m_answer_connection

TConnResult mrpt::hwdrivers::CNTRIPClient::m_answer_connection
mutableprotected

Definition at line 115 of file CNTRIPClient.h.

◆ m_args

NTRIPArgs mrpt::hwdrivers::CNTRIPClient::m_args
mutableprotected

All the parameters for the NTRIP connection.

Definition at line 116 of file CNTRIPClient.h.

◆ m_sem_first_connect_done

mrpt::synch::CSemaphore mrpt::hwdrivers::CNTRIPClient::m_sem_first_connect_done
protected

Definition at line 103 of file CNTRIPClient.h.

◆ m_sem_sock_closed

mrpt::synch::CSemaphore mrpt::hwdrivers::CNTRIPClient::m_sem_sock_closed
protected

Definition at line 102 of file CNTRIPClient.h.

◆ m_thread

mrpt::system::TThreadHandle mrpt::hwdrivers::CNTRIPClient::m_thread
protected

Definition at line 101 of file CNTRIPClient.h.

◆ m_thread_do_process

bool mrpt::hwdrivers::CNTRIPClient::m_thread_do_process
mutableprotected

Will be "true" between "open" and "close".

Definition at line 106 of file CNTRIPClient.h.

◆ m_thread_exit

bool mrpt::hwdrivers::CNTRIPClient::m_thread_exit
mutableprotected

Definition at line 105 of file CNTRIPClient.h.

◆ m_upload_data

mrpt::synch::MT_buffer mrpt::hwdrivers::CNTRIPClient::m_upload_data
protected

Buffer for data to be sent back to the server.

Definition at line 118 of file CNTRIPClient.h.

◆ m_waiting_answer_connection

bool mrpt::hwdrivers::CNTRIPClient::m_waiting_answer_connection
mutableprotected

Definition at line 107 of file CNTRIPClient.h.

◆ stream_data

mrpt::synch::MT_buffer mrpt::hwdrivers::CNTRIPClient::stream_data

The buffer with all the bytes so-far read from the NTRIP server stream.

Call its "readAndClear" method in a timely fashion to get the stream contents.

See also
open, close

Definition at line 140 of file CNTRIPClient.h.




Page generated by Doxygen 1.9.6 for MRPT 1.4.0 SVN: at Sat Jan 21 06:46:15 UTC 2023