From 318afbd8b4f933f026764172ee2d295aa72468bf Mon Sep 17 00:00:00 2001 From: yagoda Date: Wed, 20 Dec 2017 15:07:00 +0000 Subject: [PATCH] minor fixes to phy logging --- lib/include/srslte/common/log.h | 4 ++-- lib/src/phy/common/phy_logger.c | 2 ++ srsue/src/phy/phch_worker.cc | 2 -- srsue/src/phy/phy.cc | 6 +----- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/include/srslte/common/log.h b/lib/include/srslte/common/log.h index 6508376e5..d4169f3e5 100644 --- a/lib/include/srslte/common/log.h +++ b/lib/include/srslte/common/log.h @@ -112,9 +112,9 @@ public: virtual void warning_line(std::string file, int line, std::string message, ...){error("warning_line not implemented.\n");} virtual void info_line(std::string file, int line, std::string message, ...){error("info_line not implemented.\n");} virtual void debug_line(std::string file, int line, std::string message, ...){error("debug_line not implemented.\n");} - std::string get_service_name() { return service_name; } -protected: +protected: + std::string get_service_name() { return service_name; } uint32_t tti; LOG_LEVEL_ENUM level; int hex_limit; diff --git a/lib/src/phy/common/phy_logger.c b/lib/src/phy/common/phy_logger.c index a2597961e..09393236a 100644 --- a/lib/src/phy/common/phy_logger.c +++ b/lib/src/phy/common/phy_logger.c @@ -31,6 +31,7 @@ #include #include #include +#include "srslte/srslte.h" #include "srslte/phy/common/phy_logger.h" /********************************************************************* Functions for external logging @@ -41,6 +42,7 @@ static void *callback_ctx = NULL; void srslte_phy_log_register_handler(void *ctx, phy_log_handler_t handler) { phy_log_handler = handler; callback_ctx = ctx; + handler_registered++; } void srslte_phy_log_print(phy_logger_level_t log_level, const char *format, ...) { diff --git a/srsue/src/phy/phch_worker.cc b/srsue/src/phy/phch_worker.cc index e196d58e1..cb2d68098 100644 --- a/srsue/src/phy/phch_worker.cc +++ b/srsue/src/phy/phch_worker.cc @@ -174,8 +174,6 @@ void phch_worker::set_tti(uint32_t tti_, uint32_t tx_tti_) tti = tti_; tx_tti = tx_tti_; log_h->step(tti); - printf("tti\n"); - printf("out : %s", log_phy_lib_h->get_service_name()); log_phy_lib_h->step(tti); diff --git a/srsue/src/phy/phy.cc b/srsue/src/phy/phy.cc index 4a8f99d44..da46982a2 100644 --- a/srsue/src/phy/phy.cc +++ b/srsue/src/phy/phy.cc @@ -130,9 +130,7 @@ bool phy::init(srslte::radio_multi* radio_handler, mac_interface_phy *mac, rrc_i this->radio_handler = radio_handler; this->mac = mac; this->rrc = rrc; - - - + if (!phy_args) { args = &default_args; set_default_args(args); @@ -145,11 +143,9 @@ bool phy::init(srslte::radio_multi* radio_handler, mac_interface_phy *mac, rrc_i } nof_workers = args->nof_phy_threads; - this->log_phy_lib_h = (srslte::log*) log_vec[nof_workers]; srslte_phy_log_register_handler(this, srslte_phy_handler); - initiated = false; start(); return true;