diff options
Diffstat (limited to 'src/common/src/GPS/minmea.c')
-rw-r--r-- | src/common/src/GPS/minmea.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/common/src/GPS/minmea.c b/src/common/src/GPS/minmea.c index 8700725..4d4aeb8 100644 --- a/src/common/src/GPS/minmea.c +++ b/src/common/src/GPS/minmea.c @@ -367,6 +367,8 @@ enum minmea_sentence_id minmea_sentence_id(const char *sentence, bool strict) return MINMEA_SENTENCE_GST; if (!strcmp(type+2, "GSV")) return MINMEA_SENTENCE_GSV; + if (!strcmp(type+2, "TXT")) + return MINMEA_SENTENCE_TXT; return MINMEA_UNKNOWN; } @@ -545,6 +547,29 @@ bool minmea_parse_gsv(struct minmea_sentence_gsv *frame, const char *sentence) return true; } +bool minmea_parse_txt(struct minmea_sentence_txt *frame, const char *sentence) +{ + // Example + // $GPTXT,01,01,02,u-blox ag - www.u-blox.com*50 + char type[6]; + + if (!minmea_scan(sentence, "tiii", + type, + &frame->num_msg, + &frame->msg_num, + &frame->msgtype)) { + return false; + } + if (strcmp(type+2, "TXT")) { + return false; + } + + frame->text = sentence + MINMEA_TXT_START_IX; + frame->text_len = strlen(sentence) - MINMEA_TXT_START_IX - 5; + + return true; +} + int minmea_gettime(struct timespec *ts, const struct minmea_date *date, const struct minmea_time *time_) { if (date->year == -1 || time_->hours == -1) |