Larus glider flight sensor system 3.9.2024
Software-In-The-Loop test and validation system
Loading...
Searching...
No Matches
NMEA_format.h File Reference

converters for NMEA string output More...

#include "data_structures.h"
#include "embedded_math.h"

Go to the source code of this file.

Classes

class  string_buffer_t
 contains a string including it's length More...
 

Enumerations

enum  PLARS_TYPES { MC = 0 , BAL , BUGS , QNH }
 

Functions

void format_NMEA_string_fast (const output_data_t &output_data, string_buffer_t &NMEA_buf, bool horizon_available)
 combine all data to be output to the NMEA port
 
void format_NMEA_string_slow (const output_data_t &output_data, string_buffer_t &NMEA_buf)
 this procedure formats all our NMEA sequences
 
charto_ascii_2_decimals (int32_t number, char *s)
 
charto_ascii_1_decimal (int32_t number, char *s)
 
charto_ascii_2_decimals (float32_t number, char *s)
 
charto_ascii_1_decimal (float32_t number, char *s)
 
void format_PLARV (float variometer, float avg_variometer, float pressure_altitude, float TAS, char *&p)
 TEK vario, average vario, pressure altitude and speed (TAS)
 
void format_RMC (const coordinates_t &coordinates, char *&p)
 NMEA-format time, position, groundspeed, track data.
 
void format_PLARS (float value, PLARS_TYPES type, char *&p)
 format setting NMEA for MacCready, Ballast, Bugs, QNH
 
bool NMEA_checksum (const char *line)
 test a line for valid NMEA checksum
 

Detailed Description

converters for NMEA string output


Author
Dr. Klaus Schaefer

Definition in file NMEA_format.h.

Enumeration Type Documentation

◆ PLARS_TYPES

Enumerator
MC 
BAL 
BUGS 
QNH 

Definition at line 21 of file NMEA_format.h.

Function Documentation

◆ format_NMEA_string_fast()

void format_NMEA_string_fast ( const output_data_t output_data,
string_buffer_t NMEA_buf,
bool  horizon_available 
)

combine all data to be output to the NMEA port

combine all data to be output to the NMEA port

Definition at line 436 of file NMEA_format.cpp.

References EAST, format_PLARA(), format_PLARV(), format_PLARW(), NORTH, and ZERO.

◆ format_NMEA_string_slow()

void format_NMEA_string_slow ( const output_data_t output_data,
string_buffer_t NMEA_buf 
)

this procedure formats all our NMEA sequences

Definition at line 461 of file NMEA_format.cpp.

References EAST, format_GGA(), format_PLARB(), format_PLARD(), format_PLARW(), format_RMC(), and NORTH.

◆ format_PLARS()

void format_PLARS ( float  value,
PLARS_TYPES  type,
char *&  p 
)

format setting NMEA for MacCready, Ballast, Bugs, QNH

Definition at line 389 of file NMEA_format.cpp.

References append_string(), BAL, BUGS, MC, NMEA_append_tail(), PLARS, PLARS_BAL, PLARS_BUGS, PLARS_MC, PLARS_QNH, QNH, to_ascii_1_decimal(), and to_ascii_2_decimals().

◆ format_PLARV()

void format_PLARV ( float  variometer,
float  avg_variometer,
float  pressure_altitude,
float  TAS,
char *&  p 
)

TEK vario, average vario, pressure altitude and speed (TAS)

Definition at line 359 of file NMEA_format.cpp.

References append_string(), format_integer(), MPS_TO_KMPH, NMEA_append_tail(), PLARV, and to_ascii_2_decimals().

Referenced by format_NMEA_string_fast().

◆ format_RMC()

◆ NMEA_checksum()

bool NMEA_checksum ( const char line)

test a line for valid NMEA checksum

Definition at line 424 of file NMEA_format.cpp.

References hex4().

◆ to_ascii_1_decimal() [1/2]

char * to_ascii_1_decimal ( float32_t  number,
char s 
)
inline

Definition at line 37 of file NMEA_format.h.

References s, and to_ascii_1_decimal().

◆ to_ascii_1_decimal() [2/2]

char * to_ascii_1_decimal ( int32_t  number,
char s 
)

format an integer into ASCII with one decimal

Parameters
numbervalue * 10

Definition at line 85 of file NMEA_format.cpp.

References format_integer(), HEX, and s.

Referenced by format_GGA(), format_PLARA(), format_PLARS(), and to_ascii_1_decimal().

◆ to_ascii_2_decimals() [1/2]

char * to_ascii_2_decimals ( float32_t  number,
char s 
)
inline

Definition at line 33 of file NMEA_format.h.

References s, and to_ascii_2_decimals().

◆ to_ascii_2_decimals() [2/2]

char * to_ascii_2_decimals ( int32_t  number,
char s 
)

format an integer into ASCII with exactly two digits after the decimal point

Parameters
numbervalue * 100

Definition at line 62 of file NMEA_format.cpp.

References format_integer(), HEX, and s.

Referenced by format_PLARB(), format_PLARD(), format_PLARS(), format_PLARV(), and to_ascii_2_decimals().