From 29f43b72c5d1499a5ecfdd200705f230d9790a4c Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 23 May 2023 12:45:36 +0200 Subject: [PATCH] Fix shift direction --- .../gnuradio_blocks/galileo_telemetry_decoder_gs.cc | 4 ++-- src/core/libs/osnma_msg_receiver.cc | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc index e041d2c99..fedef7456 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc @@ -512,7 +512,7 @@ void galileo_telemetry_decoder_gs::decode_INAV_word(float *page_part_symbols, in { const std::shared_ptr tmp_obj = std::make_shared(d_inav_nav.get_osnma_msg()); this->message_port_pub(pmt::mp("OSNMA_from_TLM"), pmt::make_any(tmp_obj)); - uint8_t nma_status = (tmp_obj->hkroot[0] & 0b11000000) << 6; + uint8_t nma_status = (tmp_obj->hkroot[0] & 0b11000000) >> 6; std::string nma_status_string; if (nma_status == 0) { @@ -526,7 +526,7 @@ void galileo_telemetry_decoder_gs::decode_INAV_word(float *page_part_symbols, in { nma_status_string = std::string("(Operational mode)"); } - else if (nma_status == 3) + else { nma_status_string = std::string("(Do not use mode)"); } diff --git a/src/core/libs/osnma_msg_receiver.cc b/src/core/libs/osnma_msg_receiver.cc index 79ebcc48d..e26dc51f8 100644 --- a/src/core/libs/osnma_msg_receiver.cc +++ b/src/core/libs/osnma_msg_receiver.cc @@ -110,15 +110,15 @@ void osnma_msg_receiver::process_osnma_message(const OSNMA_msg& osnma_msg) void osnma_msg_receiver::read_nma_header(uint8_t nma_header) { - d_osnma_data.d_nma_header.nmas = (nma_header & 0b11000000) << 6; - d_osnma_data.d_nma_header.cid = (nma_header & 0b00110000) << 4; - d_osnma_data.d_nma_header.cpks = (nma_header & 0b00001110) << 1; + d_osnma_data.d_nma_header.nmas = (nma_header & 0b11000000) >> 6; + d_osnma_data.d_nma_header.cid = (nma_header & 0b00110000) >> 4; + d_osnma_data.d_nma_header.cpks = (nma_header & 0b00001110) >> 1; d_osnma_data.d_nma_header.reserved = ((nma_header & 0b00000001) ? true : false); } void osnma_msg_receiver::read_dsm_header(uint8_t dsm_header) { - d_osnma_data.d_dsm_header.dsm_id = (dsm_header & 0b11110000) << 4; + d_osnma_data.d_dsm_header.dsm_id = (dsm_header & 0b11110000) >> 4; d_osnma_data.d_dsm_header.dsm_block_id = dsm_header & 0b00001111; } \ No newline at end of file