From ce14845bbb73896944e923b676d718254dbefb4e Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 14 Nov 2023 14:32:19 +0100 Subject: [PATCH] Fix validation of GPS navigation data (fix due to @tractoan). Closes: #737 --- docs/CHANGELOG.md | 1 + src/core/system_parameters/gps_navigation_message.cc | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 930a5c59c..b17d9b6f7 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -65,6 +65,7 @@ All notable changes to GNSS-SDR will be documented in this file. signal). - The estimated CN0 value is now printed in the terminal when navigation data is succesfully decoded. +- Fixed GPS navigation message satellite validation. ## [GNSS-SDR v0.0.18](https://github.com/gnss-sdr/gnss-sdr/releases/tag/v0.0.18) - 2023-04-06 diff --git a/src/core/system_parameters/gps_navigation_message.cc b/src/core/system_parameters/gps_navigation_message.cc index b9a007a3f..d65520720 100644 --- a/src/core/system_parameters/gps_navigation_message.cc +++ b/src/core/system_parameters/gps_navigation_message.cc @@ -514,9 +514,9 @@ bool Gps_Navigation_Message::satellite_validation() // First Step: // check Issue Of Ephemeris Data (IODE IODC..) to find a possible interrupted reception // and check if the data have been filled (!=0) - if (d_TOW_SF1 != 0.0 and d_TOW_SF2 != 0.0 and d_TOW_SF3 != 0.0) + if (d_TOW_SF1 != 0.0 && d_TOW_SF2 != 0.0 && d_TOW_SF3 != 0.0) { - if (d_IODE_SF2 == d_IODE_SF3 and d_IODC == d_IODE_SF2 and d_IODC != -1.0) + if (d_IODE_SF2 == d_IODE_SF3 && (d_IODC & 0xFF) == d_IODE_SF2 && d_IODE_SF2 != -1.0) { flag_data_valid = true; b_valid_ephemeris_set_flag = true;