28 CNTRIPEmitter::CNTRIPEmitter() :
32 m_transmit_to_server(true),
85 const size_t nReadActual =
m_out_COM.
Read(rxbuf,
sizeof(rxbuf)-1);
88 rxbuf[nReadActual] = 0;
138 #ifdef MRPT_OS_WINDOWS
#define IMPLEMENTS_GENERIC_SENSOR(class_name, NameSpace)
This must be inserted in all CGenericSensor classes implementation files:
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...
mrpt::synch::MT_buffer stream_data
The buffer with all the bytes so-far read from the NTRIP server stream.
void close()
Closes the connection.
This "virtual driver" encapsulates a NTRIP client (see CNTRIPClient) but adds the functionality of du...
CNTRIPClient m_client
The NTRIP comms object.
std::ofstream m_raw_output_file_stream
std::string m_com_port
If set to non-empty, the serial port will be attempted to be opened automatically when this class is ...
void doProcess()
The main loop, which must be called in a timely fashion in order to process the incomming NTRIP data ...
mrpt::utils::CTicTac m_rate_timer
void initialize()
Set up the NTRIP communications, raising an exception on fatal errors.
void loadConfig_sensorSpecific(const mrpt::utils::CConfigFileBase &configSource, const std::string &iniSection)
See the class documentation at the top for expected parameters.
CNTRIPClient::NTRIPArgs m_ntrip_args
virtual ~CNTRIPEmitter()
Destructor
bool m_transmit_to_server
std::string m_raw_output_file_prefix
CSerialPort m_out_COM
The output serial port.
bool isOpen() const
Returns if port has been correctly open.
void open()
Open the port.
void setConfig(int baudRate, int parity=0, int bits=8, int nStopBits=1, bool enableFlowControl=false)
Changes the configuration of the port.
size_t Read(void *Buffer, size_t Count)
Implements the virtual method responsible for reading from the stream - Unlike CStream::ReadBuffer,...
void purgeBuffers()
Purge tx and rx buffers.
void close()
Close the port.
void setTimeouts(int ReadIntervalTimeout, int ReadTotalTimeoutMultiplier, int ReadTotalTimeoutConstant, int WriteTotalTimeoutMultiplier, int WriteTotalTimeoutConstant)
Changes the timeouts of the port, in milliseconds.
void readAndClear(vector_byte &d)
This class allows loading and storing values and vectors of different types from a configuration text...
void WriteBuffer(const void *Buffer, size_t Count)
Writes a block of bytes to the stream from Buffer.
double Tac()
Stops the stopwatch.
void Tic()
Starts the stopwatch.
GLsizei const GLchar ** string
std::string BASE_IMPEXP fileNameStripInvalidChars(const std::string &filename, const char replacement_to_invalid_chars='_')
Replace invalid filename chars by underscores ('_') or any other user-given char.
std::vector< uint8_t > vector_byte
void BASE_IMPEXP sleep(int time_ms) MRPT_NO_THROWS
An OS-independent method for sending the current thread to "sleep" for a given period of time.
std::string BASE_IMPEXP trim(const std::string &str)
Removes leading and trailing spaces.
std::string BASE_IMPEXP dateTimeLocalToString(const mrpt::system::TTimeStamp t)
Convert a timestamp into this textual form (in local time): YEAR/MONTH/DAY,HH:MM:SS....
mrpt::system::TTimeStamp now()
A shortcut for system::getCurrentTime.
std::string BASE_IMPEXP timeLocalToString(const mrpt::system::TTimeStamp t, unsigned int secondFractionDigits=6)
Convert a timestamp into this textual form (in local time): HH:MM:SS.MMMMMM.
#define ASSERTMSG_(f, __ERROR_MSG)
#define THROW_EXCEPTION_FMT(_FORMAT_STRING,...)
Contains classes for various device interfaces.
This namespace contains representation of robot actions and observations.
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values,...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.