info.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*
  2. *
  3. * NMEA library
  4. * URL: http://nmea.sourceforge.net
  5. * Author: Tim (xtimor@gmail.com)
  6. * Licence: http://www.gnu.org/licenses/lgpl.html
  7. * $Id: info.h 10 2007-11-15 14:50:15Z xtimor $
  8. *
  9. */
  10. /*! \file */
  11. #ifndef __NMEA_INFO_H__
  12. #define __NMEA_INFO_H__
  13. #include "time.h"
  14. #define NMEA_SIG_BAD (0)
  15. #define NMEA_SIG_LOW (1)
  16. #define NMEA_SIG_MID (2)
  17. #define NMEA_SIG_HIGH (3)
  18. #define NMEA_FIX_BAD (1)
  19. #define NMEA_FIX_2D (2)
  20. #define NMEA_FIX_3D (3)
  21. #define NMEA_MAXSAT (12)
  22. #define NMEA_SATINPACK (4)
  23. #define NMEA_NSATPACKS (NMEA_MAXSAT / NMEA_SATINPACK)
  24. #define NMEA_DEF_LAT (5001.2621)
  25. #define NMEA_DEF_LON (3613.0595)
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. extern int bd_count;
  30. extern int gps_count;
  31. /**
  32. * Position data in fractional degrees or radians
  33. */
  34. typedef struct _nmeaPOS
  35. {
  36. double lat; /**< Latitude */
  37. double lon; /**< Longitude */
  38. } nmeaPOS;
  39. /**
  40. * Information about satellite
  41. * @see nmeaSATINFO
  42. * @see nmeaGPGSV
  43. */
  44. typedef struct _nmeaSATELLITE
  45. {
  46. int id; /**< Satellite PRN number */
  47. int in_use; /**< Used in position fix */
  48. int elv; /**< Elevation in degrees, 90 maximum */
  49. int azimuth; /**< Azimuth, degrees from true north, 000 to 359 */
  50. int sig; /**< Signal, 00-99 dB */
  51. } nmeaSATELLITE;
  52. /**
  53. * Information about all satellites in view
  54. * @see nmeaINFO
  55. * @see nmeaGPGSV
  56. */
  57. typedef struct _nmeaSATINFO
  58. {
  59. int inuse; /**< Number of satellites in use (not those in view) */
  60. int inview; /**< Total number of satellites in view */
  61. int inview_gps;
  62. int inview_bd;
  63. char state; /*G:GPS,B:BD*/
  64. nmeaSATELLITE sat[NMEA_MAXSAT]; /**< Satellites information */
  65. } nmeaSATINFO;
  66. /**
  67. * Summary GPS information from all parsed packets,
  68. * used also for generating NMEA stream
  69. * @see nmea_parse
  70. * @see nmea_GPGGA2info, nmea_...2info
  71. */
  72. typedef struct _nmeaINFO
  73. {
  74. int smask; /**< Mask specifying types of packages from which data have been obtained */
  75. nmeaTIME utc; /**< UTC of position */
  76. int sig; /**< GPS quality indicator (0 = Invalid; 1 = Fix; 2 = Differential, 3 = Sensitive) */
  77. int fix; /**< Operating mode, used for navigation (1 = Fix not available; 2 = 2D; 3 = 3D) */
  78. double PDOP; /**< Position Dilution Of Precision */
  79. double HDOP; /**< Horizontal Dilution Of Precision */
  80. double VDOP; /**< Vertical Dilution Of Precision */
  81. double lat; /**< Latitude in NDEG - +/-[degree][min].[sec/60] */
  82. double lon; /**< Longitude in NDEG - +/-[degree][min].[sec/60] */
  83. double elv; /**< Antenna altitude above/below mean sea level (geoid) in meters */
  84. double speed; /**< Speed over the ground in kilometers/hour */
  85. double direction; /**< Track angle in degrees True */
  86. double declination; /**< Magnetic variation degrees (Easterly var. subtracts from true course) */
  87. nmeaSATINFO satinfo; /**< Satellites information */
  88. } nmeaINFO;
  89. void nmea_zero_INFO(nmeaINFO *info);
  90. #ifdef __cplusplus
  91. }
  92. #endif
  93. #endif /* __NMEA_INFO_H__ */