mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-11-17 23:55:15 +00:00
Fix reading of IONO and UTC data
This commit is contained in:
@@ -103,7 +103,7 @@ void Gps_Navigation_Message::reset()
|
||||
|
||||
// Ionosphere and UTC
|
||||
flag_iono_valid = false;
|
||||
flag_utc_model_valid = true;
|
||||
flag_utc_model_valid = false;
|
||||
d_alpha0 = 0;
|
||||
d_alpha1 = 0;
|
||||
d_alpha2 = 0;
|
||||
@@ -429,8 +429,7 @@ void Gps_Navigation_Message::satellitePosition(double transmitTime)
|
||||
int Gps_Navigation_Message::subframe_decoder(char *subframe)
|
||||
{
|
||||
int subframe_ID = 0;
|
||||
int SV_data_ID;
|
||||
int SV_page = 0;
|
||||
|
||||
//double tmp_TOW;
|
||||
|
||||
unsigned int gps_word;
|
||||
@@ -546,6 +545,8 @@ int Gps_Navigation_Message::subframe_decoder(char *subframe)
|
||||
break;
|
||||
|
||||
case 4: // --- It is subframe 4 ---------- Almanac, ionospheric model, UTC parameters, SV health (PRN: 25-32)
|
||||
int SV_data_ID;
|
||||
int SV_page;
|
||||
d_TOW_SF4 = static_cast<double>(read_navigation_unsigned(subframe_bits, TOW));
|
||||
d_TOW_SF4 = d_TOW_SF4 * 6;
|
||||
d_TOW = d_TOW_SF4 - 6; // Set transmission time
|
||||
@@ -554,13 +555,17 @@ int Gps_Navigation_Message::subframe_decoder(char *subframe)
|
||||
b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG);
|
||||
SV_data_ID = static_cast<int>(read_navigation_unsigned(subframe_bits, SV_DATA_ID));
|
||||
SV_page = static_cast<int>(read_navigation_unsigned(subframe_bits, SV_PAGE));
|
||||
if (SV_page > 24 && SV_page < 33) // Page 4 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110)
|
||||
{
|
||||
//! \TODO read almanac
|
||||
}
|
||||
|
||||
if (SV_page == 13)
|
||||
if (SV_page == 52) // Page 13 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110)
|
||||
{
|
||||
//! \TODO read Estimated Range Deviation (ERD) values
|
||||
}
|
||||
|
||||
if (SV_page == 18)
|
||||
if (SV_page == 56) // Page 18 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110)
|
||||
{
|
||||
// Page 18 - Ionospheric and UTC data
|
||||
d_alpha0 = static_cast<double>(read_navigation_signed(subframe_bits, ALPHA_0));
|
||||
@@ -593,8 +598,12 @@ int Gps_Navigation_Message::subframe_decoder(char *subframe)
|
||||
flag_iono_valid = true;
|
||||
flag_utc_model_valid = true;
|
||||
}
|
||||
if (SV_page == 57)
|
||||
{
|
||||
// Reserved
|
||||
}
|
||||
|
||||
if (SV_page == 25)
|
||||
if (SV_page == 63) // Page 25 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110)
|
||||
{
|
||||
// Page 25 Anti-Spoofing, SV config and almanac health (PRN: 25-32)
|
||||
//! \TODO Read Anti-Spoofing, SV config
|
||||
@@ -611,19 +620,21 @@ int Gps_Navigation_Message::subframe_decoder(char *subframe)
|
||||
break;
|
||||
|
||||
case 5://--- It is subframe 5 -----------------almanac health (PRN: 1-24) and Almanac reference week number and time.
|
||||
int SV_data_ID_5;
|
||||
int SV_page_5;
|
||||
d_TOW_SF5 = static_cast<double>(read_navigation_unsigned(subframe_bits, TOW));
|
||||
d_TOW_SF5 = d_TOW_SF5 * 6;
|
||||
d_TOW = d_TOW_SF5 - 6; // Set transmission time
|
||||
b_integrity_status_flag = read_navigation_bool(subframe_bits, INTEGRITY_STATUS_FLAG);
|
||||
b_alert_flag = read_navigation_bool(subframe_bits, ALERT_FLAG);
|
||||
b_antispoofing_flag = read_navigation_bool(subframe_bits, ANTI_SPOOFING_FLAG);
|
||||
SV_data_ID = static_cast<int>(read_navigation_unsigned(subframe_bits, SV_DATA_ID));
|
||||
SV_page = static_cast<int>(read_navigation_unsigned(subframe_bits, SV_PAGE));
|
||||
if (SV_page < 25)
|
||||
SV_data_ID_5 = static_cast<int>(read_navigation_unsigned(subframe_bits, SV_DATA_ID));
|
||||
SV_page_5 = static_cast<int>(read_navigation_unsigned(subframe_bits, SV_PAGE));
|
||||
if (SV_page_5 < 25)
|
||||
{
|
||||
//! \TODO read almanac
|
||||
}
|
||||
if (SV_page == 25)
|
||||
if (SV_page_5 == 51) // Page 25 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110)
|
||||
{
|
||||
d_Toa = static_cast<double>(read_navigation_unsigned(subframe_bits, T_OA));
|
||||
d_Toa = d_Toa * T_OA_LSB;
|
||||
@@ -809,7 +820,7 @@ Gps_Utc_Model Gps_Navigation_Message::get_utc_model()
|
||||
utc_model.i_DN = i_DN;
|
||||
utc_model.d_DeltaT_LSF = d_DeltaT_LSF;
|
||||
// warning: We clear flag_utc_model_valid in order to not re-send the same information to the ionospheric parameters queue
|
||||
d_DeltaT_LSF = false;
|
||||
flag_utc_model_valid = false;
|
||||
return utc_model;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user