parser_nmea.h File Reference

File containing the NMEA parser functions. More...

This graph shows which files directly or indirectly include this file:

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.

Author
Gaƫl Foppolo (gaelfoppolo)

Typedef Documentation

The structure that contains the data of GGA sentences

The structure that contains the data of RMC sentences

Enumeration Type Documentation

The sentence identifier

Function Documentation

int hex2int ( char  c)

Transform hexa to integer.

Parameters
[in]cAn integer (char)
Returns
An integer (hex)

Here is the caller graph for this function:

int nmea_check ( const char *  sentence,
int  strict 
)

Check sentence validity and checksum.

Calculate checksum and compare it

Parameters
sentenceThe sentence to test
strictAccept or not sentence with checksum
Returns
1 for valid sentences.

Here is the call graph for this function:

Here is the caller graph for this function:

int nmea_isfield ( char  c)

Check if the char is part of the field.

Aka char isn't a comma or star

Parameters
cThe char to test
Returns
1 is valid, 0 if not

Here is the caller graph for this function:

int nmea_parse_gga ( nmea_sentence_gga frame,
const char *  sentence 
)

Parse a GGA sentence.

Parameters
frameThe struct where to put the parsed data
sentenceThe sentence to parse
Returns
1 on success

Here is the call graph for this function:

int nmea_parse_rmc ( nmea_sentence_rmc frame,
const char *  sentence 
)

Parse a RMC sentence.

Parameters
frameThe struct where to put the parsed data
sentenceThe sentence to parse
Returns
1 on success

Here is the call graph for this function:

Here is the caller graph for this function:

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
sentenceThe sentence to parse
formatThe format of the sentence
See also
nmea_parse_*** functions for further explanations
Returns
1 on success, 1 if not

Here is the call graph for this function:

Here is the caller graph for this function:

enum nmea_sentence_id nmea_sentence_id ( char *  sentence)

Determine sentence identifier.

Parameters
sentenceThen sentence to test
Returns
The type of sentence