Guido Ottaviani / Mbed 2 deprecated LeonardoMbos

Dependencies:   mbos Watchdog TextLCD mbed ConfigFile

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers sentence.h Source File

sentence.h

Go to the documentation of this file.
00001 /*
00002  *
00003  * NMEA library
00004  * URL: http://nmea.sourceforge.net
00005  * Author: Tim (xtimor@gmail.com)
00006  * Licence: http://www.gnu.org/licenses/lgpl.html
00007  * $Id: sentence.h 17 2008-03-11 11:56:11Z xtimor $
00008  *
00009  */
00010 
00011 /*! \file */
00012 
00013 #ifndef __NMEA_SENTENCE_H__
00014 #define __NMEA_SENTENCE_H__
00015 
00016 #include "info.h "
00017 
00018 #ifdef  __cplusplus
00019 extern "C" {
00020 #endif
00021 
00022 /**
00023  * NMEA packets type which parsed and generated by library
00024  */
00025 enum nmeaPACKTYPE
00026 {
00027     GPNON   = 0x0000,   /**< Unknown packet type. */
00028     GPGGA   = 0x0001,   /**< GGA - Essential fix data which provide 3D location and accuracy data. */
00029     GPGSA   = 0x0002,   /**< GSA - GPS receiver operating mode, SVs used for navigation, and DOP values. */
00030     GPGSV   = 0x0004,   /**< GSV - Number of SVs in view, PRN numbers, elevation, azimuth & SNR values. */
00031     GPRMC   = 0x0008,   /**< RMC - Recommended Minimum Specific GPS/TRANSIT Data. */
00032     GPVTG   = 0x0010    /**< VTG - Actual track made good and speed over ground. */
00033 };
00034 
00035 /**
00036  * GGA packet information structure (Global Positioning System Fix Data)
00037  */
00038 typedef struct _nmeaGPGGA
00039 {
00040     nmeaTIME utc;       /**< UTC of position (just time) */
00041     double  lat;        /**< Latitude in NDEG - [degree][min].[sec/60] */
00042     char    ns;         /**< [N]orth or [S]outh */
00043     double  lon;        /**< Longitude in NDEG - [degree][min].[sec/60] */
00044     char    ew;         /**< [E]ast or [W]est */
00045     int     sig;        /**< GPS quality indicator (0 = Invalid; 1 = Fix; 2 = Differential, 3 = Sensitive) */
00046     int     satinuse;   /**< Number of satellites in use (not those in view) */
00047     double  HDOP;       /**< Horizontal dilution of precision */
00048     double  elv;        /**< Antenna altitude above/below mean sea level (geoid) */
00049     char    elv_units;  /**< [M]eters (Antenna height unit) */
00050     double  diff;       /**< Geoidal separation (Diff. between WGS-84 earth ellipsoid and mean sea level. '-' = geoid is below WGS-84 ellipsoid) */
00051     char    diff_units; /**< [M]eters (Units of geoidal separation) */
00052     double  dgps_age;   /**< Time in seconds since last DGPS update */
00053     int     dgps_sid;   /**< DGPS station ID number */
00054 
00055 } nmeaGPGGA;
00056 
00057 /**
00058  * GSA packet information structure (Satellite status)
00059  */
00060 typedef struct _nmeaGPGSA
00061 {
00062     char    fix_mode;   /**< Mode (M = Manual, forced to operate in 2D or 3D; A = Automatic, 3D/2D) */
00063     int     fix_type;   /**< Type, used for navigation (1 = Fix not available; 2 = 2D; 3 = 3D) */
00064     int     sat_prn[NMEA_MAXSAT]; /**< PRNs of satellites used in position fix (null for unused fields) */
00065     double  PDOP;       /**< Dilution of precision */
00066     double  HDOP;       /**< Horizontal dilution of precision */
00067     double  VDOP;       /**< Vertical dilution of precision */
00068 
00069 } nmeaGPGSA;
00070 
00071 /**
00072  * GSV packet information structure (Satellites in view)
00073  */
00074 typedef struct _nmeaGPGSV
00075 {
00076     int     pack_count; /**< Total number of messages of this type in this cycle */
00077     int     pack_index; /**< Message number */
00078     int     sat_count;  /**< Total number of satellites in view */
00079     nmeaSATELLITE sat_data[NMEA_SATINPACK];
00080 
00081 } nmeaGPGSV;
00082 
00083 /**
00084  * RMC packet information structure (Recommended Minimum sentence C)
00085  */
00086 typedef struct _nmeaGPRMC
00087 {
00088     nmeaTIME utc;       /**< UTC of position */
00089     char    status;     /**< Status (A = active or V = void) */
00090     double  lat;        /**< Latitude in NDEG - [degree][min].[sec/60] */
00091     char    ns;         /**< [N]orth or [S]outh */
00092     double  lon;        /**< Longitude in NDEG - [degree][min].[sec/60] */
00093     char    ew;         /**< [E]ast or [W]est */
00094     double  speed;      /**< Speed over the ground in knots */
00095     double  direction;  /**< Track angle in degrees True */
00096     double  declination; /**< Magnetic variation degrees (Easterly var. subtracts from true course) */
00097     char    declin_ew;  /**< [E]ast or [W]est */
00098     char    mode;       /**< Mode indicator of fix type (A = autonomous, D = differential, E = estimated, N = not valid, S = simulator) */
00099 
00100 } nmeaGPRMC;
00101 
00102 /**
00103  * VTG packet information structure (Track made good and ground speed)
00104  */
00105 typedef struct _nmeaGPVTG
00106 {
00107     double  dir;        /**< True track made good (degrees) */
00108     char    dir_t;      /**< Fixed text 'T' indicates that track made good is relative to true north */
00109     double  dec;        /**< Magnetic track made good */
00110     char    dec_m;      /**< Fixed text 'M' */
00111     double  spn;        /**< Ground speed, knots */
00112     char    spn_n;      /**< Fixed text 'N' indicates that speed over ground is in knots */
00113     double  spk;        /**< Ground speed, kilometers per hour */
00114     char    spk_k;      /**< Fixed text 'K' indicates that speed over ground is in kilometers/hour */
00115 
00116 } nmeaGPVTG;
00117 
00118 void nmea_zero_GPGGA(nmeaGPGGA *pack);
00119 void nmea_zero_GPGSA(nmeaGPGSA *pack);
00120 void nmea_zero_GPGSV(nmeaGPGSV *pack);
00121 void nmea_zero_GPRMC(nmeaGPRMC *pack);
00122 void nmea_zero_GPVTG(nmeaGPVTG *pack);
00123 
00124 #ifdef  __cplusplus
00125 }
00126 #endif
00127 
00128 #endif /* __NMEA_SENTENCE_H__ */