From 602c533c01694ffcafa9a4bb21865fddaf083131 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 2 Jun 2023 13:42:24 +0200 Subject: [PATCH] Add debug info --- src/core/libs/osnma_msg_receiver.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/libs/osnma_msg_receiver.cc b/src/core/libs/osnma_msg_receiver.cc index b34186da2..61a18d740 100644 --- a/src/core/libs/osnma_msg_receiver.cc +++ b/src/core/libs/osnma_msg_receiver.cc @@ -136,6 +136,8 @@ void osnma_msg_receiver::read_dsm_header(uint8_t dsm_header) { d_osnma_data.d_dsm_header.dsm_id = get_dsm_id(dsm_header); d_osnma_data.d_dsm_header.dsm_block_id = get_dsm_block_id(dsm_header); // BID + LOG(WARNING) << "OSNMA: DSM_ID=" << static_cast(d_osnma_data.d_dsm_header.dsm_id); + LOG(WARNING) << "OSNMA: DSM_BID=" << static_cast(d_osnma_data.d_dsm_header.dsm_block_id); } @@ -173,9 +175,11 @@ void osnma_msg_receiver::read_dsm_block(const std::shared_ptr& osnma_ } d_number_of_blocks[d_osnma_data.d_dsm_header.dsm_id] = number_of_blocks; + LOG(WARNING) << "OSNMA: number_of_blocks=" << static_cast(number_of_blocks); if (number_of_blocks == 0) { // Something is wrong, start over + LOG(WARNING) << "OSNMA: Wrong number of blocks, start over"; d_dsm_message[d_osnma_data.d_dsm_header.dsm_id] = std::array{}; d_dsm_id_received[d_osnma_data.d_dsm_header.dsm_id] = std::array{}; } @@ -271,6 +275,7 @@ void osnma_msg_receiver::process_dsm_message(const std::vector& dsm_msg } uint16_t check_l_dk = 104 - std::ceil(1 + (((bytes_lk * 8) + l_ds_bits) / (104))); + LOG(WARNING) << "check_l_dk_bits=" << static_cast(check_l_dk); if (l_dk_bits != check_l_dk) { std::cout << "OSNMA: Failed length reading" << std::endl; @@ -344,6 +349,7 @@ void osnma_msg_receiver::process_dsm_message(const std::vector& dsm_msg uint32_t l_pd = l_dp - 130 - l_npk; uint32_t check_l_dp = 104 - std::ceil((1040 + l_npk * 8) / 104); + if (l_dp != check_l_dp) { std::cout << "OSNMA: Failed length reading" << std::endl;