Paparazzi UAS  v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
gps_nmea.c File Reference

Basic parser for the NMEA protocol. More...

#include "subsystems/gps.h"
#include "subsystems/abi.h"
#include "led.h"
#include "math/pprz_geodetic_float.h"
#include <inttypes.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
+ Include dependency graph for gps_nmea.c:

Go to the source code of this file.

Macros

#define NMEA_PRINT(...)   {};
 
#define WAIT   0
 
#define GOT_START   1
 
#define GOT_CHECKSUM   2
 
#define GOT_END   3
 

Functions

static void nmea_parse_GSA (void)
 Parse GSA NMEA messages. More...
 
static void nmea_parse_RMC (void)
 Parse RMC NMEA messages. More...
 
static void nmea_parse_GGA (void)
 Parse GGA NMEA messages. More...
 
static void nmea_parse_GSV (void)
 Parse GSV-nmea-messages. More...
 
void gps_impl_init (void)
 GPS initialization. More...
 
void gps_nmea_msg (void)
 
void WEAK nmea_configure (void)
 The function to be called when a characted from the device is available. More...
 
void WEAK nmea_parse_prop_init (void)
 
void WEAK nmea_parse_prop_msg (void)
 
void nmea_parse_msg (void)
 nmea_parse_char() has a complete line. More...
 
void nmea_parse_char (uint8_t c)
 This is the actual parser. More...
 
uint8_t nmea_calc_crc (const char *buff, int buff_sz)
 Calculate control sum of binary buffer. More...
 

Variables

struct GpsNmea gps_nmea
 

Detailed Description

Basic parser for the NMEA protocol.

Status: Parsing GGA, RMC, GSA and GSV.

Definition in file gps_nmea.c.

Macro Definition Documentation

#define GOT_CHECKSUM   2

Definition at line 59 of file gps_nmea.c.

Referenced by nmea_parse_char().

#define GOT_END   3

Definition at line 60 of file gps_nmea.c.

Referenced by nmea_parse_char().

#define GOT_START   1

Definition at line 58 of file gps_nmea.c.

Referenced by nmea_parse_char().

#define NMEA_PRINT (   ...)    {};
#define WAIT   0

Definition at line 57 of file gps_nmea.c.

Referenced by nmea_parse_char(), and nmea_parse_msg().

Function Documentation

void gps_impl_init ( void  )

GPS initialization.

GPS model specific init implementation.

Definition at line 70 of file gps_nmea.c.

References FALSE, gps, GPS_NB_CHANNELS, GpsNmea::gps_nb_ovrn, gps_nmea, GpsNmea::have_gsv, GpsNmea::is_configured, GpsNmea::msg_available, GpsNmea::msg_len, GpsState::nb_channels, nmea_configure(), nmea_parse_prop_init(), and GpsNmea::pos_available.

+ Here is the call graph for this function:

void gps_nmea_msg ( void  )
uint8_t nmea_calc_crc ( const char *  buff,
int  buff_sz 
)

Calculate control sum of binary buffer.

Definition at line 225 of file gps_nmea.c.

Referenced by nmea_configure().

+ Here is the caller graph for this function:

void WEAK nmea_configure ( void  )

The function to be called when a characted from the device is available.

The function to be called when a characted from the device is available.

Sets gps_nmea.is_configured to TRUE if all config msgs are sent.

Definition at line 101 of file gps_nmea.c.

References buf, crc, furuno_cfg_cnt, gps_furuno_settings, GPS_FURUNO_SETTINGS_NB, gps_nmea, GpsLinkDevice, GpsNmea::is_configured, nmea_calc_crc(), and TRUE.

Referenced by gps_impl_init(), and GpsEvent().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void nmea_parse_char ( uint8_t  c)

This is the actual parser.

It reads one character at a time setting gps_nmea.msg_available to TRUE after a full line.

Definition at line 156 of file gps_nmea.c.

References GOT_CHECKSUM, GOT_END, GOT_START, gps_nmea, GpsNmea::msg_available, GpsNmea::msg_buf, GpsNmea::msg_len, NMEA_MAXLEN, NMEA_PRINT, GpsNmea::status, TRUE, and WAIT.

Referenced by GpsEvent().

+ Here is the caller graph for this function:

static void nmea_parse_GGA ( void  )
static
static void nmea_parse_GSA ( void  )
static

Parse GSA NMEA messages.

GPS DOP and active satellites. Msg stored in gps_nmea.msg_buf.

Definition at line 242 of file gps_nmea.c.

References GpsState::fix, gps, gps_nmea, GpsNmea::have_gsv, GpsNmea::msg_buf, NMEA_PRINT, nmea_read_until(), GpsState::pdop, SVinfo::svid, and GpsState::svinfos.

Referenced by nmea_parse_msg().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void nmea_parse_GSV ( void  )
static

Parse GSV-nmea-messages.

Msg stored in gps_nmea.msg_buf.

Definition at line 479 of file gps_nmea.c.

References SVinfo::azim, SVinfo::cno, SVinfo::elev, FALSE, gps, gps_nmea, GpsNmea::msg_buf, NMEA_PRINT, nmea_read_until(), SVinfo::svid, GpsState::svinfos, and TRUE.

Referenced by nmea_parse_msg().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void nmea_parse_msg ( void  )

nmea_parse_char() has a complete line.

Find out what type of message it is and hand it to the parser for that type.

Definition at line 119 of file gps_nmea.c.

References gps_nmea, GpsNmea::have_gsv, GpsNmea::msg_buf, GpsNmea::msg_len, nmea_parse_GGA(), nmea_parse_GSA(), nmea_parse_GSV(), nmea_parse_prop_msg(), nmea_parse_RMC(), NMEA_PRINT, GpsNmea::status, TRUE, and WAIT.

Referenced by gps_nmea_msg().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void WEAK nmea_parse_prop_init ( void  )

Definition at line 106 of file gps_nmea.c.

References furuno_cfg_cnt.

Referenced by gps_impl_init().

+ Here is the caller graph for this function:

void WEAK nmea_parse_prop_msg ( void  )

Definition at line 110 of file gps_nmea.c.

References gps_nmea, GpsNmea::msg_buf, GpsNmea::msg_len, and nmea_parse_perdcrv().

Referenced by nmea_parse_msg().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void nmea_parse_RMC ( void  )
static

Parse RMC NMEA messages.

Recommended minimum GPS sentence. Msg stored in gps_nmea.msg_buf.

Definition at line 308 of file gps_nmea.c.

References GpsState::course, gps, gps_nmea, GpsState::gspeed, GpsNmea::msg_buf, NMEA_PRINT, and nmea_read_until().

Referenced by nmea_parse_msg().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation