WNMEA  1.0.0
Warcomeb NMEA 0183 Parsing Library based on libohiboard
wnmea-types.h
Go to the documentation of this file.
1 /*
2  * WNMEA - Warcomeb NMEA 0183 Parsing Library
3  * Copyright (C) 2022 Marco Giammarini <http://www.warcomeb.it>
4  *
5  * Authors:
6  * Marco Giammarini <m.giammarini@warcomeb.it>
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining a copy
9  * of this software and associated documentation files (the "Software"), to deal
10  * in the Software without restriction, including without limitation the rights
11  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12  * copies of the Software, and to permit persons to whom the Software is
13  * furnished to do so, subject to the following conditions:
14  *
15  * The above copyright notice and this permission notice shall be included in
16  * all copies or substantial portions of the Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24  * THE SOFTWARE.
25  */
26 
32 #ifndef __WARCOMEB_WNMEA_TYPES_H
33 #define __WARCOMEB_WNMEA_TYPES_H
34 
35 
36 #define WARCOMEB_WNMEA_LIBRARY_VERSION_MAJOR (0x1ul)
37 #define WARCOMEB_WNMEA_LIBRARY_VERSION_MINOR (0x0ul)
38 #define WARCOMEB_WNMEA_LIBRARY_VERSION_BUG (0x0ul)
39 #define WARCOMEB_WNMEA_LIBRARY_TIME 0
40 
41 #ifndef __NO_PROFILES
42 #include "board.h"
43 #include "firmware.h"
44 #endif
45 
52 #define WNMEA_PROJECT_NAME "WNMEA"
53 
54 static const Utility_Version_t WNMEA_FIRMWARE_VERSION =
55 {
60 };
61 
62 #if !defined(WNMEA_MESSAGE_TYPE_LENGTH)
63 #define WNMEA_MESSAGE_TYPE_LENGTH 10
64 #endif
65 
66 #if !defined(WNMEA_MESSAGE_BODY_LENGTH)
67 #define WNMEA_MESSAGE_BODY_LENGTH 100
68 #endif
69 
70 #if !defined(WNMEA_MESSAGE_CRC_LENGTH)
71 #define WNMEA_MESSAGE_CRC_LENGTH 2
72 #endif
73 
74 #if !defined (WNMEA_BUFFER_DIMENSION)
75 #define WNMEA_BUFFER_DIMENSION 0x03FFu
76 #endif
77 
78 
82 typedef float WNMEA_Coordinate_t;
83 
87 typedef enum _WNMEA_Errors_t
88 {
92 
94 
96 
101 {
108 
110 
112 
117 {
124 
126 
128 
133 {
138 
141 
147 {
151 
157 {
162 
166 typedef struct _WNMEA_Message_t
167 {
171 
173 
177 typedef struct _WNMEA_MessageRMC_t
178 {
180  Time_TimeType time;
181  Time_DateType date;
186  float speed;
188 
192 typedef struct _WNMEA_MessageGGA_t
193 {
194  Time_TimeType time;
200  uint8_t satellites;
202 
206 typedef struct _WNMEA_MessageZDA_t
207 {
208  Time_TimeType time;
209  Time_DateType date;
210  int8_t hourDiff;
211  int8_t minuteDiff;
213 
218 {
221 
222  union
223  {
228 
230 
235 
241 {
245 
250 #endif // __WARCOMEB_WCDLI_TYPES_H
_WNMEA_MessageZDA_t
Definition: wnmea-types.h:207
_WNMEA_MessageParsed_t::zda
WNMEA_MessageZDA_t zda
Definition: wnmea-types.h:226
WNMEA_MESSAGETYPE_UNKNOW
@ WNMEA_MESSAGETYPE_UNKNOW
Definition: wnmea-types.h:125
WNMEA_MESSAGE_BODY_LENGTH
#define WNMEA_MESSAGE_BODY_LENGTH
Definition: wnmea-types.h:67
WNMEA_MessageType_t
enum _WNMEA_MessageType_t WNMEA_MessageType_t
WNMEA_Message_t
struct _WNMEA_Message_t WNMEA_Message_t
WNMEA_FIRMWARE_VERSION
static const Utility_Version_t WNMEA_FIRMWARE_VERSION
Definition: wnmea-types.h:54
_WNMEA_MessageCallback_t::gga
WNMEA_pFunctionCallback gga
Definition: wnmea-types.h:243
_WNMEA_MessageRMC_t
Definition: wnmea-types.h:178
_WNMEA_MessageGGA_t::satellites
uint8_t satellites
Number of satellites in use (not in view!)
Definition: wnmea-types.h:200
_WNMEA_MessageGGA_t::time
Time_TimeType time
UTC of Position.
Definition: wnmea-types.h:194
_WNMEA_MessageZDA_t::hourDiff
int8_t hourDiff
Local zone description, 00 to +/- 13 hours.
Definition: wnmea-types.h:210
_WNMEA_CardinalSide_t
_WNMEA_CardinalSide_t
Definition: wnmea-types.h:133
WNMEA_CONSTELLATION_MULTIPLE
@ WNMEA_CONSTELLATION_MULTIPLE
Definition: wnmea-types.h:107
WARCOMEB_WNMEA_LIBRARY_VERSION_MINOR
#define WARCOMEB_WNMEA_LIBRARY_VERSION_MINOR
Definition: wnmea-types.h:37
WNMEA_CONSTELLATION_GPS
@ WNMEA_CONSTELLATION_GPS
Definition: wnmea-types.h:102
WNMEA_POSITIONTYPE_VALID
@ WNMEA_POSITIONTYPE_VALID
Definition: wnmea-types.h:148
WNMEA_CONSTELLATION_GLONASS
@ WNMEA_CONSTELLATION_GLONASS
Definition: wnmea-types.h:103
_WNMEA_MessageGGA_t::latitudeSide
WNMEA_CardinalSide_t latitudeSide
Definition: wnmea-types.h:196
_WNMEA_Constellation_t
_WNMEA_Constellation_t
Definition: wnmea-types.h:101
WNMEA_CARDINALSIDE_WEST
@ WNMEA_CARDINALSIDE_WEST
Definition: wnmea-types.h:137
WNMEA_MessageRMC_t
struct _WNMEA_MessageRMC_t WNMEA_MessageRMC_t
WNMEA_Coordinate_t
float WNMEA_Coordinate_t
Definition: wnmea-types.h:82
WNMEA_MessageZDA_t
struct _WNMEA_MessageZDA_t WNMEA_MessageZDA_t
WNMEA_FIXQUALITY_INVALID
@ WNMEA_FIXQUALITY_INVALID
Definition: wnmea-types.h:158
_WNMEA_Message_t
Definition: wnmea-types.h:167
WNMEA_MessageGGA_t
struct _WNMEA_MessageGGA_t WNMEA_MessageGGA_t
_WNMEA_Message_t::checksum
char checksum[WNMEA_MESSAGE_CRC_LENGTH]
Definition: wnmea-types.h:170
_WNMEA_MessageGGA_t::longitudeSide
WNMEA_CardinalSide_t longitudeSide
Definition: wnmea-types.h:198
_WNMEA_MessageZDA_t::minuteDiff
int8_t minuteDiff
Local zone minutes description (same sign as hours)
Definition: wnmea-types.h:211
WNMEA_PositionType_t
enum _WNMEA_PositionType_t WNMEA_PositionType_t
_WNMEA_MessageRMC_t::longitude
WNMEA_Coordinate_t longitude
Longitude of fix.
Definition: wnmea-types.h:182
_WNMEA_MessageRMC_t::time
Time_TimeType time
UTC of position fix.
Definition: wnmea-types.h:180
_WNMEA_MessageRMC_t::date
Time_DateType date
Definition: wnmea-types.h:181
WNMEA_ERROR_SUCCESS
@ WNMEA_ERROR_SUCCESS
Definition: wnmea-types.h:89
_WNMEA_MessageRMC_t::status
WNMEA_PositionType_t status
Data status (V=navigation receiver warning)
Definition: wnmea-types.h:179
WNMEA_MESSAGETYPE_GSV
@ WNMEA_MESSAGETYPE_GSV
Definition: wnmea-types.h:121
WNMEA_MessageParsed_t
struct _WNMEA_MessageParsed_t WNMEA_MessageParsed_t
WNMEA_Error_t
enum _WNMEA_Errors_t WNMEA_Error_t
_WNMEA_MessageGGA_t::longitude
WNMEA_Coordinate_t longitude
Longitude of fix.
Definition: wnmea-types.h:197
WNMEA_CONSTELLATION_UNKNOW
@ WNMEA_CONSTELLATION_UNKNOW
Definition: wnmea-types.h:109
WNMEA_MESSAGE_TYPE_LENGTH
#define WNMEA_MESSAGE_TYPE_LENGTH
Definition: wnmea-types.h:63
WNMEA_FIXQUALITY_FIX
@ WNMEA_FIXQUALITY_FIX
Definition: wnmea-types.h:159
_WNMEA_Message_t::body
char body[WNMEA_MESSAGE_BODY_LENGTH]
Definition: wnmea-types.h:169
WNMEA_CARDINALSIDE_EAST
@ WNMEA_CARDINALSIDE_EAST
Definition: wnmea-types.h:136
WNMEA_CardinalSide_t
enum _WNMEA_CardinalSide_t WNMEA_CardinalSide_t
WNMEA_MESSAGETYPE_GGA
@ WNMEA_MESSAGETYPE_GGA
Definition: wnmea-types.h:119
_WNMEA_MessageRMC_t::latitudeSide
WNMEA_CardinalSide_t latitudeSide
Definition: wnmea-types.h:185
_WNMEA_MessageRMC_t::speed
float speed
Speed over ground in knots.
Definition: wnmea-types.h:186
_WNMEA_MessageParsed_t::type
WNMEA_MessageType_t type
Definition: wnmea-types.h:220
WNMEA_ERROR_MESSAGE_PARSING
@ WNMEA_ERROR_MESSAGE_PARSING
Definition: wnmea-types.h:91
WNMEA_CONSTELLATION_GALILEO
@ WNMEA_CONSTELLATION_GALILEO
Definition: wnmea-types.h:104
_WNMEA_MessageParsed_t::gga
WNMEA_MessageGGA_t gga
Definition: wnmea-types.h:225
_WNMEA_Errors_t
_WNMEA_Errors_t
Definition: wnmea-types.h:88
_WNMEA_MessageParsed_t::message
union _WNMEA_MessageParsed_t::@0 message
WNMEA_ERROR_WRONG_MESSAGE
@ WNMEA_ERROR_WRONG_MESSAGE
Definition: wnmea-types.h:90
WNMEA_MessageParsedHandle_t
struct _WNMEA_MessageParsed_t * WNMEA_MessageParsedHandle_t
WARCOMEB_WNMEA_LIBRARY_TIME
#define WARCOMEB_WNMEA_LIBRARY_TIME
Definition: wnmea-types.h:39
WNMEA_MESSAGETYPE_GLL
@ WNMEA_MESSAGETYPE_GLL
Definition: wnmea-types.h:120
WNMEA_ERROR_MESSAGE_READY
@ WNMEA_ERROR_MESSAGE_READY
Definition: wnmea-types.h:93
_WNMEA_MessageGGA_t::quality
WNMEA_FixQuality_t quality
GPS quality indicator.
Definition: wnmea-types.h:199
_WNMEA_MessageRMC_t::longitudeSide
WNMEA_CardinalSide_t longitudeSide
Definition: wnmea-types.h:183
WNMEA_CONSTELLATION_BEIDOU
@ WNMEA_CONSTELLATION_BEIDOU
Definition: wnmea-types.h:105
_WNMEA_MessageGGA_t::latitude
WNMEA_Coordinate_t latitude
Latitude of fix.
Definition: wnmea-types.h:195
_WNMEA_Message_t::type
char type[WNMEA_MESSAGE_TYPE_LENGTH]
Definition: wnmea-types.h:168
_WNMEA_MessageRMC_t::latitude
WNMEA_Coordinate_t latitude
Latitude of fix.
Definition: wnmea-types.h:184
_WNMEA_MessageType_t
_WNMEA_MessageType_t
Definition: wnmea-types.h:117
WNMEA_CONSTELLATION_NAVIC
@ WNMEA_CONSTELLATION_NAVIC
Definition: wnmea-types.h:106
WNMEA_FIXQUALITY_DIFFERENTIAL_FIX
@ WNMEA_FIXQUALITY_DIFFERENTIAL_FIX
Definition: wnmea-types.h:160
WNMEA_pFunctionCallback
void(* WNMEA_pFunctionCallback)(WNMEA_MessageParsed_t msg, WNMEA_MessageType_t type)
Definition: wnmea-types.h:234
_WNMEA_MessageParsed_t::constellation
WNMEA_Constellation_t constellation
Definition: wnmea-types.h:219
_WNMEA_MessageGGA_t
Definition: wnmea-types.h:193
WNMEA_MESSAGE_CRC_LENGTH
#define WNMEA_MESSAGE_CRC_LENGTH
Definition: wnmea-types.h:71
WNMEA_MESSAGETYPE_ZDA
@ WNMEA_MESSAGETYPE_ZDA
Definition: wnmea-types.h:123
_WNMEA_MessageZDA_t::date
Time_DateType date
UT date of position fix.
Definition: wnmea-types.h:209
WNMEA_MessageCallback_t
struct _WNMEA_MessageCallback_t WNMEA_MessageCallback_t
_WNMEA_MessageParsed_t::rmc
WNMEA_MessageRMC_t rmc
Definition: wnmea-types.h:224
WNMEA_FixQuality_t
enum _WNMEA_FixQuality_t WNMEA_FixQuality_t
WNMEA_CARDINALSIDE_UNKNOW
@ WNMEA_CARDINALSIDE_UNKNOW
Definition: wnmea-types.h:139
WNMEA_MESSAGETYPE_GSA
@ WNMEA_MESSAGETYPE_GSA
Definition: wnmea-types.h:122
_WNMEA_MessageCallback_t
Definition: wnmea-types.h:241
_WNMEA_MessageParsed_t
Definition: wnmea-types.h:218
_WNMEA_MessageCallback_t::rmc
WNMEA_pFunctionCallback rmc
Definition: wnmea-types.h:242
_WNMEA_FixQuality_t
_WNMEA_FixQuality_t
Definition: wnmea-types.h:157
WNMEA_MESSAGETYPE_RMC
@ WNMEA_MESSAGETYPE_RMC
Definition: wnmea-types.h:118
WARCOMEB_WNMEA_LIBRARY_VERSION_MAJOR
#define WARCOMEB_WNMEA_LIBRARY_VERSION_MAJOR
Definition: wnmea-types.h:36
WARCOMEB_WNMEA_LIBRARY_VERSION_BUG
#define WARCOMEB_WNMEA_LIBRARY_VERSION_BUG
Definition: wnmea-types.h:38
WNMEA_CARDINALSIDE_SOUTH
@ WNMEA_CARDINALSIDE_SOUTH
Definition: wnmea-types.h:135
_WNMEA_MessageZDA_t::time
Time_TimeType time
UTC of position fix.
Definition: wnmea-types.h:208
WNMEA_Constellation_t
enum _WNMEA_Constellation_t WNMEA_Constellation_t
WNMEA_CARDINALSIDE_NORTH
@ WNMEA_CARDINALSIDE_NORTH
Definition: wnmea-types.h:134
WNMEA_POSITIONTYPE_INVALID
@ WNMEA_POSITIONTYPE_INVALID
Definition: wnmea-types.h:149
_WNMEA_PositionType_t
_WNMEA_PositionType_t
Definition: wnmea-types.h:147