22#ifndef PROTOCORE_NMEA0183_H
23#define PROTOCORE_NMEA0183_H
27#if PROTOCORE_ENABLE_NMEA0183
32typedef struct Nmea0183
37 const char *fields[PROTOCORE_NMEA0183_MAX_FIELDS];
38 uint8_t field_len[PROTOCORE_NMEA0183_MAX_FIELDS];
42uint8_t protocore_nmea0183_checksum(
const char *s,
size_t len);
48size_t protocore_nmea0183_build(
char *buf,
size_t cap,
const char *body);
55embed_bool protocore_nmea0183_parse(
const char *s,
size_t len, Nmea0183 *out);
58embed_bool protocore_nmea0183_field_float(
const Nmea0183 *m, uint8_t idx,
float *out);
61embed_bool protocore_nmea0183_field_int(
const Nmea0183 *m, uint8_t idx,
long *out);
103embed_bool protocore_nmea0183_parse_gga(
const Nmea0183 *m, protocore_nmea_gga *out);
109embed_bool protocore_nmea0183_parse_rmc(
const Nmea0183 *m, protocore_nmea_rmc *out);
118 embed_bool snr_valid;
119} protocore_nmea_gsv_sat;
127 uint8_t sats_in_view;
129 protocore_nmea_gsv_sat sats[4];
136embed_bool protocore_nmea0183_parse_gsv(
const Nmea0183 *m, protocore_nmea_gsv *out);
149 uint8_t zone_minutes;
156embed_bool protocore_nmea0183_parse_zda(
const Nmea0183 *m, protocore_nmea_zda *out);
162 float course_true_deg;
163 float course_mag_deg;
173embed_bool protocore_nmea0183_parse_vtg(
const Nmea0183 *m, protocore_nmea_vtg *out);
192embed_bool protocore_nmea0183_parse_gsa(
const Nmea0183 *m, protocore_nmea_gsa *out);
197 float wind_angle_deg;
208embed_bool protocore_nmea0183_parse_mwv(
const Nmea0183 *m, protocore_nmea_mwv *out);
215 embed_bool has_range;
223embed_bool protocore_nmea0183_parse_dpt(
const Nmea0183 *m, protocore_nmea_dpt *out);
238embed_bool protocore_nmea0183_parse_hdg(
const Nmea0183 *m, protocore_nmea_hdg *out);
258embed_bool protocore_nmea0183_parse_gll(
const Nmea0183 *m, protocore_nmea_gll *out);
265 float heading_true_deg;
266 float heading_mag_deg;
275embed_bool protocore_nmea0183_parse_vhw(
const Nmea0183 *m, protocore_nmea_vhw *out);
281 float total_water_nm;
289embed_bool protocore_nmea0183_parse_vlw(
const Nmea0183 *m, protocore_nmea_vlw *out);