fix comments and other minor issues

master
Francisco Paisana 4 years ago
parent 468389997e
commit b68ef69ab4

@ -1,5 +1,5 @@
/* /*
* Copyright 2013-2019 Software Radio Systems Limited * Copyright 2013-2020 Software Radio Systems Limited
* *
* This file is part of srsLTE. * This file is part of srsLTE.
* *
@ -19,10 +19,10 @@
* *
*/ */
/****************************************************************************** /**
* File: radio_base.h * @file radio_base.h
* Description: Base class for all eNB/UE radios. * @brief Base class for all eNB/UE radios.
*****************************************************************************/ */
#ifndef SRSLTE_RADIO_BASE_H #ifndef SRSLTE_RADIO_BASE_H
#define SRSLTE_RADIO_BASE_H #define SRSLTE_RADIO_BASE_H

@ -1,5 +1,5 @@
/* /*
* Copyright 2013-2019 Software Radio Systems Limited * Copyright 2013-2020 Software Radio Systems Limited
* *
* This file is part of srsLTE. * This file is part of srsLTE.
* *
@ -19,16 +19,17 @@
* *
*/ */
/****************************************************************************** /**
* File: radio_null.h * @file radio_null.h
* Description: Dummy radio class * @brief Dummy radio class
*****************************************************************************/ */
#ifndef SRSLTE_RADIO_NULL_H #ifndef SRSLTE_RADIO_NULL_H
#define SRSLTE_RADIO_NULL_H #define SRSLTE_RADIO_NULL_H
#include "radio_base.h" #include "radio_base.h"
#include "srslte/common/logger.h" #include "srslte/common/logger.h"
#include "srslte/common/logmap.h"
#include "srslte/interfaces/radio_interfaces.h" #include "srslte/interfaces/radio_interfaces.h"
#include "srslte/phy/rf/rf.h" #include "srslte/phy/rf/rf.h"
#include "srslte/radio/radio.h" #include "srslte/radio/radio.h"
@ -36,19 +37,17 @@
namespace srslte { namespace srslte {
class radio_null : public radio_base, public radio_interface_phy class radio_null final : public radio_base, public radio_interface_phy
{ {
public: public:
explicit radio_null(srslte::logger* logger_); explicit radio_null(srslte::logger* logger_);
~radio_null() = default; ~radio_null() final = default;
std::string get_type() override { return "null"; } std::string get_type() override { return "null"; }
int init(const rf_args_t& args_, phy_interface_radio* phy_) override int init(const rf_args_t& args_, phy_interface_radio* phy_) override
{ {
log.init("RF ", logger); log->set_level(args.log_level);
log.set_level(args.log_level);
running = true; running = true;
return SRSLTE_SUCCESS; return SRSLTE_SUCCESS;
@ -68,62 +67,63 @@ public:
bool is_continuous_tx() override { return false; } bool is_continuous_tx() override { return false; }
bool tx(rf_buffer_interface& buffer, const rf_timestamp_interface& tx_time) override bool tx(rf_buffer_interface& buffer, const rf_timestamp_interface& tx_time) override
{ {
log.info("%s\n", __PRETTY_FUNCTION__); log->info("%s\n", __PRETTY_FUNCTION__);
return true; return true;
} }
void tx_end() override { log.info("%s\n", __PRETTY_FUNCTION__); } void tx_end() override { log->info("%s\n", __PRETTY_FUNCTION__); }
bool rx_now(rf_buffer_interface& buffer, rf_timestamp_interface& rxd_time) override bool rx_now(rf_buffer_interface& buffer, rf_timestamp_interface& rxd_time) override
{ {
log.info("%s\n", __PRETTY_FUNCTION__); log->info("%s\n", __PRETTY_FUNCTION__);
return true; return true;
} }
void set_rx_gain(const float& gain) override { log.info("%s\n", __PRETTY_FUNCTION__); } void set_rx_gain(const float& gain) override { log->info("%s\n", __PRETTY_FUNCTION__); }
void set_rx_gain_th(const float& gain) override { log.info("%s\n", __PRETTY_FUNCTION__); } void set_rx_gain_th(const float& gain) override { log->info("%s\n", __PRETTY_FUNCTION__); }
float get_rx_gain() override float get_rx_gain() override
{ {
log.info("%s\n", __PRETTY_FUNCTION__); log->info("%s\n", __PRETTY_FUNCTION__);
return 0.0; return 0.0;
} }
void set_tx_gain(const float& gain) override { log.info("%s\n", __PRETTY_FUNCTION__); } void set_tx_gain(const float& gain) override { log->info("%s\n", __PRETTY_FUNCTION__); }
void set_tx_freq(const uint32_t& channel_idx, const double& freq) override { log.info("%s\n", __PRETTY_FUNCTION__); } void set_tx_freq(const uint32_t& channel_idx, const double& freq) override { log->info("%s\n", __PRETTY_FUNCTION__); }
void set_rx_freq(const uint32_t& channel_idx, const double& freq) override { log.info("%s\n", __PRETTY_FUNCTION__); } void set_rx_freq(const uint32_t& channel_idx, const double& freq) override { log->info("%s\n", __PRETTY_FUNCTION__); }
double get_freq_offset() override double get_freq_offset() override
{ {
log.info("%s\n", __PRETTY_FUNCTION__); log->info("%s\n", __PRETTY_FUNCTION__);
return 0.0; return 0.0;
} }
void set_tx_srate(const double& srate) override { log.info("%s\n", __PRETTY_FUNCTION__); } void set_tx_srate(const double& srate) override { log->info("%s\n", __PRETTY_FUNCTION__); }
void set_rx_srate(const double& srate) override { log->info("%s\n", __PRETTY_FUNCTION__); }
void set_rx_srate(const double& srate) override { log.info("%s\n", __PRETTY_FUNCTION__); } void set_channel_rx_offset(uint32_t ch, int32_t offset_samples) override { log->info("%s\n", __PRETTY_FUNCTION__); }
srslte_rf_info_t* get_info() override srslte_rf_info_t* get_info() override
{ {
log.info("%s\n", __PRETTY_FUNCTION__); log->info("%s\n", __PRETTY_FUNCTION__);
return nullptr; return nullptr;
} }
bool get_is_start_of_burst() override { return true; } bool get_is_start_of_burst() override { return true; }
void release_freq(const uint32_t& carrier_idx) override { log.info("%s\n", __PRETTY_FUNCTION__); } void release_freq(const uint32_t& carrier_idx) override { log->info("%s\n", __PRETTY_FUNCTION__); }
void set_channel_rx_offset(uint32_t ch, int32_t offset_samples) override { log.info("%s\n", __PRETTY_FUNCTION__); } void set_channel_rx_offset(uint32_t ch, int32_t offset_samples) override { log.info("%s\n", __PRETTY_FUNCTION__); }
protected: protected:
rf_args_t args = {}; rf_args_t args = {};
srslte::logger* logger = nullptr; srslte::log_ref log;
srslte::log_filter log; bool running = false;
bool running = false;
srslte::rf_metrics_t rf_metrics = {}; srslte::rf_metrics_t rf_metrics = {};
phy_interface_radio* phy = nullptr; phy_interface_radio* phy = nullptr;

@ -1,5 +1,5 @@
/* /*
* Copyright 2013-2019 Software Radio Systems Limited * Copyright 2013-2020 Software Radio Systems Limited
* *
* This file is part of srsLTE. * This file is part of srsLTE.
* *
@ -24,6 +24,6 @@
namespace srslte { namespace srslte {
radio_null::radio_null(srslte::logger* logger_) : logger(logger_), radio_base(logger_) {} radio_null::radio_null(srslte::logger* logger_) : log("RF"), radio_base(logger_) {}
} // namespace srslte } // namespace srslte

@ -67,6 +67,7 @@ void parse_args(all_args_t* args, int argc, char* argv[])
bpo::options_description common("Configuration options"); bpo::options_description common("Configuration options");
common.add_options() common.add_options()
("enb.stack", bpo::value<string>(&args->stack.type)->default_value("lte"), "Type of the upper stack [lte, nr]")
("enb.enb_id", bpo::value<string>(&enb_id)->default_value("0x0"), "eNodeB ID") ("enb.enb_id", bpo::value<string>(&enb_id)->default_value("0x0"), "eNodeB ID")
("enb.name", bpo::value<string>(&args->stack.s1ap.enb_name)->default_value("srsenb01"), "eNodeB Name") ("enb.name", bpo::value<string>(&args->stack.s1ap.enb_name)->default_value("srsenb01"), "eNodeB Name")
("enb.mcc", bpo::value<string>(&mcc)->default_value("001"), "Mobile Country Code") ("enb.mcc", bpo::value<string>(&mcc)->default_value("001"), "Mobile Country Code")
@ -199,7 +200,6 @@ void parse_args(all_args_t* args, int argc, char* argv[])
("embms.mcs", bpo::value<uint16_t>(&args->stack.embms.mcs)->default_value(20), "Modulation and Coding scheme of MBMS traffic.") ("embms.mcs", bpo::value<uint16_t>(&args->stack.embms.mcs)->default_value(20), "Modulation and Coding scheme of MBMS traffic.")
// NR section // NR section
("enb.stack", bpo::value<string>(&args->stack.type)->default_value("lte"), "Type of the upper stack [lte]")
("scheduler.tb_len", bpo::value<int>(&args->stack.mac.nr_tb_size)->default_value(1520), "Default TB size") ("scheduler.tb_len", bpo::value<int>(&args->stack.mac.nr_tb_size)->default_value(1520), "Default TB size")
// VNF params // VNF params

Loading…
Cancel
Save