From f6f58fd45e5c53adf65e58fedab4ddccf42fbc45 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 21 Sep 2024 07:39:24 +0200 Subject: [PATCH] Log ISM data --- .../system_parameters/galileo_inav_message.cc | 13 ++++++++++++- src/core/system_parameters/galileo_ism.cc | 17 ++++++++++++++--- src/core/system_parameters/galileo_ism.h | 4 +++- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/core/system_parameters/galileo_inav_message.cc b/src/core/system_parameters/galileo_inav_message.cc index 182e15027..1a609c396 100644 --- a/src/core/system_parameters/galileo_inav_message.cc +++ b/src/core/system_parameters/galileo_inav_message.cc @@ -1332,7 +1332,7 @@ int32_t Galileo_Inav_Message::page_jk_decoder(const char* data_jk) gal_ism.set_ism_service_level_id(ism_service_level_id); if (ism_constellation_id == 0) { - DLOG(INFO) << "I/NAV ARAIM Integrity Support Message in Test"; + LOG(INFO) << "I/NAV ARAIM Integrity Support Message in Test"; } if (ism_constellation_id == 1) { @@ -1348,6 +1348,17 @@ int32_t Galileo_Inav_Message::page_jk_decoder(const char* data_jk) gal_ism.set_ism_ure(read_octet_unsigned(data_jk_bits, ISM_URE_BIT)); gal_ism.set_ism_bnom(read_octet_unsigned(data_jk_bits, ISM_BNOM_BIT)); gal_ism.set_ism_Tvalidity(read_octet_unsigned(data_jk_bits, ISM_TVALIDITY_BIT)); + LOG(INFO) << "I/NAV ARAIM Integrity Support Message: " + << "WN_ISM=" << static_cast(gal_ism.get_WN_ISM()) << ", " + << "t0_ISM=" << static_cast(gal_ism.get_t0_ISM()) << ", " + << "Mask_MSB_ISM=" << static_cast(gal_ism.get_ism_mask_msb()) << ", " + << "Mask_ISM=" << gal_ism.get_mask_ISM() << ", " + << "Pconst=" << gal_ism.get_pconst_value() << ", " + << "Psat=" << gal_ism.get_psat_value() << ", " + << "URA=" << gal_ism.get_ura_m() << " [m], " + << "URE=" << gal_ism.get_ure_m() << " [m], " + << "Bnom=" << gal_ism.get_bnom_m() << " [m], " + << "Tvalidity=" << static_cast(gal_ism.get_Tvalidity_hours()) << " [h]"; } } } diff --git a/src/core/system_parameters/galileo_ism.cc b/src/core/system_parameters/galileo_ism.cc index a8847abfe..a2c308bb3 100644 --- a/src/core/system_parameters/galileo_ism.cc +++ b/src/core/system_parameters/galileo_ism.cc @@ -129,6 +129,12 @@ double Galileo_ISM::get_psat_value() const } +bool Galileo_ISM::get_ism_mask_msb() const +{ + return ism_mask_msb; +} + + float Galileo_ISM::get_ura_m() const { auto it = ISM_URA_MAP.find(this->ism_ura); @@ -151,6 +157,12 @@ float Galileo_ISM::get_ure_m() const } +uint32_t Galileo_ISM::get_mask_ISM() const +{ + return ism_mask; +} + + float Galileo_ISM::get_bnom_m() const { auto it = ISM_BNOM_MAP.find(this->ism_bnom); @@ -175,7 +187,7 @@ uint16_t Galileo_ISM::get_Tvalidity_hours() const bool Galileo_ISM::check_ism_crc(const std::bitset& bits) { - std::bitset<96> extracted; + std::bitset extracted; for (int32_t i = 0; i < GALILEO_ISM_CRC_DATA_BITS; ++i) { extracted[i] = bits[i + 32]; @@ -208,6 +220,5 @@ bool Galileo_ISM::check_ism_crc(const std::bitset& bits) uint32_t Galileo_ISM::compute_crc(const std::vector& data) { crc32_ism.process_bytes(data.data(), data.size()); - uint32_t result = crc32_ism.checksum(); - return result; + return crc32_ism.checksum(); } diff --git a/src/core/system_parameters/galileo_ism.h b/src/core/system_parameters/galileo_ism.h index 37a564de3..aa613f7b2 100644 --- a/src/core/system_parameters/galileo_ism.h +++ b/src/core/system_parameters/galileo_ism.h @@ -66,13 +66,15 @@ public: float get_ura_m() const; float get_ure_m() const; float get_bnom_m() const; + uint32_t get_mask_ISM() const; uint16_t get_WN_ISM() const; uint16_t get_t0_ISM() const; uint16_t get_Tvalidity_hours() const; + bool get_ism_mask_msb() const; private: - boost::crc_basic<32> crc32_ism; uint32_t compute_crc(const std::vector& data); + boost::crc_basic<32> crc32_ism; // ICD 2.1 Table 97 std::unordered_map ISM_PCONST_MAP = {