OpenTracker

An Open Architecture for Reconfigurable Tracking based on XML | Contact

ot::GPSDriver Class Reference
[Device Input Classes]

The GPSDriver class encapsulates the whole GPS and ACE framework code for reading data from the GPS receiver and also supplying it with correction data from a DGPSIP host. More...

#include <GPSDriver.h>

Collaboration diagram for ot::GPSDriver:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 GPSDriver (ACE_Reactor *reactor_=NULL)
virtual ~GPSDriver ()
int open (const std::string &device, int baud, const std::string &serveraddr="", int serverport=2101, int dgpsmirror=-1, const std::string &rtcmdevice="")
void close ()
void setDebug (bool debug)
bool getDebug ()
ACE_Reactor * getReactor ()
void addListener (GPSListener *listener, void *userData=NULL)
void removeListener (GPSListener *listener, void *userData=NULL)
void addClient (DGPSMirror_Handler *client)
void removeClient (DGPSMirror_Handler *client)
bool hasFix (void)
double getHdop (void)
double getNumSat (void)

Protected Member Functions

void send_rtcm (const char *buffer, const int len)
void new_line (const char *line)

Protected Attributes

ACE_Reactor * reactor
GPS_Handlerreceiver
DGPSIP_Handlerserver
DGPSMirror_Acceptoracceptor
ACE_TTY_IO * rtcmdev
bool debugOn
bool fix
double hdop
int numsat
std::map< GPSListener *, void * > listeners
std::vector< DGPSMirror_Handler * > clients

Friends

class GPS_Handler
class DGPSIP_Handler

Detailed Description

The GPSDriver class encapsulates the whole GPS and ACE framework code for reading data from the GPS receiver and also supplying it with correction data from a DGPSIP host.

It contains GPS parsing functionality via the GPSParser class. The data provided to listeners is the original GPS data without any transformations such as feet to meters etc. All such operations are left to the client code.

See also:
GPSParser on how to extend the parsing functions.
Author:
Gerhard Reitmayr

Definition at line 101 of file GPSDriver.h.


Constructor & Destructor Documentation

ot::GPSDriver::GPSDriver ( ACE_Reactor *  reactor_ = NULL  ) 

Definition at line 76 of file GPSDriver.cxx.

References reactor.

ot::GPSDriver::~GPSDriver (  )  [virtual]

Definition at line 88 of file GPSDriver.cxx.

References clients, close(), listeners, and receiver.


Member Function Documentation

void ot::GPSDriver::addClient ( DGPSMirror_Handler client  ) 

Definition at line 234 of file GPSDriver.cxx.

References clients.

Referenced by ot::DGPSMirror_Handler::open().

void ot::GPSDriver::addListener ( GPSListener listener,
void *  userData = NULL 
)

Definition at line 222 of file GPSDriver.cxx.

References listeners.

Referenced by ot::DGPSIP_Handler::open(), and ot::GPSModule::run().

void ot::GPSDriver::close (  ) 

Definition at line 198 of file GPSDriver.cxx.

References acceptor, receiver, rtcmdev, and server.

Referenced by ot::GPSModule::run(), and ~GPSDriver().

bool ot::GPSDriver::getDebug (  )  [inline]

Definition at line 111 of file GPSDriver.h.

References debugOn.

Referenced by ot::DGPSMirror_Handler::handle_input(), and open().

double ot::GPSDriver::getHdop ( void   )  [inline]

double ot::GPSDriver::getNumSat ( void   )  [inline]

Definition at line 137 of file GPSDriver.h.

References numsat.

ACE_Reactor* ot::GPSDriver::getReactor (  )  [inline]

Definition at line 116 of file GPSDriver.h.

References reactor.

Referenced by ot::GPSModule::close(), and ot::GPSModule::run().

bool ot::GPSDriver::hasFix ( void   )  [inline]

void ot::GPSDriver::new_line ( const char *  line  )  [protected]

Definition at line 247 of file GPSDriver.cxx.

References fix, ot::GPResult::GPGGA, hdop, listeners, numsat, and ot::GPSParser::parse().

Referenced by ot::GPS_Handler::handle_signal().

int ot::GPSDriver::open ( const std::string &  device,
int  baud,
const std::string &  serveraddr = "",
int  serverport = 2101,
int  dgpsmirror = -1,
const std::string &  rtcmdevice = "" 
)

void ot::GPSDriver::removeClient ( DGPSMirror_Handler client  ) 

Definition at line 240 of file GPSDriver.cxx.

References clients.

Referenced by ot::DGPSMirror_Handler::~DGPSMirror_Handler().

void ot::GPSDriver::removeListener ( GPSListener listener,
void *  userData = NULL 
)

Definition at line 227 of file GPSDriver.cxx.

References listeners.

Referenced by ot::DGPSIP_Handler::~DGPSIP_Handler().

void ot::GPSDriver::send_rtcm ( const char *  buffer,
const int  len 
) [protected]

Definition at line 262 of file GPSDriver.cxx.

References clients, receiver, and rtcmdev.

Referenced by ot::DGPSIP_Handler::handle_input().

void ot::GPSDriver::setDebug ( bool  debug  ) 

Definition at line 286 of file GPSDriver.cxx.

References debugOn.

Referenced by ot::GPSModule::run().


Friends And Related Function Documentation

friend class DGPSIP_Handler [friend]

Definition at line 163 of file GPSDriver.h.

Referenced by open().

friend class GPS_Handler [friend]

Definition at line 162 of file GPSDriver.h.

Referenced by open().


Member Data Documentation

Definition at line 150 of file GPSDriver.h.

Referenced by close(), and open().

std::vector<DGPSMirror_Handler *> ot::GPSDriver::clients [protected]

Definition at line 160 of file GPSDriver.h.

Referenced by addClient(), removeClient(), send_rtcm(), and ~GPSDriver().

bool ot::GPSDriver::debugOn [protected]

Definition at line 153 of file GPSDriver.h.

Referenced by getDebug(), and setDebug().

bool ot::GPSDriver::fix [protected]

Definition at line 154 of file GPSDriver.h.

Referenced by hasFix(), and new_line().

double ot::GPSDriver::hdop [protected]

Definition at line 155 of file GPSDriver.h.

Referenced by getHdop(), and new_line().

std::map<GPSListener *, void *> ot::GPSDriver::listeners [protected]

Definition at line 158 of file GPSDriver.h.

Referenced by addListener(), new_line(), removeListener(), and ~GPSDriver().

int ot::GPSDriver::numsat [protected]

Definition at line 156 of file GPSDriver.h.

Referenced by getNumSat(), and new_line().

ACE_Reactor* ot::GPSDriver::reactor [protected]

Definition at line 147 of file GPSDriver.h.

Referenced by getReactor(), GPSDriver(), and open().

Definition at line 148 of file GPSDriver.h.

Referenced by close(), open(), send_rtcm(), and ~GPSDriver().

ACE_TTY_IO* ot::GPSDriver::rtcmdev [protected]

Definition at line 151 of file GPSDriver.h.

Referenced by close(), and send_rtcm().

Definition at line 149 of file GPSDriver.h.

Referenced by close(), and open().


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

copyright (c) 2006 Graz University of Technology