Main MRPT website > C++ reference
MRPT logo

mrpt::hwdrivers::CNTRIPClient Class Reference

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

#include <mrpt/hwdrivers/CNTRIPClient.h>

Collaboration diagram for mrpt::hwdrivers::CNTRIPClient:
Collaboration graph
[legend]

List of all members.

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 list< TMountPointTListMountPoints
 Used in CNTRIPClient::retrieveListOfMountpoints.

Public Member Functions

 CNTRIPClient ()
 Default constructor.
virtual ~CNTRIPClient ()
 Default destructor.
bool open (const NTRIPArgs &params, 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.

Static Public Member Functions

static bool retrieveListOfMountpoints (TListMountPoints &out_list, string &out_errmsg, const string &server, int port=2101, const string &auth_user=string(), const string &auth_pass=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.

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 54 of file CNTRIPClient.h.


Member Typedef Documentation

Used in CNTRIPClient::retrieveListOfMountpoints.

Definition at line 93 of file CNTRIPClient.h.


Member Enumeration Documentation

Enumerator:
connOk 
connError 
connUnauthorized 

Definition at line 127 of file CNTRIPClient.h.


Constructor & Destructor Documentation

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

Default constructor.

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

Default destructor.


Member Function Documentation

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

Closes the connection.

See also:
open
bool mrpt::hwdrivers::CNTRIPClient::open ( const NTRIPArgs params,
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.
void mrpt::hwdrivers::CNTRIPClient::private_ntrip_thread (  )  [protected]

The working thread.

static bool mrpt::hwdrivers::CNTRIPClient::retrieveListOfMountpoints ( TListMountPoints out_list,
string &  out_errmsg,
const string &  server,
int  port = 2101,
const string &  auth_user = string(),
const string &  auth_pass = 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:

         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.

Member Data Documentation

Definition at line 133 of file CNTRIPClient.h.

All the parameters for the NTRIP connection.

Definition at line 134 of file CNTRIPClient.h.

Definition at line 121 of file CNTRIPClient.h.

Definition at line 120 of file CNTRIPClient.h.

Definition at line 119 of file CNTRIPClient.h.

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

Definition at line 124 of file CNTRIPClient.h.

Definition at line 123 of file CNTRIPClient.h.

Definition at line 125 of file CNTRIPClient.h.

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 156 of file CNTRIPClient.h.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines



Page generated by Doxygen 1.6.1 for MRPT 0.9.0 SVN: at Mon Jun 7 06:47:58 UTC 2010