From 77c160285d63d82d05bf0d940e86bf2f7d8b6a3a Mon Sep 17 00:00:00 2001 From: cesaaargm Date: Thu, 1 Feb 2024 06:37:49 +0100 Subject: [PATCH] [TAS-111] time synch check: GST-UTC conversion before comparison Refactored the code to use Galileo_Utc_Model's GST_to_UTC_time function. --- src/core/libs/osnma_msg_receiver.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/libs/osnma_msg_receiver.cc b/src/core/libs/osnma_msg_receiver.cc index 66099e054..857ea7db7 100644 --- a/src/core/libs/osnma_msg_receiver.cc +++ b/src/core/libs/osnma_msg_receiver.cc @@ -122,8 +122,9 @@ void osnma_msg_receiver::msg_handler_osnma(const pmt::pmt_t& msg) // compare local time with OSNMA subframe time d_GST_SIS = nma_msg->TOW_sf0 + nma_msg->WN_sf0 * 604800; // TODO - unsure about this operation and of the -24 seconds,... + auto OSNMA_UTC_time = nma_msg->UtcModelData.GST_to_UTC_time(d_GST_SIS, nma_msg->WN_sf0); double_t T_L = 15; // TODO - to define the maximum allowed time difference between local time and OSNMA subframe time - if(abs(d_GST_SIS - d_receiver_time) <= T_L) + if(abs(OSNMA_UTC_time - d_receiver_time) <= T_L) { process_osnma_message(nma_msg); }