GPSInterface_GPSD Class Reference

Implements gpsd interface. More...

#include <GPSInterface_GPSD.h>

Inheritance diagram for GPSInterface_GPSD:

Inheritance graph
[legend]
Collaboration diagram for GPSInterface_GPSD:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 GPSInterface_GPSD ()
 Constructor - zero out everything.
virtual ~GPSInterface_GPSD ()
 Destructor - nothing to do.
virtual wxString Name ()
 Returns name of this GPS module.
virtual EGPSStatus GetData (wxGPSEvent *pGPSEvent)
 Tries to get updated data from gpsd server.
virtual wxString GetLastError ()
 Returns an explanation of the last error.
virtual EGPSStatus AutoDetect (wxThread *pThread)
 Attempts to autodetect if a gpsd server is present.

Private Member Functions

wxString GPSDConnect (wxSocketClient *psockGPSD, wxString strHost, int iPort)
 Attempt to connect to a gpsd server.
wxString GPSDDisconnect (wxSocketBase *psockGPSD)
 Disconnect from gpsd server.
wxString GPSDGetProtocolVersion (wxSocketBase *psockGPSD, int *piProtocolVersion, int *piMajorGPSDVersion, int *piMinorGPSDVersion, wxString *pstrCommands)
 Retrieves information about the gpsd server.
wxString GPSDGetPosition (wxSocketBase *psockGPSD, int iProtocolVersion, Point *pptGPS)
 Retrieves the gps position from the gpsd server.
wxString GPSDGetHeading (wxSocketBase *psockGPSD, int iProtocolVersion, double *pfHeading)
 Retrieves the gps heading from the gpsd server.
wxString GPSDGetSpeed (wxSocketBase *psockGPSD, int iProtocolVersion, double *pfSpeed)
 Retrieves the gps speed from the gpsd server.
wxString GPSDGetLastTimestamp (wxSocketBase *psockGPSD, int iProtocolVersion, double *pfLastTimestamp)
 Retrieves the timestamp of the last lock.
wxString GPSDGetLockType (wxSocketBase *psockGPSD, int iProtocolVersion, int *piLockType)
 Retrieves the gps lock type from the gpsd server.
wxString GPSDGetSatelliteInfo (wxSocketBase *psockGPSD, int iProtocolVersion, std::vector< SSatelliteInfo > *pvSatInfo, int *pnSatellitesUsed)
wxString GPSDSetBufferingPolicy (wxSocketBase *psockGPSD, int iProtocolVersion, int iBufferingPolicy)
 Sets the gpsd buffering policy.

Private Attributes

wxSocketClient * m_sockGPSD
 Socket to gpsd server.
int m_iGPSDProtocolVersion
 gpsd server protocol version
double m_fGPSDLastTimestamp
 Timestamp of last GPS coordinates, as reported by gpsd.
wxDateTime m_tLastGPSSentence
 Local time of last valid GPS sentence.
double m_fMinimumSpeedForHeading
 Minimum speed the vehicle must be moving to accept the heading reported by gpsd.
wxString m_strLastError
 Last error messages.
double m_fLastHeading
 Last valid heading.
double m_fLastSpeed
 Last valid speed.
SSatelliteInfo m_arLastSatellitesVisible [MAX_GPS_SATELLITES]
 Last valid satellite info.
int m_nLastSatellitesVisible
long m_nLastSatUsedForLock
 Last number of satellites used for lock.
int m_iLastLockType
 Last valid lock type.


Detailed Description

Implements gpsd interface.

Definition at line 43 of file GPSInterface_GPSD.h.


Constructor & Destructor Documentation

GPSInterface_GPSD::GPSInterface_GPSD (  ) 

Constructor - zero out everything.

Definition at line 55 of file GPSInterface_GPSD.cpp.

GPSInterface_GPSD::~GPSInterface_GPSD (  )  [virtual]

Destructor - nothing to do.

Definition at line 74 of file GPSInterface_GPSD.cpp.


Member Function Documentation

wxString GPSInterface_GPSD::Name (  )  [virtual]

Returns name of this GPS module.

Implements IGPSInterface.

Definition at line 84 of file GPSInterface_GPSD.cpp.

IGPSInterface::EGPSStatus GPSInterface_GPSD::GetData ( wxGPSEvent pGPSEvent  )  [virtual]

Tries to get updated data from gpsd server.

Parameters:
pGPSEvent Receives updated gps data.
Returns:
Status - either GPSStatusErrorDisableGPS for serious error, or GPSStatusOK if data was obtained.

Implements IGPSInterface.

Definition at line 100 of file GPSInterface_GPSD.cpp.

wxString GPSInterface_GPSD::GetLastError (  )  [virtual]

Returns an explanation of the last error.

Implements IGPSInterface.

Definition at line 412 of file GPSInterface_GPSD.cpp.

IGPSInterface::EGPSStatus GPSInterface_GPSD::AutoDetect ( wxThread *  pThread  )  [virtual]

Attempts to autodetect if a gpsd server is present.

Parameters:
pThread Pointer to wxThread obtain this code is running in.
Returns:
Status - either GPSStatusOK if a gpsd server was found and a lock was detected, or GPSStatusAutoDetectionGPSDetectedButNoLock if a gpsd server was found, but no lock, or GPSStatusAutoDetectionNoGPSDetected for no gpsd server.

Implements IGPSInterface.

Definition at line 388 of file GPSInterface_GPSD.cpp.

wxString GPSInterface_GPSD::GPSDConnect ( wxSocketClient *  psockGPSD,
wxString  strHost,
int  iPort 
) [private]

Attempt to connect to a gpsd server.

Parameters:
psockGPSD Pointer to socket used to connect to gpsd server.
strHost Hostname of gpsd server.
iPort Port number of gpsd server.
Returns:
Empty string on success, or error message on error.

Definition at line 427 of file GPSInterface_GPSD.cpp.

wxString GPSInterface_GPSD::GPSDDisconnect ( wxSocketBase *  psockGPSD  )  [private]

Disconnect from gpsd server.

Parameters:
psockGPSD Pointer to socket connected to gpsd server.
Returns:
Always returns empty string, indicating sucess.

Definition at line 457 of file GPSInterface_GPSD.cpp.

wxString GPSInterface_GPSD::GPSDGetProtocolVersion ( wxSocketBase *  psockGPSD,
int *  piProtocolVersion,
int *  piMajorGPSDVersion,
int *  piMinorGPSDVersion,
wxString *  pstrCommands 
) [private]

Retrieves information about the gpsd server.

Parameters:
psockGPSD Socket connected to gpsd server.
piProtocolVersion Returns gpsd protocol version.
piMajorGPSDVersion Returns major gpsd version.
piMinorGPSDVersion Returns minor gpsd version.
pstrCommands Returns a string containing the commands the gpsd server supports.
Returns:
Empty string on success, or error message on error.

Definition at line 481 of file GPSInterface_GPSD.cpp.

wxString GPSInterface_GPSD::GPSDGetPosition ( wxSocketBase *  psockGPSD,
int  iProtocolVersion,
Point *  pptGPS 
) [private]

Retrieves the gps position from the gpsd server.

Parameters:
psockGPSD Socket connected to gpsd server.
iProtocolVersion Protocol version used by gpsd server.
pptGPS Returns gps coordinates
Returns:
Empty string on success, or error message on error.

Definition at line 578 of file GPSInterface_GPSD.cpp.

wxString GPSInterface_GPSD::GPSDGetHeading ( wxSocketBase *  psockGPSD,
int  iProtocolVersion,
double *  pfHeading 
) [private]

Retrieves the gps heading from the gpsd server.

Parameters:
psockGPSD Socket connected to gpsd server.
iProtocolVersion Protocol version used by gpsd server.
pfHeading Returns the heading from the gpsd server.
Returns:
Empty string on success, or error message on error.

Definition at line 680 of file GPSInterface_GPSD.cpp.

wxString GPSInterface_GPSD::GPSDGetSpeed ( wxSocketBase *  psockGPSD,
int  iProtocolVersion,
double *  pfSpeed 
) [private]

Retrieves the gps speed from the gpsd server.

Parameters:
psockGPSD Socket connected to gpsd server.
iProtocolVersion Protocol version used by gpsd server.
pfSpeed Returns the gps speed from the gpsd server.
Returns:
Empty string on success, or error message on error.

Definition at line 766 of file GPSInterface_GPSD.cpp.

wxString GPSInterface_GPSD::GPSDGetLastTimestamp ( wxSocketBase *  psockGPSD,
int  iProtocolVersion,
double *  pfTimestamp 
) [private]

Retrieves the timestamp of the last lock.

Parameters:
psockGPSD Socket connected to gpsd server.
iProtocolVersion Protocol version used by gpsd server.
pfTimestamp Returns the timestamp of the last lock.
Returns:
Empty string on success, or error message on error.

Definition at line 1076 of file GPSInterface_GPSD.cpp.

wxString GPSInterface_GPSD::GPSDGetLockType ( wxSocketBase *  psockGPSD,
int  iProtocolVersion,
int *  piLockType 
) [private]

Retrieves the gps lock type from the gpsd server.

Parameters:
psockGPSD Socket connected to gpsd server.
iProtocolVersion Protocol version used by gpsd server.
piLockType Returns the lock type from the gpsd server.
Returns:
Empty string on success, or error message on error.

Definition at line 855 of file GPSInterface_GPSD.cpp.

wxString GPSInterface_GPSD::GPSDGetSatelliteInfo ( wxSocketBase *  psockGPSD,
int  iProtocolVersion,
std::vector< SSatelliteInfo > *  pvSatInfo,
int *  pnSatellitesUsed 
) [private]

wxString GPSInterface_GPSD::GPSDSetBufferingPolicy ( wxSocketBase *  psockGPSD,
int  iProtocolVersion,
int  iBufferingPolicy 
) [private]

Sets the gpsd buffering policy.

Parameters:
psockGPSD Socket connected to gpsd server.
iProtocolVersion Protocol version used by gpsd server.
iBufferingPolicy Buffering policy to set
Returns:
Empty string on success, or error message on error.

Definition at line 1162 of file GPSInterface_GPSD.cpp.


Member Data Documentation

wxSocketClient* GPSInterface_GPSD::m_sockGPSD [private]

Socket to gpsd server.

Definition at line 66 of file GPSInterface_GPSD.h.

gpsd server protocol version

Definition at line 69 of file GPSInterface_GPSD.h.

Timestamp of last GPS coordinates, as reported by gpsd.

Definition at line 72 of file GPSInterface_GPSD.h.

Local time of last valid GPS sentence.

Definition at line 75 of file GPSInterface_GPSD.h.

Minimum speed the vehicle must be moving to accept the heading reported by gpsd.

Definition at line 78 of file GPSInterface_GPSD.h.

Last error messages.

Definition at line 81 of file GPSInterface_GPSD.h.

Last valid heading.

Definition at line 85 of file GPSInterface_GPSD.h.

Last valid speed.

Definition at line 88 of file GPSInterface_GPSD.h.

Last valid satellite info.

Definition at line 91 of file GPSInterface_GPSD.h.

Definition at line 92 of file GPSInterface_GPSD.h.

Last number of satellites used for lock.

Definition at line 95 of file GPSInterface_GPSD.h.

Last valid lock type.

Definition at line 98 of file GPSInterface_GPSD.h.


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

Generated on Sun Jul 27 17:26:11 2008 for Roadnav by  doxygen 1.5.5