From 6aee1b8bb70049c6e25fe7745e83598e1a397dcd Mon Sep 17 00:00:00 2001 From: mek_x Date: Wed, 23 Apr 2014 23:43:58 +0200 Subject: [PATCH] example.c: added example for gsv parsing --- example.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/example.c b/example.c index e973814..5a6f48e 100644 --- a/example.c +++ b/example.c @@ -43,6 +43,20 @@ int main() } } break; + case MINMEA_SENTENCE_GSV: { + struct minmea_sentence_gsv frame; + if (minmea_parse_gsv(&frame, line)) { + printf("$GPGSV: message %d of %d\n", frame.msg_nr, frame.total_msgs); + printf("$GPGSV: sattelites in view: %d\n", frame.total_sats); + for (int i = 0; i < 4; i++) + printf("$GPGSV: sat nr %d, elevation: %d, azimuth: %d, snr: %d dbm\n", + frame.sats[i].nr, + frame.sats[i].elevation, + frame.sats[i].azimuth, + frame.sats[i].snr); + } + } break; + default: { } break; }