diff --git a/openrtx/include/state.h b/openrtx/include/state.h index 54a8793a..a570a856 100644 --- a/openrtx/include/state.h +++ b/openrtx/include/state.h @@ -51,6 +51,7 @@ typedef struct sat_t satellites[12]; // Details about satellites in view float latitude; // Latitude coordinates float longitude; // Longitude coordinates + float altitude; // Antenna altitude above mean sea level (geoid) in m float speed; // Ground speed in km/h float tmg_mag; // Course over ground, degrees, magnetic float tmg_true; // Course over ground, degrees, true diff --git a/openrtx/src/gps.c b/openrtx/src/gps.c index 8cd15c58..bfd3e8e2 100644 --- a/openrtx/src/gps.c +++ b/openrtx/src/gps.c @@ -51,6 +51,7 @@ void gps_taskFunc(char *line, int len, gps_t *state) if (minmea_parse_gga(&frame, line)) { state->fix_quality = frame.fix_quality; state->satellites_tracked = frame.satellites_tracked; + state->altitude = minmea_tofloat(&frame.altitude); } } break;