![]() |
Larus glider flight sensor system 3.9.2024
Software-In-The-Loop test and validation system
|
ASCII converters for NMEA string output. More...
Go to the source code of this file.
Macros | |
| #define | ANGLE_SCALE 1e-7f |
| #define | MPS_TO_NMPH 1.944f |
| #define | RAD_TO_DEGREE_10 572.958f |
| #define | RAD_TO_DEGREE 57.2958f |
| #define | METER_TO_FEET 3.2808f |
| #define | MPS_TO_KMPH 3.6f |
Functions | |
| char | hex4 (uint8_t data) |
| char * | NMEA_append_tail (char *p) |
| add end delimiter, evaluate and add checksum and add CR+LF | |
| char * | to_ascii_2_decimals (int32_t number, char *s) |
| char * | to_ascii_1_decimal (int32_t number, char *s) |
| void | angle_format (double angle, char posc, char negc, char *&p) |
| append an angle in ASCII into a NMEA string | |
| void | format_GNSS_timestamp (const coordinates_t &coordinates, char *&p) |
| void | format_RMC (const coordinates_t &coordinates, char *&p) |
| NMEA-format time, position, groundspeed, track data. | |
| void | format_GGA (const coordinates_t &coordinates, char *&p) |
| NMEA-format position report, sat number and GEO separation. | |
| void | format_PLARD (float density, char type, char *&p) |
| void | format_PLARB (float voltage, char *&p) |
| void | format_PLARA (float roll, float pitch, float yaw, char *&p) |
| void | format_PLARW (float wind_north, float wind_east, char windtype, char *&p) |
| format wind reporting NMEA sequence | |
| 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_PLARS (float value, PLARS_TYPES option, char *&p) |
| format setting NMEA for MacCready, Ballast, Bugs, QNH | |
| bool | NMEA_checksum (const char *line) |
| test a line for valid NMEA checksum | |
| void | format_NMEA_string_fast (const output_data_t &output_data, string_buffer_t &NMEA_buf, bool horizon_available) |
| this procedure formats all our NMEA sequences | |
| void | format_NMEA_string_slow (const output_data_t &output_data, string_buffer_t &NMEA_buf) |
| this procedure formats all our NMEA sequences | |
Variables | |
| ROM char | HEX [] ="0123456789ABCDEF" |
| ROM char | GPRMC [] ="$GPRMC," |
| ROM char | GPGGA [] ="$GPGGA," |
| ROM char | PLARD [] ="$PLARD," |
| ROM char | PLARB [] ="$PLARB," |
| ROM char | PLARA [] ="$PLARA," |
| ROM char | PLARW [] ="$PLARW," |
| ROM char | PLARV [] ="$PLARV," |
| ROM char | PLARS [] ="$PLARS,L," |
| ROM char | PLARS_MC [] ="MC," |
| ROM char | PLARS_BAL [] ="BAL," |
| ROM char | PLARS_BUGS [] ="BUGS," |
| ROM char | PLARS_QNH [] ="QNH," |
ASCII converters for NMEA string output.
<Larus Flight Sensor Firmware>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file NMEA_format.cpp.
Definition at line 29 of file NMEA_format.cpp.
Definition at line 33 of file NMEA_format.cpp.
Definition at line 34 of file NMEA_format.cpp.
Definition at line 30 of file NMEA_format.cpp.
Definition at line 32 of file NMEA_format.cpp.
Definition at line 31 of file NMEA_format.cpp.
append an angle in ASCII into a NMEA string
Definition at line 105 of file NMEA_format.cpp.
Referenced by format_GGA(), and format_RMC().
| void format_GGA | ( | const coordinates_t & | coordinates, |
| char *& | p | ||
| ) |
NMEA-format position report, sat number and GEO separation.
Definition at line 233 of file NMEA_format.cpp.
References angle_format(), append_string(), DOWN, format_GNSS_timestamp(), coordinates_t::geo_sep_dm, GPGGA, coordinates_t::latitude, coordinates_t::longitude, NMEA_append_tail(), coordinates_t::position, coordinates_t::sat_fix_type, coordinates_t::SATS_number, and to_ascii_1_decimal().
Referenced by format_NMEA_string_slow().
| void format_GNSS_timestamp | ( | const coordinates_t & | coordinates, |
| char *& | p | ||
| ) |
Definition at line 151 of file NMEA_format.cpp.
References coordinates_t::hour, coordinates_t::minute, and coordinates_t::second.
Referenced by format_GGA(), and format_RMC().
| void format_NMEA_string_fast | ( | const output_data_t & | output_data, |
| string_buffer_t & | NMEA_buf, | ||
| bool | horizon_available | ||
| ) |
this procedure formats all our NMEA sequences
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.
| 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.
Definition at line 302 of file NMEA_format.cpp.
References append_string(), NMEA_append_tail(), PLARA, RAD_TO_DEGREE_10, and to_ascii_1_decimal().
Referenced by format_NMEA_string_fast().
Definition at line 292 of file NMEA_format.cpp.
References append_string(), NMEA_append_tail(), PLARB, and to_ascii_2_decimals().
Referenced by format_NMEA_string_slow().
Definition at line 278 of file NMEA_format.cpp.
References append_string(), NMEA_append_tail(), PLARD, and to_ascii_2_decimals().
Referenced by format_NMEA_string_slow().
| void format_PLARS | ( | float | value, |
| PLARS_TYPES | option, | ||
| 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().
| 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 wind reporting NMEA sequence
Definition at line 323 of file NMEA_format.cpp.
References append_string(), ATAN2, format_integer(), MPS_TO_KMPH, NEGLECTABLE_WIND, NMEA_append_tail(), PLARW, RAD_TO_DEGREE, SQR, and SQRT.
Referenced by format_NMEA_string_fast(), and format_NMEA_string_slow().
| void format_RMC | ( | const coordinates_t & | coordinates, |
| char *& | p | ||
| ) |
NMEA-format time, position, groundspeed, track data.
Definition at line 174 of file NMEA_format.cpp.
References angle_format(), append_string(), coordinates_t::day, format_GNSS_timestamp(), GPRMC, coordinates_t::heading_motion, coordinates_t::latitude, coordinates_t::longitude, coordinates_t::month, MPS_TO_NMPH, NMEA_append_tail(), coordinates_t::sat_fix_type, coordinates_t::speed_motion, and coordinates_t::year.
Referenced by format_NMEA_string_slow().
Definition at line 39 of file NMEA_format.cpp.
References HEX.
Referenced by NMEA_append_tail(), and NMEA_checksum().
add end delimiter, evaluate and add checksum and add CR+LF
Definition at line 45 of file NMEA_format.cpp.
References assert, and hex4().
Referenced by format_GGA(), format_PLARA(), format_PLARB(), format_PLARD(), format_PLARS(), format_PLARV(), format_PLARW(), and format_RMC().
test a line for valid NMEA checksum
Definition at line 424 of file NMEA_format.cpp.
References hex4().
format an integer into ASCII with one decimal
| number | value * 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().
format an integer into ASCII with exactly two digits after the decimal point
| number | value * 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().
Definition at line 230 of file NMEA_format.cpp.
Referenced by format_GGA().
Definition at line 171 of file NMEA_format.cpp.
Referenced by format_RMC().
Definition at line 36 of file NMEA_format.cpp.
Referenced by hex4(), to_ascii_1_decimal(), and to_ascii_2_decimals().
Definition at line 300 of file NMEA_format.cpp.
Referenced by format_PLARA().
Definition at line 290 of file NMEA_format.cpp.
Referenced by format_PLARB().
Definition at line 276 of file NMEA_format.cpp.
Referenced by format_PLARD().
Definition at line 383 of file NMEA_format.cpp.
Referenced by format_PLARS().
Definition at line 385 of file NMEA_format.cpp.
Referenced by format_PLARS().
Definition at line 386 of file NMEA_format.cpp.
Referenced by format_PLARS().
Definition at line 384 of file NMEA_format.cpp.
Referenced by format_PLARS().
Definition at line 387 of file NMEA_format.cpp.
Referenced by format_PLARS().
Definition at line 356 of file NMEA_format.cpp.
Referenced by format_PLARV().
Definition at line 320 of file NMEA_format.cpp.
Referenced by format_PLARW().