71 lines
1.4 KiB
C++
71 lines
1.4 KiB
C++
//
|
|
// Linux GPS
|
|
//
|
|
|
|
/* prevent multiple inclusions */
|
|
#ifndef __GpsdClient__
|
|
#define __GpsdClient__
|
|
|
|
/* includes *****************************************************************/
|
|
|
|
#include "TcpClient.h"
|
|
#include "netlib.h"
|
|
|
|
/* defines ******************************************************************/
|
|
|
|
/* macros *******************************************************************/
|
|
|
|
/* structs & typedefs *******************************************************/
|
|
|
|
/* c class definitions ******************************************************/
|
|
|
|
//
|
|
// Connect to http://gpsd.berlios.de/ GPSD
|
|
//
|
|
class GpsdClient : public TcpClient {
|
|
// public data
|
|
public:
|
|
int Fix;
|
|
int Satellites;
|
|
|
|
struct timespec Time;
|
|
double Latitude;
|
|
double Longitude;
|
|
double Elevation;
|
|
double Heading;
|
|
double Speed;
|
|
|
|
// protected data
|
|
protected:
|
|
|
|
// private data
|
|
private:
|
|
|
|
// static data
|
|
|
|
// private methods
|
|
|
|
// public methods
|
|
public:
|
|
// constructors
|
|
GpsdClient();
|
|
GpsdClient( const char *host );
|
|
|
|
// destructor
|
|
virtual ~GpsdClient();
|
|
|
|
// virtual functions
|
|
|
|
// public methods
|
|
int GpsdParse( char *msg );
|
|
int GpsdConnect( const char *host = "localhost" );
|
|
|
|
int GpsdRead( void );
|
|
int GpsdWrite( const char *msg, int max );
|
|
|
|
int Gpsd2Vii( char *buf, int max );
|
|
};
|
|
|
|
#endif
|
|
|