File containing the NMEA parser functions. More...

Go to the source code of this file.
Data Structures | |
struct | nmea_sentence_rmc |
struct | nmea_sentence_gga |
Macros | |
#define | NMEA_MAX_LENGTH 100 |
Maximum length for NMEA sentences. | |
Typedefs | |
typedef struct nmea_sentence_rmc | nmea_sentence_rmc |
typedef struct nmea_sentence_gga | nmea_sentence_gga |
Enumerations | |
enum | nmea_sentence_id { NMEA_INVALID = -1, NMEA_UNKNOWN = 0, NMEA_SENTENCE_RMC, NMEA_SENTENCE_GGA, NMEA_SENTENCE_GSA, NMEA_SENTENCE_GLL, NMEA_SENTENCE_GST, NMEA_SENTENCE_GSV, NMEA_SENTENCE_VTG } |
Functions | |
int | hex2int (char c) |
Transform hexa to integer. More... | |
int | nmea_scan (const char *sentence, const char *format,...) |
Scanf-like processor for NMEA sentences. More... | |
int | nmea_isfield (char c) |
Check if the char is part of the field. More... | |
enum nmea_sentence_id | nmea_sentence_id (char *sentence) |
Determine sentence identifier. More... | |
int | nmea_check (const char *sentence, int strict) |
Check sentence validity and checksum. More... | |
int | nmea_parse_rmc (nmea_sentence_rmc *frame, const char *sentence) |
Parse a RMC sentence. More... | |
int | nmea_parse_gga (nmea_sentence_gga *frame, const char *sentence) |
Parse a GGA sentence. More... | |
Detailed Description
File containing the NMEA parser functions.
Typedef Documentation
typedef struct nmea_sentence_gga nmea_sentence_gga |
The structure that contains the data of GGA sentences
typedef struct nmea_sentence_rmc nmea_sentence_rmc |
The structure that contains the data of RMC sentences
Enumeration Type Documentation
enum nmea_sentence_id |
The sentence identifier
Function Documentation
int hex2int | ( | char | c | ) |
Transform hexa to integer.
- Parameters
-
[in] c An integer (char)
- Returns
- An integer (hex)

int nmea_check | ( | const char * | sentence, |
int | strict | ||
) |
Check sentence validity and checksum.
Calculate checksum and compare it
- Parameters
-
sentence The sentence to test strict Accept or not sentence with checksum
- Returns
- 1 for valid sentences.


int nmea_isfield | ( | char | c | ) |
Check if the char is part of the field.
Aka char isn't a comma or star
- Parameters
-
c The char to test
- Returns
- 1 is valid, 0 if not

int nmea_parse_gga | ( | nmea_sentence_gga * | frame, |
const char * | sentence | ||
) |
Parse a GGA sentence.
- Parameters
-
frame The struct where to put the parsed data sentence The sentence to parse
- Returns
- 1 on success

int nmea_parse_rmc | ( | nmea_sentence_rmc * | frame, |
const char * | sentence | ||
) |
Parse a RMC sentence.
- Parameters
-
frame The struct where to put the parsed data sentence The sentence to parse
- Returns
- 1 on success


int nmea_scan | ( | const char * | sentence, |
const char * | format, | ||
... | |||
) |
Scanf-like processor for NMEA sentences.
Supports the following formats: c - single character (char *) d - direction, returned as 1/-1, default 0 (int *) f - float (float *) o - longitude value, transform all in degrees (float *) a - latitude value, transform all in degrees (float *) i - decimal (integer), default zero (int *) s - string (char *) t - talker identifier and type (char *)
- Parameters
-
sentence The sentence to parse format The format of the sentence
- See also
- nmea_parse_*** functions for further explanations
- Returns
- 1 on success, 1 if not


enum nmea_sentence_id nmea_sentence_id | ( | char * | sentence | ) |
Determine sentence identifier.
- Parameters
-
sentence Then sentence to test
- Returns
- The type of sentence