cphidgetgps.h
Go to the documentation of this file.
00001 #ifndef __CPHIDGETGPS
00002 #define __CPHIDGETGPS
00003 #include "cphidget.h"
00004 
00014 struct __GPSTime
00015 {
00016         short tm_ms;    
00017         short tm_sec;   
00018         short tm_min;   
00019         short tm_hour;  
00020 } typedef GPSTime;
00024 struct __GPSDate
00025 {
00026         short tm_mday;  
00027         short tm_mon;   
00028         short tm_year;  
00029 } typedef GPSDate;
00030 
00034 struct __GPSSatInfo
00035 {
00036         short ID;
00037         short elevation;
00038         int azimuth;
00039         short SNR;
00040 } typedef GPSSatInfo;
00041 
00045 struct __GPGGA
00046 {
00047         GPSTime time;
00048         double latitude;
00049         double longitude;
00050         short fixQuality;
00051         short numSatellites;
00052         double horizontalDilution;
00053         double altitude;
00054         double heightOfGeoid;
00055 } typedef GPGGA;
00056 
00060 struct __GPGSA
00061 {
00062         char mode;
00063         /* A = auto
00064          * M = forced */
00065         short fixType;
00066         /* 1 = no fix
00067          * 2 = 2D
00068          * 3 = 3D */
00069         short satUsed[12];
00070         /* IDs of used sats in no real order, 0 means nothing */
00071         double posnDilution;
00072         double horizDilution;
00073         double vertDilution;
00074 } typedef GPGSA;
00075 
00079 struct __GPGSV
00080 {
00081         short satsInView;
00082         GPSSatInfo satInfo[12];
00083 } typedef GPGSV;
00084 
00088 struct __GPRMC
00089 {
00090         GPSTime time;
00091         char status;
00092         double latitude;
00093         double longitude;
00094         double speedKnots;
00095         double heading;
00096         GPSDate date;
00097         double magneticVariation;
00098         char mode;
00099 } typedef GPRMC;
00100 
00104 struct __GPVTG
00105 {
00106         double trueHeading;
00107         double magneticHeading;
00108         double speedKnots;
00109         double speed; //km/hour
00110         char mode;
00111 } typedef GPVTG;
00112 
00116 struct __NMEAData
00117 {
00118         GPGGA GGA;      
00119         GPGSA GSA;      
00120         GPGSV GSV;      
00121         GPRMC RMC;      
00122         GPVTG VTG;      
00123 } typedef NMEAData;
00124 
00125 DPHANDLE(GPS)
00126 CHDRSTANDARD(GPS)
00127 
00133 CHDRGET(GPS,Latitude,double *latitude)
00139 CHDRGET(GPS,Longitude,double *longitude)
00145 CHDRGET(GPS,Altitude,double *altitude)
00151 CHDRGET(GPS,Heading,double *heading)
00157 CHDRGET(GPS,Velocity,double *velocity)
00163 CHDRGET(GPS,Time,GPSTime *time)
00169 CHDRGET(GPS,Date,GPSDate *date)
00175 CHDRGET(GPS,PositionFixStatus,int *fixStatus)
00187 CHDRGET(GPS,NMEAData,NMEAData *data)
00188 
00195 CHDREVENT(GPS,PositionChange,double latitude,double longitude,double altitude)
00202 CHDREVENT(GPS,PositionFixStatusChange,int status)
00203 
00204 #ifndef EXTERNALPROTO
00205 
00206 struct _CPhidgetGPS {
00207         CPhidget phid;
00208 
00209         int (CCONV *fptrPositionChange)(CPhidgetGPSHandle, void *, double latitude, double longitude, double altitude);           
00210         void *fptrPositionChangeptr;
00211         int (CCONV *fptrPositionFixStatusChange)(CPhidgetGPSHandle, void *, int status);           
00212         void *fptrPositionFixStatusChangeptr;
00213 
00214         NMEAData GPSData;
00215 
00216         double heading, velocity, altitude, latitude, longitude;
00217         unsigned char fix;
00218 
00219         unsigned char haveTime, haveDate;
00220 
00221         double lastLongitude, lastLatitude, lastAltitude;
00222         unsigned char lastFix;
00223 
00224         unsigned char sckbuf[256];
00225         unsigned char sckbuf_write, sckbuf_read;
00226 } typedef CPhidgetGPSInfo;
00227 #endif
00228 
00231 #endif


pedal_monitor
Author(s): Pedro Mendes
autogenerated on Fri Jun 6 2014 18:37:20