Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
gps_nmea_send.c File Reference

module used to send GPS data over a Tawaki UART for extern instrument using NMEA protocol Exemple of use : MAPIR camera stores GPS data in metadata on each frame More...

#include "modules/gps/gps_nmea_send.h"
#include "mcu_periph/uart.h"
#include "generated/airframe.h"
#include "state.h"
#include "modules/gps/gps.h"
#include <string.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <math.h>
#include <inttypes.h>
Include dependency graph for gps_nmea_send.c:

Go to the source code of this file.

Functions

static void recover_gps_data (void)
 Function to recover data available onboard from GPS.
static void build_nmea_sentence (void)
 Function to build sentence for NMEA Protocol.
static uint8_t nmea_checksum (const char *sentence, int length)
 Function to calculate checksum.
static void nmea_convert_deg_to_DDMM (double deg, char *buf, int is_lat)
 Function to convert lat long in DDLL.MMMM Format Lat and long don't have the same length.
static void gps_nmea_get_system_date_str (char *buf_date, size_t buf_date_size, char *buf_time, size_t buf_time_size)
 Get Date from system.
static void nmea_send (const char *payload, int payload_length)
 Function to send payload to UART.
void gps_nmea_send_init (void)
 Initialization function.
void gps_nmea_send_periodic (void)
 Periodic function to send data.

Variables

struct Gps_Nmea_Send gps_nmea_send

Detailed Description

module used to send GPS data over a Tawaki UART for extern instrument using NMEA protocol Exemple of use : MAPIR camera stores GPS data in metadata on each frame

Author
Jean-Baptiste FORESTIER

Definition in file gps_nmea_send.c.

Function Documentation

◆ build_nmea_sentence()

void build_nmea_sentence ( void )
static

Function to build sentence for NMEA Protocol.

Definition at line 105 of file gps_nmea_send.c.

References gps, GPS_FIX_3D, gps_nmea_get_system_date_str(), gps_nmea_send, nmea_checksum(), nmea_convert_deg_to_DDMM(), and nmea_send().

Referenced by gps_nmea_send_periodic().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gps_nmea_get_system_date_str()

void gps_nmea_get_system_date_str ( char * buf_date,
size_t buf_date_size,
char * buf_time,
size_t buf_time_size )
static

Get Date from system.

Definition at line 221 of file gps_nmea_send.c.

References gps.

Referenced by build_nmea_sentence().

Here is the caller graph for this function:

◆ gps_nmea_send_init()

void gps_nmea_send_init ( void )

Initialization function.

Definition at line 56 of file gps_nmea_send.c.

References gps_nmea_send.

◆ gps_nmea_send_periodic()

void gps_nmea_send_periodic ( void )

Periodic function to send data.

Definition at line 72 of file gps_nmea_send.c.

References build_nmea_sentence(), and recover_gps_data().

Here is the call graph for this function:

◆ nmea_checksum()

uint8_t nmea_checksum ( const char * sentence,
int length )
static

Function to calculate checksum.

Definition at line 190 of file gps_nmea_send.c.

Referenced by build_nmea_sentence().

Here is the caller graph for this function:

◆ nmea_convert_deg_to_DDMM()

void nmea_convert_deg_to_DDMM ( double deg,
char * buf,
int is_lat )
static

Function to convert lat long in DDLL.MMMM Format Lat and long don't have the same length.

Definition at line 203 of file gps_nmea_send.c.

Referenced by build_nmea_sentence().

Here is the caller graph for this function:

◆ nmea_send()

void nmea_send ( const char * payload,
int payload_length )
static

Function to send payload to UART.

Definition at line 273 of file gps_nmea_send.c.

References uart_put_buffer().

Referenced by build_nmea_sentence().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ recover_gps_data()

void recover_gps_data ( void )
static

Function to recover data available onboard from GPS.

Definition at line 82 of file gps_nmea_send.c.

References gps, gps_nmea_send, NormCourseRad, stateGetHmslOrigin_f(), stateGetHorizontalSpeedDir_f(), stateGetHorizontalSpeedNorm_f(), stateGetPositionEnu_f(), stateGetPositionLla_f(), and EnuCoor_f::z.

Referenced by gps_nmea_send_periodic().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ gps_nmea_send

struct Gps_Nmea_Send gps_nmea_send

Definition at line 43 of file gps_nmea_send.c.

Referenced by build_nmea_sentence(), gps_nmea_send_init(), and recover_gps_data().