GNSS receiver tools  1
Tools for use with GNSS receivers
GNSS::Interface Class Reference

Class for an object that reads from a stream and calls methods in a Listener object. More...

#include <Parser.hh>

Public Types

typedef std::function< void(bool ack, SkyTraqBin::Output_message *msg)> ResponseHandler_Skytraq
 Type for a function called when a query/get input message gets a response. More...
 
typedef std::function< void(bool ack, UBX::Output_message *msg)> ResponseHandler_Ublox
 

Public Member Functions

 Interface (std::FILE *f, Listener::ptr l)
 Constructor. More...
 
void read (void)
 Read a small amount of data from the file, parse it, send messages to the listener object. More...
 
bool is_sendable (void) const
 
void send (SkyTraqBin::Input_message::ptr msg)
 Send a message to the Skytraq device. More...
 
void send (SkyTraqBin::Input_message::ptr msg, ResponseHandler_Skytraq rh)
 Send a message to the Skytraq device, call lambda when response is received. More...
 
void send (UBX::Input_message::ptr msg)
 Send a message to the Ublox device. More...
 
void send (UBX::Input_message::ptr msg, ResponseHandler_Ublox rh)
 Send a message to the Ublox device, call lambda when response is received. More...
 

Detailed Description

Class for an object that reads from a stream and calls methods in a Listener object.

Definition at line 136 of file Parser.hh.

Member Typedef Documentation

typedef std::function<void(bool ack, SkyTraqBin::Output_message* msg)> GNSS::Interface::ResponseHandler_Skytraq

Type for a function called when a query/get input message gets a response.

Parameters
ackDid the input message receive an ack (true), or a nack (false)?
msgThe output message that was received

There are three ways this lambda will be called:

  1. (false, nullptr) - Nack was received
  2. (true, nullptr) - Ack was received
  3. (true, msg) - Response message received

The third variant only happens with response-type messages.

Definition at line 150 of file Parser.hh.

typedef std::function<void(bool ack, UBX::Output_message* msg)> GNSS::Interface::ResponseHandler_Ublox

Definition at line 152 of file Parser.hh.

Constructor & Destructor Documentation

GNSS::Interface::Interface ( std::FILE *  f,
Listener::ptr  l 
)

Constructor.

Parameters
fOpen file handle
lListener object that will receive messages

Definition at line 96 of file Parser.cc.

Member Function Documentation

bool GNSS::Interface::is_sendable ( void  ) const
inline

Only currently sendable if the file is a character device.

Definition at line 181 of file Parser.hh.

void GNSS::Interface::read ( void  )

Read a small amount of data from the file, parse it, send messages to the listener object.

Definition at line 118 of file Parser.cc.

void GNSS::Interface::send ( SkyTraqBin::Input_message::ptr  msg)

Send a message to the Skytraq device.

Definition at line 250 of file Parser.cc.

void GNSS::Interface::send ( SkyTraqBin::Input_message::ptr  msg,
ResponseHandler_Skytraq  rh 
)

Send a message to the Skytraq device, call lambda when response is received.

Definition at line 268 of file Parser.cc.

void GNSS::Interface::send ( UBX::Input_message::ptr  msg)

Send a message to the Ublox device.

void GNSS::Interface::send ( UBX::Input_message::ptr  msg,
ResponseHandler_Ublox  rh 
)

Send a message to the Ublox device, call lambda when response is received.

Definition at line 297 of file Parser.cc.


The documentation for this class was generated from the following files: