diff --git a/minmea.c b/minmea.c index 8bbbc59..459c6ad 100644 --- a/minmea.c +++ b/minmea.c @@ -287,6 +287,8 @@ enum minmea_sentence_id minmea_sentence_id(const char *sentence) return MINMEA_SENTENCE_GGA; if (!strcmp(type+2, "GSA")) return MINMEA_SENTENCE_GSA; + if (!strcmp(type+2,"GST")) + return MINMEA_SENTENCE_GST; return MINMEA_UNKNOWN; } @@ -385,6 +387,29 @@ bool minmea_parse_gsa(struct minmea_sentence_gsa *frame, const char *sentence) return true; } +bool minmea_parse_gst(struct minmea_sentence_gst *frame, const char *sentence) +{ + // $GPGST,024603.00,3.2,6.6,4.7,47.3,5.8,5.6,22.0*58 + char type[6]; + + if (!minmea_scan(sentence, "tTfffffff", + type, + &frame->time, + &frame->RMS_deviation,&frame->RMS_deviation_scale, + &frame->semi_major_sd,&frame->semi_major_sd_scale, + &frame->semi_minor_sd,&frame->semi_minor_sd_scale, + &frame->semi_major_orientation,&frame->semi_major_orientation_scale, + &frame->lattitude_error_deviation,&frame->lattitude_error_deviation_scale, + &frame->longitude_error_deviation,&frame->longitude_error_deviation_scale, + &frame->altitude_error_deviation,&frame->altitude_error_deviation_scale)) + return false; + if (strcmp(type+2, "GST")) + return false; + + return true; +} + + int minmea_gettimeofday(struct timeval *tv, const struct minmea_date *date, const struct minmea_time *time) { if (date->year == -1 || time->hours == -1) diff --git a/minmea.h b/minmea.h index 1caa0b3..0e25ec6 100644 --- a/minmea.h +++ b/minmea.h @@ -29,6 +29,7 @@ enum minmea_sentence_id { MINMEA_SENTENCE_RMC, MINMEA_SENTENCE_GGA, MINMEA_SENTENCE_GSA, + MINMEA_SENTENCE_GST }; struct minmea_date { @@ -67,6 +68,17 @@ struct minmea_sentence_gga { int dgps_age; }; +struct minmea_sentence_gst { +struct minmea_time time; +int RMS_deviation, RMS_deviation_scale; +int semi_major_sd, semi_major_sd_scale; +int semi_minor_sd, semi_minor_sd_scale; +int semi_major_orientation, semi_major_orientation_scale; +int lattitude_error_deviation, lattitude_error_deviation_scale; +int longitude_error_deviation, longitude_error_deviation_scale; +int altitude_error_deviation, altitude_error_deviation_scale; +}; + enum minmea_gsa_mode { MINMEA_GPGSA_MODE_AUTO = 'A', MINMEA_GPGSA_MODE_FORCED = 'M', @@ -121,6 +133,7 @@ bool minmea_scan(const char *sentence, const char *format, ...); 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_gst(struct minmea_sentence_gst *frame, const char *sentence); /** * Convert GPS UTC date/time representation to a UNIX timestamp.