From 43c47665f3f8a1b809d809d9f685b376edd40238 Mon Sep 17 00:00:00 2001 From: jgauchia Date: Tue, 22 Oct 2024 20:59:05 +0200 Subject: [PATCH] Add talker_id to array of satellite-specific information --- extras/doc/Data Model.md | 13 +++++++------ src/NMEAGPS.cpp | 6 ++++++ src/NMEAGPS.h | 1 + 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/extras/doc/Data Model.md b/extras/doc/Data Model.md index 2976e00..8ca2fa7 100644 --- a/extras/doc/Data Model.md +++ b/extras/doc/Data Model.md @@ -108,12 +108,13 @@ There is additional information that is not related to a fix. Instead, it conta * `gps.UTCus()`, the number of microseconds since the last received UTC time, calculated from `micros()` and `gps.UTCsecondStart`. * `gps.nmeaMessage`, the latest received message type. This is an ephemeral value, because multiple sentences are merged into one `fix` structure. If you only check this after a complete fix is received, you will only see the LAST_SENTENCE_IN_INTERVAL. * enum values NMEA_GLL, NMEA_GSA, NMEA_GST, NMEA_GSV, NMEA_RMC, NMEA_VTG or NMEA_ZDA - * `gps.satellies[]`, an array of satellite-specific information, where each element contains - * `gps.satellies[i].id`, satellite ID - * `gps.satellies[i].elevation`, satellite elevation in 0-90 integer degrees - * `gps.satellies[i].azimuth`, satellite azimuth in 0-359 integer degrees - * `gps.satellies[i].snr`, satellite signal-to-noise ratio in 0-99 integer dBHz - * `gps.satellies[i].tracked`, satellite being tracked flag, a boolean + * `gps.satellites[]`, an array of satellite-specific information, where each element contains + * `gps.satellites[i].id`, satellite ID + * `gps.satellites[i].elevation`, satellite elevation in 0-90 integer degrees + * `gps.satellites[i].azimuth`, satellite azimuth in 0-359 integer degrees + * `gps.satellites[i].snr`, satellite signal-to-noise ratio in 0-99 integer dBHz + * `gps.satellites[i].tracked`, satellite being tracked flag, a boolean + * `gps.satellites[i].talker_id[]`, GSV satellite talker ID, a two-character array (NULL-terminated) * `gps.sat_count`, the number of elements in the `gps.satellites[]` array * `gps.talker_id[]`, talker ID, a two-character array (not NUL-terminated) * `gps.mfr_id[]`, manufacturer ID, a three-character array (not NUL-terminated) diff --git a/src/NMEAGPS.cpp b/src/NMEAGPS.cpp index 8528e12..24a3219 100644 --- a/src/NMEAGPS.cpp +++ b/src/NMEAGPS.cpp @@ -861,6 +861,12 @@ bool NMEAGPS::parseGSV( char chr ) #endif if (sat_count < NMEAGPS_MAX_SATELLITES) { + + // GSV talker_id + satellites[sat_count].talker_id[0] = talker_id[0]; + satellites[sat_count].talker_id[1] = talker_id[1]; + satellites[sat_count].talker_id[2] = (char)'\0'; + if (fieldIndex >= 4) { switch (fieldIndex % 4) { diff --git a/src/NMEAGPS.h b/src/NMEAGPS.h index ec21fa1..0967f3d 100644 --- a/src/NMEAGPS.h +++ b/src/NMEAGPS.h @@ -250,6 +250,7 @@ class NMEAGPS uint16_t azimuth; // 0..359 deg uint8_t snr NEOGPS_BF(7); // 0..99 dBHz bool tracked NEOGPS_BF(1); + char talker_id[3]; // GSV Talker ID #endif } NEOGPS_PACKED;