Demo
Dependents: A_TeseoLocationNEW A_TeseoLocation
Middlewares/NMEAParser.h@5:d91199cfc6a4, 2020-01-31 (annotated)
- Committer:
- HarryKeane
- Date:
- Fri Jan 31 13:24:41 2020 +0000
- Revision:
- 5:d91199cfc6a4
- Parent:
- 0:a77f1f1f8318
Not sure what to write here ;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
apalmieri | 0:a77f1f1f8318 | 1 | /** |
apalmieri | 0:a77f1f1f8318 | 2 | ******************************************************************************* |
apalmieri | 0:a77f1f1f8318 | 3 | * @file NMEAParser.h |
apalmieri | 0:a77f1f1f8318 | 4 | * @author AST / Central Lab |
apalmieri | 0:a77f1f1f8318 | 5 | * @version V1.0.0 |
apalmieri | 0:a77f1f1f8318 | 6 | * @date 18-May-2017 |
apalmieri | 0:a77f1f1f8318 | 7 | * @brief NMEA sentence parser |
apalmieri | 0:a77f1f1f8318 | 8 | * |
apalmieri | 0:a77f1f1f8318 | 9 | ******************************************************************************* |
apalmieri | 0:a77f1f1f8318 | 10 | * @attention |
apalmieri | 0:a77f1f1f8318 | 11 | * |
apalmieri | 0:a77f1f1f8318 | 12 | * <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2> |
apalmieri | 0:a77f1f1f8318 | 13 | * |
apalmieri | 0:a77f1f1f8318 | 14 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); |
apalmieri | 0:a77f1f1f8318 | 15 | * You may not use this file except in compliance with the License. |
apalmieri | 0:a77f1f1f8318 | 16 | * You may obtain a copy of the License at: |
apalmieri | 0:a77f1f1f8318 | 17 | * |
apalmieri | 0:a77f1f1f8318 | 18 | * http://www.st.com/software_license_agreement_liberty_v2 |
apalmieri | 0:a77f1f1f8318 | 19 | * |
apalmieri | 0:a77f1f1f8318 | 20 | * Redistribution and use in source and binary forms, with or without modification, |
apalmieri | 0:a77f1f1f8318 | 21 | * are permitted provided that the following conditions are met: |
apalmieri | 0:a77f1f1f8318 | 22 | * 1. Redistributions of source code must retain the above copyright notice, |
apalmieri | 0:a77f1f1f8318 | 23 | * this list of conditions and the following disclaimer. |
apalmieri | 0:a77f1f1f8318 | 24 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
apalmieri | 0:a77f1f1f8318 | 25 | * this list of conditions and the following disclaimer in the documentation |
apalmieri | 0:a77f1f1f8318 | 26 | * and/or other materials provided with the distribution. |
apalmieri | 0:a77f1f1f8318 | 27 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
apalmieri | 0:a77f1f1f8318 | 28 | * may be used to endorse or promote products derived from this software |
apalmieri | 0:a77f1f1f8318 | 29 | * without specific prior written permission. |
apalmieri | 0:a77f1f1f8318 | 30 | * |
apalmieri | 0:a77f1f1f8318 | 31 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
apalmieri | 0:a77f1f1f8318 | 32 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
apalmieri | 0:a77f1f1f8318 | 33 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
apalmieri | 0:a77f1f1f8318 | 34 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
apalmieri | 0:a77f1f1f8318 | 35 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
apalmieri | 0:a77f1f1f8318 | 36 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
apalmieri | 0:a77f1f1f8318 | 37 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
apalmieri | 0:a77f1f1f8318 | 38 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
apalmieri | 0:a77f1f1f8318 | 39 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
apalmieri | 0:a77f1f1f8318 | 40 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
apalmieri | 0:a77f1f1f8318 | 41 | * |
apalmieri | 0:a77f1f1f8318 | 42 | ******************************************************************************** |
apalmieri | 0:a77f1f1f8318 | 43 | */ |
apalmieri | 0:a77f1f1f8318 | 44 | |
apalmieri | 0:a77f1f1f8318 | 45 | /* Define to prevent recursive inclusion -------------------------------------*/ |
apalmieri | 0:a77f1f1f8318 | 46 | #ifndef __NMEA_PARSER_H |
apalmieri | 0:a77f1f1f8318 | 47 | #define __NMEA_PARSER_H |
apalmieri | 0:a77f1f1f8318 | 48 | |
apalmieri | 0:a77f1f1f8318 | 49 | #ifdef __cplusplus |
apalmieri | 0:a77f1f1f8318 | 50 | extern "C" { |
apalmieri | 0:a77f1f1f8318 | 51 | #endif |
apalmieri | 0:a77f1f1f8318 | 52 | |
apalmieri | 0:a77f1f1f8318 | 53 | #include <stdio.h> |
apalmieri | 0:a77f1f1f8318 | 54 | #include <stdint.h> |
apalmieri | 0:a77f1f1f8318 | 55 | |
apalmieri | 0:a77f1f1f8318 | 56 | /** @defgroup Middlewares |
apalmieri | 0:a77f1f1f8318 | 57 | * @brief Contains all platform independent modules (eg. NMEA Sentence Parser, ...). |
apalmieri | 0:a77f1f1f8318 | 58 | * @{ |
apalmieri | 0:a77f1f1f8318 | 59 | */ |
apalmieri | 0:a77f1f1f8318 | 60 | |
apalmieri | 0:a77f1f1f8318 | 61 | /** @defgroup ST |
apalmieri | 0:a77f1f1f8318 | 62 | * @{ |
apalmieri | 0:a77f1f1f8318 | 63 | */ |
apalmieri | 0:a77f1f1f8318 | 64 | |
apalmieri | 0:a77f1f1f8318 | 65 | /** @defgroup LIB_NMEA |
apalmieri | 0:a77f1f1f8318 | 66 | * @{ |
apalmieri | 0:a77f1f1f8318 | 67 | */ |
apalmieri | 0:a77f1f1f8318 | 68 | |
apalmieri | 0:a77f1f1f8318 | 69 | /** @defgroup NMEA_PARSER |
apalmieri | 0:a77f1f1f8318 | 70 | * @{ |
apalmieri | 0:a77f1f1f8318 | 71 | */ |
apalmieri | 0:a77f1f1f8318 | 72 | |
apalmieri | 0:a77f1f1f8318 | 73 | /** @addtogroup NMEA_PARSER_CONSTANTS_DEFINITIONS |
apalmieri | 0:a77f1f1f8318 | 74 | * @{ |
apalmieri | 0:a77f1f1f8318 | 75 | */ |
apalmieri | 0:a77f1f1f8318 | 76 | /** |
apalmieri | 0:a77f1f1f8318 | 77 | * @brief Constant that indicates the maximum lenght of an NMEA sentence |
apalmieri | 0:a77f1f1f8318 | 78 | */ |
apalmieri | 0:a77f1f1f8318 | 79 | #define MAX_NMEA_SENTENCE_LEN 80 |
apalmieri | 0:a77f1f1f8318 | 80 | |
apalmieri | 0:a77f1f1f8318 | 81 | /** |
apalmieri | 0:a77f1f1f8318 | 82 | * @brief Constant that indicates the maximum number of satellites. |
apalmieri | 0:a77f1f1f8318 | 83 | */ |
apalmieri | 0:a77f1f1f8318 | 84 | #define MAX_SAT_NUM 12 |
apalmieri | 0:a77f1f1f8318 | 85 | |
apalmieri | 0:a77f1f1f8318 | 86 | /** |
apalmieri | 0:a77f1f1f8318 | 87 | * @brief Constant that indicates the maximum lenght of a string. |
apalmieri | 0:a77f1f1f8318 | 88 | */ |
apalmieri | 0:a77f1f1f8318 | 89 | #define MAX_STR_LEN 32 |
apalmieri | 0:a77f1f1f8318 | 90 | |
apalmieri | 0:a77f1f1f8318 | 91 | /** |
apalmieri | 0:a77f1f1f8318 | 92 | * @brief Constant that indicates the maximum lenght of NMEA message field. |
apalmieri | 0:a77f1f1f8318 | 93 | */ |
apalmieri | 0:a77f1f1f8318 | 94 | #define MAX_MSG_LEN 32//19 |
apalmieri | 0:a77f1f1f8318 | 95 | /** |
apalmieri | 0:a77f1f1f8318 | 96 | * @} |
apalmieri | 0:a77f1f1f8318 | 97 | */ |
apalmieri | 0:a77f1f1f8318 | 98 | |
apalmieri | 0:a77f1f1f8318 | 99 | #define MAX_GEOFENCES_NUM 8 |
apalmieri | 0:a77f1f1f8318 | 100 | |
apalmieri | 0:a77f1f1f8318 | 101 | /** @addtogroup NMEA_PARSER_TYPES_DEFINITIONS |
apalmieri | 0:a77f1f1f8318 | 102 | * @{ |
apalmieri | 0:a77f1f1f8318 | 103 | */ |
apalmieri | 0:a77f1f1f8318 | 104 | /** |
apalmieri | 0:a77f1f1f8318 | 105 | * @brief Enumeration structure that containes the types of feature messages |
apalmieri | 0:a77f1f1f8318 | 106 | */ |
apalmieri | 0:a77f1f1f8318 | 107 | typedef enum { |
apalmieri | 0:a77f1f1f8318 | 108 | GNSS_FEATURE_EN_MSG = 0, |
apalmieri | 0:a77f1f1f8318 | 109 | GNSS_GEOFENCE_CFG_MSG, |
apalmieri | 0:a77f1f1f8318 | 110 | GNSS_GEOFENCE_STATUS_MSG, |
apalmieri | 0:a77f1f1f8318 | 111 | GNSS_GEOFENCE_ALARM_MSG, |
apalmieri | 0:a77f1f1f8318 | 112 | GNSS_ODO_START_MSG, |
apalmieri | 0:a77f1f1f8318 | 113 | GNSS_ODO_STOP_MSG, |
apalmieri | 0:a77f1f1f8318 | 114 | GNSS_DATALOG_CFG_MSG, |
apalmieri | 0:a77f1f1f8318 | 115 | GNSS_DATALOG_START_MSG, |
apalmieri | 0:a77f1f1f8318 | 116 | GNSS_DATALOG_STOP_MSG, |
apalmieri | 0:a77f1f1f8318 | 117 | GNSS_DATALOG_ERASE_MSG |
apalmieri | 0:a77f1f1f8318 | 118 | } ParseFeatureMsg_Typedef; |
apalmieri | 0:a77f1f1f8318 | 119 | |
apalmieri | 0:a77f1f1f8318 | 120 | /** |
apalmieri | 0:a77f1f1f8318 | 121 | * @brief Enumeration structure that containes the two success states of a parsing process |
apalmieri | 0:a77f1f1f8318 | 122 | */ |
apalmieri | 0:a77f1f1f8318 | 123 | typedef enum { |
apalmieri | 0:a77f1f1f8318 | 124 | PARSE_SUCC = 0, /**< Success status */ |
apalmieri | 0:a77f1f1f8318 | 125 | PARSE_FAIL = 1 /**< Fail status */ |
apalmieri | 0:a77f1f1f8318 | 126 | } ParseStatus_Typedef; |
apalmieri | 0:a77f1f1f8318 | 127 | |
apalmieri | 0:a77f1f1f8318 | 128 | /** |
apalmieri | 0:a77f1f1f8318 | 129 | * @brief Enumeration structure that containes the tipologies of Gps fixing process got from a NMEA string |
apalmieri | 0:a77f1f1f8318 | 130 | */ |
apalmieri | 0:a77f1f1f8318 | 131 | typedef enum { |
apalmieri | 0:a77f1f1f8318 | 132 | INVALID = 0, /**< Invalid Fix status */ |
apalmieri | 0:a77f1f1f8318 | 133 | VALID = 1, /**< Valid Fix status */ |
apalmieri | 0:a77f1f1f8318 | 134 | DGPS_FIX = 2, /**< DGPS Fix status */ |
apalmieri | 0:a77f1f1f8318 | 135 | PPS_FIX = 3, /**< PPS Fix status */ |
apalmieri | 0:a77f1f1f8318 | 136 | REAL_TIME = 4, /**< Real Time Fix status */ |
apalmieri | 0:a77f1f1f8318 | 137 | FLOAT_REAL_TIME = 5, /**< Float Real Time Fix status */ |
apalmieri | 0:a77f1f1f8318 | 138 | ESTIMATED = 6, /**< Estimated Fix status */ |
apalmieri | 0:a77f1f1f8318 | 139 | MANUAL_MODE = 7, /**< Manual Mode Fix status */ |
apalmieri | 0:a77f1f1f8318 | 140 | SIMULATION_MODE = 8 /**< Simulation Mode Fix status */ |
apalmieri | 0:a77f1f1f8318 | 141 | } GPS_ValidTypedef; |
apalmieri | 0:a77f1f1f8318 | 142 | |
apalmieri | 0:a77f1f1f8318 | 143 | /** |
apalmieri | 0:a77f1f1f8318 | 144 | * @brief Data structure that contains the coordinates informations |
apalmieri | 0:a77f1f1f8318 | 145 | */ |
apalmieri | 0:a77f1f1f8318 | 146 | typedef struct Coords { |
apalmieri | 0:a77f1f1f8318 | 147 | double lat; /**< Latitude */ |
apalmieri | 0:a77f1f1f8318 | 148 | double lon; /**< Longitude */ |
apalmieri | 0:a77f1f1f8318 | 149 | float alt; /**< Altitude */ |
apalmieri | 0:a77f1f1f8318 | 150 | uint8_t ns; /**< Nord / Sud latitude type */ |
apalmieri | 0:a77f1f1f8318 | 151 | uint8_t ew; /**< East / West longitude type */ |
apalmieri | 0:a77f1f1f8318 | 152 | uint8_t mis; /**< Altitude unit misure */ |
apalmieri | 0:a77f1f1f8318 | 153 | } Coords; |
apalmieri | 0:a77f1f1f8318 | 154 | |
apalmieri | 0:a77f1f1f8318 | 155 | /** |
apalmieri | 0:a77f1f1f8318 | 156 | * @brief Data structure that contains the Gps geoids informations |
apalmieri | 0:a77f1f1f8318 | 157 | */ |
apalmieri | 0:a77f1f1f8318 | 158 | typedef struct Geoid_Info { |
apalmieri | 0:a77f1f1f8318 | 159 | int height; /**< Geoid height */ |
apalmieri | 0:a77f1f1f8318 | 160 | uint8_t mis; /**< Geoid height misure unit */ |
apalmieri | 0:a77f1f1f8318 | 161 | } Geoid_Info; |
apalmieri | 0:a77f1f1f8318 | 162 | |
apalmieri | 0:a77f1f1f8318 | 163 | /** |
apalmieri | 0:a77f1f1f8318 | 164 | * @brief Data structure that contains the UTC informations |
apalmieri | 0:a77f1f1f8318 | 165 | */ |
apalmieri | 0:a77f1f1f8318 | 166 | typedef struct UTC_Info { |
apalmieri | 0:a77f1f1f8318 | 167 | int utc; /**< UTC Info */ |
apalmieri | 0:a77f1f1f8318 | 168 | int hh; /**< Hours */ |
apalmieri | 0:a77f1f1f8318 | 169 | int mm; /**< Minutes */ |
apalmieri | 0:a77f1f1f8318 | 170 | int ss; /**< Seconds */ |
apalmieri | 0:a77f1f1f8318 | 171 | } UTC_Info; |
apalmieri | 0:a77f1f1f8318 | 172 | |
apalmieri | 0:a77f1f1f8318 | 173 | /** |
apalmieri | 0:a77f1f1f8318 | 174 | * @brief Data structure that contains the UTC informations |
apalmieri | 0:a77f1f1f8318 | 175 | */ |
apalmieri | 0:a77f1f1f8318 | 176 | typedef struct GSV_SAT_Info { |
apalmieri | 0:a77f1f1f8318 | 177 | int prn; /**< PRN */ |
apalmieri | 0:a77f1f1f8318 | 178 | int elev; /**< Elevation of satellite in degree, 0 ... 90 */ |
apalmieri | 0:a77f1f1f8318 | 179 | int azim; /**< Azimuth of satellite in degree, ref. "North, " 0 ... 359 */ |
apalmieri | 0:a77f1f1f8318 | 180 | int cn0; /**< Carrier to noise ratio for satellite in dB, 0 ... 99 */ |
apalmieri | 0:a77f1f1f8318 | 181 | } GSV_SAT_Info; |
apalmieri | 0:a77f1f1f8318 | 182 | |
apalmieri | 0:a77f1f1f8318 | 183 | /** |
apalmieri | 0:a77f1f1f8318 | 184 | * @brief Data structure that contains all of the informations about the GPS position |
apalmieri | 0:a77f1f1f8318 | 185 | */ |
apalmieri | 0:a77f1f1f8318 | 186 | typedef struct GPGGA_Infos { |
apalmieri | 0:a77f1f1f8318 | 187 | UTC_Info utc; /**< UTC Time */ |
apalmieri | 0:a77f1f1f8318 | 188 | Coords xyz; /**< Coords data member */ |
apalmieri | 0:a77f1f1f8318 | 189 | float acc; /**< GPS Accuracy */ |
apalmieri | 0:a77f1f1f8318 | 190 | int sats; /**< Number of satellities acquired */ |
apalmieri | 0:a77f1f1f8318 | 191 | GPS_ValidTypedef valid; /**< GPS Signal fix quality */ |
apalmieri | 0:a77f1f1f8318 | 192 | Geoid_Info geoid; /**< Geoids data info member */ |
apalmieri | 0:a77f1f1f8318 | 193 | int update; /**< Update time from the last acquired GPS Info */ |
apalmieri | 0:a77f1f1f8318 | 194 | int checksum; /**< Checksum of the message bytes */ |
apalmieri | 0:a77f1f1f8318 | 195 | } GPGGA_Infos; |
apalmieri | 0:a77f1f1f8318 | 196 | |
apalmieri | 0:a77f1f1f8318 | 197 | /** |
apalmieri | 0:a77f1f1f8318 | 198 | * @brief Data structure that contains all of the informations about the fix data for single or |
apalmieri | 0:a77f1f1f8318 | 199 | * combined satellite navigation system. |
apalmieri | 0:a77f1f1f8318 | 200 | */ |
apalmieri | 0:a77f1f1f8318 | 201 | typedef struct GNS_Infos { |
apalmieri | 0:a77f1f1f8318 | 202 | char constellation[MAX_STR_LEN]; /**< Constellation enabled: GPGNS (GPS), GLGNS (GLONASS), GAGNS (GALILEO), BDGNS (BEIDOU), QZGNS (QZSS), GNGNS (more than one) */ |
apalmieri | 0:a77f1f1f8318 | 203 | UTC_Info utc; /**< UTC Time */ |
apalmieri | 0:a77f1f1f8318 | 204 | Coords xyz; /**< Coords data member */ |
apalmieri | 0:a77f1f1f8318 | 205 | char gps_mode; /**< N = NO Fix, A = Autonomous, D = Differential GPS, E = Estimated (dead reckoning mode) */ |
apalmieri | 0:a77f1f1f8318 | 206 | char glonass_mode; /**< N = NO Fix, A = Autonomous, D = Differential Glonass, E = Estimated (dead reckoning mode) */ |
apalmieri | 0:a77f1f1f8318 | 207 | int sats; /**< Number of satellities acquired */ |
apalmieri | 0:a77f1f1f8318 | 208 | float hdop; /**< Horizontal Dilution of Precision, max: 99.0 */ |
apalmieri | 0:a77f1f1f8318 | 209 | float geo_sep; /**< Geoidal separation, meter */ |
apalmieri | 0:a77f1f1f8318 | 210 | char dgnss_age; /**< Not supported */ |
apalmieri | 0:a77f1f1f8318 | 211 | char dgnss_ref; /**< Not supported */ |
apalmieri | 0:a77f1f1f8318 | 212 | int checksum; /**< Checksum of the message bytes */ |
apalmieri | 0:a77f1f1f8318 | 213 | } GNS_Infos; |
apalmieri | 0:a77f1f1f8318 | 214 | |
apalmieri | 0:a77f1f1f8318 | 215 | /** |
apalmieri | 0:a77f1f1f8318 | 216 | * @brief Data structure that contains all of the GPS Pseudorange Noise Statistics. |
apalmieri | 0:a77f1f1f8318 | 217 | */ |
apalmieri | 0:a77f1f1f8318 | 218 | typedef struct GPGST_Infos { |
apalmieri | 0:a77f1f1f8318 | 219 | UTC_Info utc; /**< UTC Time */ |
apalmieri | 0:a77f1f1f8318 | 220 | float EHPE; /**< Equivalent Horizontal Position Error */ |
apalmieri | 0:a77f1f1f8318 | 221 | float semi_major_dev; /**< Standard deviation (meters) of semi-major axis of error ellipse */ |
apalmieri | 0:a77f1f1f8318 | 222 | float semi_minor_dev; /**< Standard deviation (meters) of semi-minor axis of error ellipse */ |
apalmieri | 0:a77f1f1f8318 | 223 | float semi_major_angle; /**< Orientation of semi-major axis of error ellipse (true north degrees) */ |
apalmieri | 0:a77f1f1f8318 | 224 | float lat_err_dev; /**< Standard deviation (meters) of latitude error */ |
apalmieri | 0:a77f1f1f8318 | 225 | float lon_err_dev; /**< Standard deviation (meters) of longitude error */ |
apalmieri | 0:a77f1f1f8318 | 226 | float alt_err_dev; /**< Standard deviation (meters) of altitude error */ |
apalmieri | 0:a77f1f1f8318 | 227 | int checksum; /**< Checksum of the message bytes */ |
apalmieri | 0:a77f1f1f8318 | 228 | } GPGST_Infos; |
apalmieri | 0:a77f1f1f8318 | 229 | |
apalmieri | 0:a77f1f1f8318 | 230 | /** |
apalmieri | 0:a77f1f1f8318 | 231 | * @brief Data structure that contains all the Recommended Minimum Specific GPS/Transit data. |
apalmieri | 0:a77f1f1f8318 | 232 | */ |
apalmieri | 0:a77f1f1f8318 | 233 | typedef struct GPRMC_Infos { |
apalmieri | 0:a77f1f1f8318 | 234 | UTC_Info utc; /**< UTC Time */ |
apalmieri | 0:a77f1f1f8318 | 235 | char status; /**< “A” = valid, “V” = Warning */ |
apalmieri | 0:a77f1f1f8318 | 236 | Coords xyz; /**< Coords data member */ |
apalmieri | 0:a77f1f1f8318 | 237 | float speed; /**< Speed over ground in knots */ |
apalmieri | 0:a77f1f1f8318 | 238 | float trackgood; /**< Course made good */ |
apalmieri | 0:a77f1f1f8318 | 239 | int date; /**< Date of Fix */ |
apalmieri | 0:a77f1f1f8318 | 240 | float mag_var; /**< Magnetic Variation */ |
apalmieri | 0:a77f1f1f8318 | 241 | char mag_var_dir; /**< Magnetic Variation Direction */ |
apalmieri | 0:a77f1f1f8318 | 242 | int checksum; /**< Checksum of the message bytes */ |
apalmieri | 0:a77f1f1f8318 | 243 | } GPRMC_Infos; |
apalmieri | 0:a77f1f1f8318 | 244 | |
apalmieri | 0:a77f1f1f8318 | 245 | /** |
apalmieri | 0:a77f1f1f8318 | 246 | * @brief Data structure that contains all of the informations about the GSA satellites |
apalmieri | 0:a77f1f1f8318 | 247 | */ |
apalmieri | 0:a77f1f1f8318 | 248 | typedef struct GSA_Infos { |
apalmieri | 0:a77f1f1f8318 | 249 | char constellation[MAX_STR_LEN]; /**< Constellation enabled: GPGSA (GPS), GLGSA (GLONASS), GAGSA (GALILEO), BDGSA (BEIDOU), GNGSA (more than one) */ |
apalmieri | 0:a77f1f1f8318 | 250 | char operating_mode; /**< Operating Mode: 'M' = Manual, 'A' = Auto (2D/3D) */ |
apalmieri | 0:a77f1f1f8318 | 251 | int current_mode; /**< Current Mode: 1. no fix available, 2. 2D, 3. 3D */ |
apalmieri | 0:a77f1f1f8318 | 252 | int sat_prn[MAX_SAT_NUM]; /**< Satellites list used in position fix (max N 12) */ |
apalmieri | 0:a77f1f1f8318 | 253 | float pdop; /**< Position Dilution of Precision, max: 99.0 */ |
apalmieri | 0:a77f1f1f8318 | 254 | float hdop; /**< Horizontal Dilution of Precision, max: 99.0 */ |
apalmieri | 0:a77f1f1f8318 | 255 | float vdop; /**< Vertical Dilution of Precision, max: 99.0 */ |
apalmieri | 0:a77f1f1f8318 | 256 | int checksum; /**< Checksum of the message bytes */ |
apalmieri | 0:a77f1f1f8318 | 257 | } GSA_Infos; |
apalmieri | 0:a77f1f1f8318 | 258 | |
apalmieri | 0:a77f1f1f8318 | 259 | /** |
apalmieri | 0:a77f1f1f8318 | 260 | * @brief Data structure that contains all of the informations about the GSV satellites |
apalmieri | 0:a77f1f1f8318 | 261 | */ |
apalmieri | 0:a77f1f1f8318 | 262 | typedef struct GSV_Infos { |
apalmieri | 0:a77f1f1f8318 | 263 | char constellation[MAX_STR_LEN]; /**< Constellation enabled: GPGSV (GPS), GLGSV (GLONASS), GAGSV (GALILEO), BDGSV (BEIDOU), QZGSV (QZSS), GNGSV (more than one) */ |
apalmieri | 0:a77f1f1f8318 | 264 | int amount; /**< Total amount of GSV messages, max. 3 */ |
apalmieri | 0:a77f1f1f8318 | 265 | int number; /**< Continued GSV number of this message */ |
apalmieri | 0:a77f1f1f8318 | 266 | int tot_sats; /**< Total Number of Satellites in view, max. 12 */ |
apalmieri | 0:a77f1f1f8318 | 267 | GSV_SAT_Info gsv_sat_i[MAX_SAT_NUM]; /**< Satellite info */ |
apalmieri | 0:a77f1f1f8318 | 268 | int checksum; /**< Checksum of the message bytes */ |
apalmieri | 0:a77f1f1f8318 | 269 | } GSV_Infos; |
apalmieri | 0:a77f1f1f8318 | 270 | |
apalmieri | 0:a77f1f1f8318 | 271 | /** |
apalmieri | 0:a77f1f1f8318 | 272 | * @brief Data structure that contains timestamp |
apalmieri | 0:a77f1f1f8318 | 273 | */ |
apalmieri | 0:a77f1f1f8318 | 274 | typedef struct Timestamp_Info { |
apalmieri | 0:a77f1f1f8318 | 275 | int hh; /**< Hours */ |
apalmieri | 0:a77f1f1f8318 | 276 | int mm; /**< Minutes */ |
apalmieri | 0:a77f1f1f8318 | 277 | int ss; /**< Seconds */ |
apalmieri | 0:a77f1f1f8318 | 278 | int year; /**< Year */ |
apalmieri | 0:a77f1f1f8318 | 279 | int month; /**< Month */ |
apalmieri | 0:a77f1f1f8318 | 280 | int day; /**< Day */ |
apalmieri | 0:a77f1f1f8318 | 281 | } Timestamp_Info; |
apalmieri | 0:a77f1f1f8318 | 282 | |
apalmieri | 0:a77f1f1f8318 | 283 | /** |
apalmieri | 0:a77f1f1f8318 | 284 | * @brief Data structure that contains all of the information about Geofence |
apalmieri | 0:a77f1f1f8318 | 285 | */ |
apalmieri | 0:a77f1f1f8318 | 286 | typedef struct Geofence_Infos { |
apalmieri | 0:a77f1f1f8318 | 287 | uint8_t op; /**< Geofence type message (configuration/status) */ |
apalmieri | 0:a77f1f1f8318 | 288 | uint8_t result; /**< Geofence cfg/request result (OK/ERROR) */ |
apalmieri | 0:a77f1f1f8318 | 289 | int idAlarm; /**< Id of the circle raising the alarm */ |
apalmieri | 0:a77f1f1f8318 | 290 | Timestamp_Info timestamp; |
apalmieri | 0:a77f1f1f8318 | 291 | int status[MAX_GEOFENCES_NUM]; |
apalmieri | 0:a77f1f1f8318 | 292 | } Geofence_Infos; |
apalmieri | 0:a77f1f1f8318 | 293 | |
apalmieri | 0:a77f1f1f8318 | 294 | /** |
apalmieri | 0:a77f1f1f8318 | 295 | * @brief Data structure that contains all of the information about Ododmeter |
apalmieri | 0:a77f1f1f8318 | 296 | */ |
apalmieri | 0:a77f1f1f8318 | 297 | typedef struct Odometer_Infos { |
apalmieri | 0:a77f1f1f8318 | 298 | uint8_t op; /**< Odometer type message (configuration/status) */ |
apalmieri | 0:a77f1f1f8318 | 299 | uint8_t result; /**< Odometer cfg/request result (OK/ERROR) */ |
apalmieri | 0:a77f1f1f8318 | 300 | } Odometer_Infos; |
apalmieri | 0:a77f1f1f8318 | 301 | |
apalmieri | 0:a77f1f1f8318 | 302 | /** |
apalmieri | 0:a77f1f1f8318 | 303 | * @brief Data structure that contains all of the information about Datalog |
apalmieri | 0:a77f1f1f8318 | 304 | */ |
apalmieri | 0:a77f1f1f8318 | 305 | typedef struct Datalog_Infos { |
apalmieri | 0:a77f1f1f8318 | 306 | uint8_t op; /**< Datalog type message (configuration/status) */ |
apalmieri | 0:a77f1f1f8318 | 307 | uint8_t result; /**< Datalog cfg/request result (OK/ERROR) */ |
apalmieri | 0:a77f1f1f8318 | 308 | } Datalog_Infos; |
apalmieri | 0:a77f1f1f8318 | 309 | |
apalmieri | 0:a77f1f1f8318 | 310 | /** |
apalmieri | 0:a77f1f1f8318 | 311 | * @brief Ack from Teseo |
apalmieri | 0:a77f1f1f8318 | 312 | */ |
apalmieri | 0:a77f1f1f8318 | 313 | typedef uint8_t Ack_Info; |
apalmieri | 0:a77f1f1f8318 | 314 | |
apalmieri | 0:a77f1f1f8318 | 315 | /** |
apalmieri | 0:a77f1f1f8318 | 316 | * @} |
apalmieri | 0:a77f1f1f8318 | 317 | */ |
apalmieri | 0:a77f1f1f8318 | 318 | |
apalmieri | 0:a77f1f1f8318 | 319 | /** @addtogroup NMEA_PARSER_PUBLIC_FUNCTIONS |
apalmieri | 0:a77f1f1f8318 | 320 | * @{ |
apalmieri | 0:a77f1f1f8318 | 321 | */ |
apalmieri | 0:a77f1f1f8318 | 322 | ParseStatus_Typedef parse_gpgga (GPGGA_Infos *gpgga_data, uint8_t *NMEA); |
apalmieri | 0:a77f1f1f8318 | 323 | ParseStatus_Typedef parse_gnsmsg (GNS_Infos *gns_data, uint8_t *NMEA); |
apalmieri | 0:a77f1f1f8318 | 324 | ParseStatus_Typedef parse_gpgst (GPGST_Infos *gpgst_data, uint8_t *NMEA); |
apalmieri | 0:a77f1f1f8318 | 325 | ParseStatus_Typedef parse_gprmc (GPRMC_Infos *gprmc_data, uint8_t *NMEA); |
apalmieri | 0:a77f1f1f8318 | 326 | ParseStatus_Typedef parse_gsamsg (GSA_Infos *gsa_data, uint8_t *NMEA); |
apalmieri | 0:a77f1f1f8318 | 327 | ParseStatus_Typedef parse_gsvmsg (GSV_Infos *gsv_data, uint8_t *NMEA); |
apalmieri | 0:a77f1f1f8318 | 328 | void copy_data (GPGGA_Infos *, GPGGA_Infos); |
apalmieri | 0:a77f1f1f8318 | 329 | |
apalmieri | 0:a77f1f1f8318 | 330 | ParseStatus_Typedef parse_pstmgeofence(Geofence_Infos *geofence_data, uint8_t *NMEA); |
apalmieri | 0:a77f1f1f8318 | 331 | ParseStatus_Typedef parse_pstmodo(Odometer_Infos *odo_data, uint8_t *NMEA); |
apalmieri | 0:a77f1f1f8318 | 332 | ParseStatus_Typedef parse_pstmdatalog(Datalog_Infos *datalog_data, uint8_t *NMEA); |
apalmieri | 0:a77f1f1f8318 | 333 | ParseStatus_Typedef parse_pstmsgl(Ack_Info *ack, uint8_t *NMEA); |
apalmieri | 0:a77f1f1f8318 | 334 | ParseStatus_Typedef parse_pstmsavepar(Ack_Info *ack, uint8_t *NMEA); |
apalmieri | 0:a77f1f1f8318 | 335 | /** |
apalmieri | 0:a77f1f1f8318 | 336 | * @} |
apalmieri | 0:a77f1f1f8318 | 337 | */ |
apalmieri | 0:a77f1f1f8318 | 338 | |
apalmieri | 0:a77f1f1f8318 | 339 | /** |
apalmieri | 0:a77f1f1f8318 | 340 | * @} |
apalmieri | 0:a77f1f1f8318 | 341 | */ |
apalmieri | 0:a77f1f1f8318 | 342 | |
apalmieri | 0:a77f1f1f8318 | 343 | /** |
apalmieri | 0:a77f1f1f8318 | 344 | * @} |
apalmieri | 0:a77f1f1f8318 | 345 | */ |
apalmieri | 0:a77f1f1f8318 | 346 | |
apalmieri | 0:a77f1f1f8318 | 347 | /** |
apalmieri | 0:a77f1f1f8318 | 348 | * @} |
apalmieri | 0:a77f1f1f8318 | 349 | */ |
apalmieri | 0:a77f1f1f8318 | 350 | |
apalmieri | 0:a77f1f1f8318 | 351 | /** |
apalmieri | 0:a77f1f1f8318 | 352 | * @} |
apalmieri | 0:a77f1f1f8318 | 353 | */ |
apalmieri | 0:a77f1f1f8318 | 354 | |
apalmieri | 0:a77f1f1f8318 | 355 | #ifdef __cplusplus |
apalmieri | 0:a77f1f1f8318 | 356 | } |
apalmieri | 0:a77f1f1f8318 | 357 | #endif |
apalmieri | 0:a77f1f1f8318 | 358 | |
apalmieri | 0:a77f1f1f8318 | 359 | #endif |