TwiceAsNice
2019-02-18
|
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <errno.h>
#include <time.h>
#include <math.h>
Classes | |
struct | minmea_float |
struct | minmea_date |
struct | minmea_time |
struct | minmea_sentence_rmc |
struct | minmea_sentence_gga |
struct | minmea_sentence_gll |
struct | minmea_sentence_gst |
struct | minmea_sentence_gsa |
struct | minmea_sat_info |
struct | minmea_sentence_gsv |
struct | minmea_sentence_vtg |
struct | minmea_sentence_zda |
Macros | |
#define | MINMEA_MAX_LENGTH 80 |
Enumerations | |
enum | minmea_sentence_id { MINMEA_INVALID = -1, MINMEA_UNKNOWN = 0, MINMEA_SENTENCE_RMC, MINMEA_SENTENCE_GGA, MINMEA_SENTENCE_GSA, MINMEA_SENTENCE_GLL, MINMEA_SENTENCE_GST, MINMEA_SENTENCE_GSV, MINMEA_SENTENCE_VTG, MINMEA_SENTENCE_ZDA } |
enum | minmea_gll_status { MINMEA_GLL_STATUS_DATA_VALID = 'A', MINMEA_GLL_STATUS_DATA_NOT_VALID = 'V' } |
enum | minmea_faa_mode { MINMEA_FAA_MODE_AUTONOMOUS = 'A', MINMEA_FAA_MODE_DIFFERENTIAL = 'D', MINMEA_FAA_MODE_ESTIMATED = 'E', MINMEA_FAA_MODE_MANUAL = 'M', MINMEA_FAA_MODE_SIMULATED = 'S', MINMEA_FAA_MODE_NOT_VALID = 'N', MINMEA_FAA_MODE_PRECISE = 'P' } |
enum | minmea_gsa_mode { MINMEA_GPGSA_MODE_AUTO = 'A', MINMEA_GPGSA_MODE_FORCED = 'M' } |
enum | minmea_gsa_fix_type { MINMEA_GPGSA_FIX_NONE = 1, MINMEA_GPGSA_FIX_2D = 2, MINMEA_GPGSA_FIX_3D = 3 } |
Functions | |
uint8_t | minmea_checksum (const char *sentence) |
Calculate raw sentence checksum. More... | |
bool | minmea_check (const char *sentence, bool strict) |
Check sentence validity and checksum. More... | |
bool | minmea_talker_id (char talker[3], const char *sentence) |
Determine talker identifier. More... | |
enum minmea_sentence_id | minmea_sentence_id (const char *sentence, bool strict) |
Determine sentence identifier. More... | |
bool | minmea_scan (const char *sentence, const char *format,...) |
Scanf-like processor for NMEA sentences. More... | |
bool | minmea_parse_rmc (struct minmea_sentence_rmc *frame, const char *sentence) |
bool | minmea_parse_gga (struct minmea_sentence_gga *frame, const char *sentence) |
bool | minmea_parse_gsa (struct minmea_sentence_gsa *frame, const char *sentence) |
bool | minmea_parse_gll (struct minmea_sentence_gll *frame, const char *sentence) |
bool | minmea_parse_gst (struct minmea_sentence_gst *frame, const char *sentence) |
bool | minmea_parse_gsv (struct minmea_sentence_gsv *frame, const char *sentence) |
bool | minmea_parse_vtg (struct minmea_sentence_vtg *frame, const char *sentence) |
bool | minmea_parse_zda (struct minmea_sentence_zda *frame, const char *sentence) |
int | minmea_gettime (struct timespec *ts, const struct minmea_date *date, const struct minmea_time *time_) |
Convert GPS UTC date/time representation to a UNIX timestamp. More... | |
static int_least32_t | minmea_rescale (struct minmea_float *f, int_least32_t new_scale) |
Rescale a fixed-point value to a different scale. More... | |
static float | minmea_tofloat (struct minmea_float *f) |
Convert a fixed-point value to a floating-point value. More... | |
static float | minmea_tocoord (struct minmea_float *f) |
Convert a raw coordinate to a floating point DD.DDD... More... | |
#define MINMEA_MAX_LENGTH 80 |
enum minmea_faa_mode |
enum minmea_gll_status |
enum minmea_gsa_fix_type |
enum minmea_gsa_mode |
enum minmea_sentence_id |
Check sentence validity and checksum.
Returns true for valid sentences.
Calculate raw sentence checksum.
Does not check sentence integrity.
int minmea_gettime | ( | struct timespec * | ts, |
const struct minmea_date * | date, | ||
const struct minmea_time * | time_ | ||
) |
Convert GPS UTC date/time representation to a UNIX timestamp.
bool minmea_parse_gga | ( | struct minmea_sentence_gga * | frame, |
const char * | sentence | ||
) |
bool minmea_parse_gll | ( | struct minmea_sentence_gll * | frame, |
const char * | sentence | ||
) |
bool minmea_parse_gsa | ( | struct minmea_sentence_gsa * | frame, |
const char * | sentence | ||
) |
bool minmea_parse_gst | ( | struct minmea_sentence_gst * | frame, |
const char * | sentence | ||
) |
bool minmea_parse_gsv | ( | struct minmea_sentence_gsv * | frame, |
const char * | sentence | ||
) |
bool minmea_parse_rmc | ( | struct minmea_sentence_rmc * | frame, |
const char * | sentence | ||
) |
bool minmea_parse_vtg | ( | struct minmea_sentence_vtg * | frame, |
const char * | sentence | ||
) |
bool minmea_parse_zda | ( | struct minmea_sentence_zda * | frame, |
const char * | sentence | ||
) |
|
inlinestatic |
Rescale a fixed-point value to a different scale.
Rounds towards zero.
Scanf-like processor for NMEA sentences.
Supports the following formats: c - single character (char *) d - direction, returned as 1/-1, default 0 (int *) f - fractional, returned as value + scale (int *, int *) i - decimal, default zero (int *) s - string (char *) t - talker identifier and type (char *) T - date/time stamp (int *, int *, int *) Returns true on success. See library source code for details.
enum minmea_sentence_id minmea_sentence_id | ( | const char * | sentence, |
bool | strict | ||
) |
Determine sentence identifier.
|
inlinestatic |
Convert a raw coordinate to a floating point DD.DDD...
value. Returns NaN for "unknown" values.
|
inlinestatic |
Convert a fixed-point value to a floating-point value.
Returns NaN for "unknown" values.