mirror of https://github.com/pvnis/srsRAN_4G.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
120 lines
3.1 KiB
C
120 lines
3.1 KiB
C
4 years ago
|
/**
|
||
5 years ago
|
*
|
||
4 years ago
|
* \section COPYRIGHT
|
||
5 years ago
|
*
|
||
4 years ago
|
* Copyright 2013-2021 Software Radio Systems Limited
|
||
5 years ago
|
*
|
||
4 years ago
|
* By using this file, you agree to the terms and conditions set
|
||
|
* forth in the LICENSE file which can be found at the top level of
|
||
|
* the distribution.
|
||
5 years ago
|
*
|
||
|
*/
|
||
|
|
||
5 years ago
|
/**
|
||
|
* @file radio_null.h
|
||
|
* @brief Dummy radio class
|
||
|
*/
|
||
5 years ago
|
|
||
4 years ago
|
#ifndef SRSRAN_RADIO_NULL_H
|
||
|
#define SRSRAN_RADIO_NULL_H
|
||
5 years ago
|
|
||
|
#include "radio_base.h"
|
||
4 years ago
|
#include "srsran/interfaces/radio_interfaces.h"
|
||
|
#include "srsran/phy/rf/rf.h"
|
||
|
#include "srsran/radio/radio.h"
|
||
|
#include "srsran/radio/radio_metrics.h"
|
||
5 years ago
|
|
||
4 years ago
|
namespace srsran {
|
||
5 years ago
|
|
||
5 years ago
|
class radio_null final : public radio_base, public radio_interface_phy
|
||
5 years ago
|
{
|
||
|
public:
|
||
5 years ago
|
~radio_null() final = default;
|
||
5 years ago
|
|
||
|
std::string get_type() override { return "null"; }
|
||
|
|
||
|
int init(const rf_args_t& args_, phy_interface_radio* phy_) override
|
||
|
{
|
||
4 years ago
|
logger.set_level(srslog::str_to_basic_level(args.log_level));
|
||
5 years ago
|
running = true;
|
||
|
|
||
4 years ago
|
return SRSRAN_SUCCESS;
|
||
5 years ago
|
}
|
||
|
|
||
|
void stop() override { running = false; }
|
||
|
|
||
|
bool get_metrics(rf_metrics_t* metrics) override
|
||
|
{
|
||
|
// do nothing
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
// radio_interface_phy
|
||
|
bool is_init() override { return running; }
|
||
|
void reset() override {}
|
||
|
bool is_continuous_tx() override { return false; }
|
||
|
bool tx(rf_buffer_interface& buffer, const rf_timestamp_interface& tx_time) override
|
||
|
{
|
||
4 years ago
|
logger.info("%s", __PRETTY_FUNCTION__);
|
||
5 years ago
|
return true;
|
||
|
}
|
||
|
|
||
4 years ago
|
void tx_end() override { logger.info("%s", __PRETTY_FUNCTION__); }
|
||
5 years ago
|
|
||
|
bool rx_now(rf_buffer_interface& buffer, rf_timestamp_interface& rxd_time) override
|
||
|
{
|
||
4 years ago
|
logger.info("%s", __PRETTY_FUNCTION__);
|
||
5 years ago
|
return true;
|
||
|
}
|
||
|
|
||
4 years ago
|
void set_rx_gain(const float& gain) override { logger.info("%s", __PRETTY_FUNCTION__); }
|
||
5 years ago
|
|
||
4 years ago
|
void set_rx_gain_th(const float& gain) override { logger.info("%s", __PRETTY_FUNCTION__); }
|
||
5 years ago
|
|
||
|
float get_rx_gain() override
|
||
|
{
|
||
4 years ago
|
logger.info("%s", __PRETTY_FUNCTION__);
|
||
5 years ago
|
return 0.0;
|
||
|
}
|
||
|
|
||
4 years ago
|
void set_tx_gain(const float& gain) override { logger.info("%s", __PRETTY_FUNCTION__); }
|
||
5 years ago
|
|
||
4 years ago
|
void set_tx_freq(const uint32_t& channel_idx, const double& freq) override { logger.info("%s", __PRETTY_FUNCTION__); }
|
||
5 years ago
|
|
||
4 years ago
|
void set_rx_freq(const uint32_t& channel_idx, const double& freq) override { logger.info("%s", __PRETTY_FUNCTION__); }
|
||
5 years ago
|
|
||
|
double get_freq_offset() override
|
||
|
{
|
||
4 years ago
|
logger.info("%s", __PRETTY_FUNCTION__);
|
||
5 years ago
|
return 0.0;
|
||
|
}
|
||
|
|
||
4 years ago
|
void set_tx_srate(const double& srate) override { logger.info("%s", __PRETTY_FUNCTION__); }
|
||
5 years ago
|
|
||
4 years ago
|
void set_rx_srate(const double& srate) override { logger.info("%s", __PRETTY_FUNCTION__); }
|
||
5 years ago
|
|
||
4 years ago
|
void set_channel_rx_offset(uint32_t ch, int32_t offset_samples) override { logger.info("%s", __PRETTY_FUNCTION__); }
|
||
5 years ago
|
|
||
4 years ago
|
srsran_rf_info_t* get_info() override
|
||
5 years ago
|
{
|
||
4 years ago
|
logger.info("%s", __PRETTY_FUNCTION__);
|
||
5 years ago
|
return nullptr;
|
||
|
}
|
||
|
|
||
|
bool get_is_start_of_burst() override { return true; }
|
||
|
|
||
4 years ago
|
void release_freq(const uint32_t& carrier_idx) override { logger.info("%s", __PRETTY_FUNCTION__); }
|
||
5 years ago
|
|
||
|
protected:
|
||
|
rf_args_t args = {};
|
||
|
|
||
4 years ago
|
srslog::basic_logger& logger = srslog::fetch_basic_logger("RF", false);
|
||
|
bool running = false;
|
||
5 years ago
|
|
||
4 years ago
|
srsran::rf_metrics_t rf_metrics = {};
|
||
5 years ago
|
phy_interface_radio* phy = nullptr;
|
||
|
};
|
||
4 years ago
|
} // namespace srsran
|
||
5 years ago
|
|
||
4 years ago
|
#endif // SRSRAN_RADIO_NULL_H
|