1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-13 11:40:33 +00:00

Code cleaning

This commit is contained in:
Carles Fernandez 2024-07-24 20:39:40 +02:00
parent 32100f5eb7
commit 8ff339671b
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
4 changed files with 21 additions and 16 deletions

View File

@ -452,7 +452,9 @@ void galileo_telemetry_decoder_gs::decode_INAV_word(float *page_part_symbols, in
d_inav_nav.get_osnma_adkd_0_12_nav_bits(), d_inav_nav.get_osnma_adkd_0_12_nav_bits(),
d_inav_nav.get_TOW5() - 25); d_inav_nav.get_TOW5() - 25);
this->message_port_pub(pmt::mp("OSNMA_from_TLM"), pmt::make_any(tmp_obj_osnma)); this->message_port_pub(pmt::mp("OSNMA_from_TLM"), pmt::make_any(tmp_obj_osnma));
DLOG(INFO) << "|---> Galileo OSNMA :: Sending Telemetry Decoder NavData (PRN_d=" << static_cast<int>(d_satellite.get_PRN()) << ", TOW=" << static_cast<int>(d_inav_nav.get_TOW5() - 25) << ")"; //: 0b" << d_inav_nav.get_osnma_adkd_0_12_nav_bits(); DLOG(INFO) << "|---> Galileo OSNMA :: Sending Telemetry Decoder NavData (PRN_d="
<< static_cast<int>(d_satellite.get_PRN())
<< ", TOW=" << static_cast<int>(d_inav_nav.get_TOW5() - 25) << ")"; //: 0b" << d_inav_nav.get_osnma_adkd_0_12_nav_bits();
d_inav_nav.reset_osnma_nav_bits_adkd0_12(); d_inav_nav.reset_osnma_nav_bits_adkd0_12();
} }
@ -465,7 +467,9 @@ void galileo_telemetry_decoder_gs::decode_INAV_word(float *page_part_symbols, in
d_inav_nav.get_osnma_adkd_4_nav_bits(), d_inav_nav.get_osnma_adkd_4_nav_bits(),
d_inav_nav.get_TOW6() - 5); d_inav_nav.get_TOW6() - 5);
this->message_port_pub(pmt::mp("OSNMA_from_TLM"), pmt::make_any(tmp_obj)); this->message_port_pub(pmt::mp("OSNMA_from_TLM"), pmt::make_any(tmp_obj));
DLOG(INFO) << "|---> Galileo OSNMA :: Sending Telemetry Decoder NavData (PRN_d=" << static_cast<int>(d_satellite.get_PRN()) << ", TOW=" << static_cast<int>(d_inav_nav.get_TOW6() - 5) << ")"; //: 0b" << d_inav_nav.get_osnma_adkd_4_nav_bits(); DLOG(INFO) << "|---> Galileo OSNMA :: Sending Telemetry Decoder NavData (PRN_d="
<< static_cast<int>(d_satellite.get_PRN())
<< ", TOW=" << static_cast<int>(d_inav_nav.get_TOW6() - 5) << ")"; //: 0b" << d_inav_nav.get_osnma_adkd_4_nav_bits();
d_inav_nav.reset_osnma_nav_bits_adkd4(); d_inav_nav.reset_osnma_nav_bits_adkd4();
} }

View File

@ -380,10 +380,6 @@ bool Galileo_Inav_Message::have_new_utc_model() // Check if we have a new utc d
// flag_almanac_4 tells if W10 available. // flag_almanac_4 tells if W10 available.
bool Galileo_Inav_Message::have_new_almanac() // Check if we have a new almanac data set stored in the galileo navigation class bool Galileo_Inav_Message::have_new_almanac() // Check if we have a new almanac data set stored in the galileo navigation class
{ {
// if(flag_almanac_4)
// {
// flag_adkd_4_complete = true;
// }
if ((flag_almanac_1 == true) and (flag_almanac_2 == true) and (flag_almanac_3 == true) and (flag_almanac_4 == true)) if ((flag_almanac_1 == true) and (flag_almanac_2 == true) and (flag_almanac_3 == true) and (flag_almanac_4 == true))
{ {
// All Almanac data have been received // All Almanac data have been received
@ -1451,7 +1447,6 @@ bool Galileo_Inav_Message::have_new_nma()
std::string Galileo_Inav_Message::get_osnma_adkd_4_nav_bits() std::string Galileo_Inav_Message::get_osnma_adkd_4_nav_bits()
{ {
nav_bits_adkd_4 = nav_bits_word_6 + nav_bits_word_10; nav_bits_adkd_4 = nav_bits_word_6 + nav_bits_word_10;
return nav_bits_adkd_4; return nav_bits_adkd_4;
} }

View File

@ -141,15 +141,21 @@ public:
* @brief Retrieves the OSNMA ADKD 4 NAV bits. Resets the string. * @brief Retrieves the OSNMA ADKD 4 NAV bits. Resets the string.
*/ */
std::string get_osnma_adkd_4_nav_bits(); std::string get_osnma_adkd_4_nav_bits();
/*
* @brief Resets the OSNMA ADKD 4 NAV bits.
*/
void reset_osnma_nav_bits_adkd4(); void reset_osnma_nav_bits_adkd4();
bool flag_adkd_4_complete{false};
/* /*
* @brief Retrieves the OSNMA ADKD 0/12 NAV bits. Resets the string. * @brief Retrieves the OSNMA ADKD 0/12 NAV bits. Resets the string.
*/ */
std::string get_osnma_adkd_0_12_nav_bits(); std::string get_osnma_adkd_0_12_nav_bits();
/*
* @brief Resets the OSNMA ADKD 0/12 NAV bits.
*/
void reset_osnma_nav_bits_adkd0_12(); void reset_osnma_nav_bits_adkd0_12();
bool flag_adkd_0_12_complete{false};
inline bool get_flag_CRC_test() const inline bool get_flag_CRC_test() const
{ {

View File

@ -225,7 +225,7 @@ bool Gnss_Crypto::verify_signature_ecdsa_p256(const std::vector<uint8_t>& messag
success = (ret >= 0); success = (ret >= 0);
if (success) if (success)
{ {
LOG(INFO) << "GnuTLS: OSNMA signature authenticated successfully"; DLOG(INFO) << "GnuTLS: OSNMA signature authenticated successfully";
} }
else else
{ {
@ -301,7 +301,7 @@ bool Gnss_Crypto::verify_signature_ecdsa_p256(const std::vector<uint8_t>& messag
if (verification == 1) if (verification == 1)
{ {
success = true; success = true;
LOG(INFO) << "OpenSSL: OSNMA signature authenticated successfully"; DLOG(INFO) << "OpenSSL: OSNMA signature authenticated successfully";
} }
else else
{ {
@ -320,7 +320,7 @@ bool Gnss_Crypto::verify_signature_ecdsa_p256(const std::vector<uint8_t>& messag
if (verification == 1) if (verification == 1)
{ {
success = true; success = true;
LOG(INFO) << "OpenSSL: OSNMA signature authenticated successfully"; DLOG(INFO) << "OpenSSL: OSNMA signature authenticated successfully";
} }
else if (verification == 0) else if (verification == 0)
{ {
@ -379,7 +379,7 @@ bool Gnss_Crypto::verify_signature_ecdsa_p521(const std::vector<uint8_t>& messag
if (ret >= 0) if (ret >= 0)
{ {
LOG(INFO) << "GnuTLS: OSNMA signature authenticated successfully"; DLOG(INFO) << "GnuTLS: OSNMA signature authenticated successfully";
success = true; success = true;
} }
else else
@ -428,7 +428,7 @@ bool Gnss_Crypto::verify_signature_ecdsa_p521(const std::vector<uint8_t>& messag
if (verification == 1) if (verification == 1)
{ {
LOG(INFO) << "OpenSSL: OSNMA signature authenticated successfully"; DLOG(INFO) << "OpenSSL: OSNMA signature authenticated successfully";
success = true; success = true;
} }
else if (verification == 0) else if (verification == 0)
@ -451,7 +451,7 @@ bool Gnss_Crypto::verify_signature_ecdsa_p521(const std::vector<uint8_t>& messag
ECDSA_SIG_free(ecdsa_sig); ECDSA_SIG_free(ecdsa_sig);
if (verification == 1) if (verification == 1)
{ {
LOG(INFO) << "OpenSSL: OSNMA signature authenticated successfully"; DLOG(INFO) << "OpenSSL: OSNMA signature authenticated successfully";
success = true; success = true;
} }
else if (verification == 0) else if (verification == 0)
@ -896,7 +896,7 @@ void Gnss_Crypto::set_public_key(const std::vector<uint8_t>& publicKey)
#endif // OpenSSL 1.x #endif // OpenSSL 1.x
EVP_PKEY_free(pkey); EVP_PKEY_free(pkey);
#endif #endif
LOG(INFO) << "OSNMA Public Key successfully set up."; DLOG(INFO) << "OSNMA Public Key successfully set up.";
} }