1 /* 2 * Copyright Tim (xtimor@gmail.com) 3 * 4 * NMEA library is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public License 15 * along with this program. If not, see <http://www.gnu.org/licenses/> 16 */ 17 /* 18 * 19 * NMEA library 20 * URL: http://nmea.sourceforge.net 21 * Author: Tim (xtimor@gmail.com) 22 * Licence: http://www.gnu.org/licenses/lgpl.html 23 * $Id: info.h 10 2007-11-15 14:50:15Z xtimor $ 24 * 25 */ 26 27 //! \file 28 29 #ifndef NMEA_INFO_H 30 #define NMEA_INFO_H 31 32 #include "nmeatime.h" 33 34 #define NMEA_SIG_BAD (0) 35 #define NMEA_SIG_LOW (1) 36 #define NMEA_SIG_MID (2) 37 #define NMEA_SIG_HIGH (3) 38 39 #define NMEA_FIX_BAD (1) 40 #define NMEA_FIX_2D (2) 41 #define NMEA_FIX_3D (3) 42 43 #define NMEA_MAXSAT (12) 44 #define NMEA_SATINPACK (4) 45 #define NMEA_NSATPACKS (NMEA_MAXSAT / NMEA_SATINPACK) 46 47 #define NMEA_DEF_LAT (5001.2621) 48 #define NMEA_DEF_LON (3613.0595) 49 50 #ifdef __cplusplus 51 extern "C" 52 { 53 #endif 54 55 /** 56 * Position data in fractional degrees or radians 57 */ 58 typedef struct _nmeaPOS 59 { 60 double lat; //!< Latitude 61 double lon; //!< Longitude 62 63 } nmeaPOS; 64 65 /** 66 * Information about satellite 67 * \see nmeaSATINFO 68 * \see nmeaGPGSV 69 */ 70 typedef struct _nmeaSATELLITE 71 { 72 int id; //!< Satellite PRN number 73 int in_use; //!< Used in position fix 74 int elv; //!< Elevation in degrees, 90 maximum 75 int azimuth; //!< Azimuth, degrees from true north, 000 to 359 76 int sig; //!< Signal, 00-99 dB 77 78 } nmeaSATELLITE; 79 80 /** 81 * Information about all satellites in view 82 * \see nmeaINFO 83 * \see nmeaGPGSV 84 */ 85 typedef struct _nmeaSATINFO 86 { 87 int inuse; //!< Number of satellites in use (not those in view) 88 int inview; //!< Total number of satellites in view 89 nmeaSATELLITE sat[NMEA_MAXSAT]; //!< Satellites information 90 91 } nmeaSATINFO; 92 93 /** 94 * Summary GPS information from all parsed packets, 95 * used also for generating NMEA stream 96 * \see nmea_parse 97 * \see nmea_GPGGA2info, nmea_...2info 98 */ 99 typedef struct _nmeaINFO 100 { 101 int smask; //!< Mask specifying types of packages from which data have been obtained 102 103 nmeaTIME utc; //!< UTC of position 104 105 int sig; //!< GPS quality indicator (0 = Invalid; 1 = Fix; 2 = Differential, 3 = Sensitive) 106 int fix; //!< Operating mode, used for navigation (1 = Fix not available; 2 = 2D; 3 = 3D) 107 108 double PDOP; //!< Position Dilution Of Precision 109 double HDOP; //!< Horizontal Dilution Of Precision 110 double VDOP; //!< Vertical Dilution Of Precision 111 112 double lat; //!< Latitude in NDEG - +/-[degree][min].[sec/60] 113 double lon; //!< Longitude in NDEG - +/-[degree][min].[sec/60] 114 double elv; //!< Antenna altitude above/below mean sea level (geoid) in meters 115 double speed; //!< Speed over the ground in kilometers/hour 116 double direction; //!< Track angle in degrees True 117 double declination; //!< Magnetic variation degrees (Easterly var. subtracts from true course) 118 double rms_pr; //!< RMS value of the pseudorange residuals; includes carrier phase residuals during periods of RTK (float) and RTK (fixed) processing 119 double err_major; //!< Error ellipse semi-major axis 1 sigma error, in meters 120 double err_minor; //!< Error ellipse semi-minor axis 1 sigma error, in meters 121 double err_ori; //!< Error ellipse orientation, degrees from true north 122 double sig_lat; //!< Latitude 1 sigma error, in meters 123 double sig_lon; //!< Longitude 1 sigma error, in meters 124 double sig_alt; //!< Height 1 sigma error, in meters 125 126 nmeaSATINFO satinfo; //!< Satellites information 127 128 } nmeaINFO; 129 130 void nmea_zero_INFO( nmeaINFO *info ); 131 132 #ifdef __cplusplus 133 } 134 #endif 135 136 #endif /* NMEA_INFO_H */ 137