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.

82 lines
2.4 KiB
C

/**
* Copyright 2013-2021 Software Radio Systems Limited
5 years ago
*
* This file is part of srsLTE.
5 years ago
*
* srsLTE is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* srsLTE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
5 years ago
*
* A copy of the GNU Affero General Public License can be found in
* the LICENSE file in the top-level directory of this distribution
* and at http://www.gnu.org/licenses/.
5 years ago
*
*/
#ifndef SRSUE_VNF_PHY_NR_H
#define SRSUE_VNF_PHY_NR_H
#include "srsenb/hdr/phy/phy_common.h"
#include "srsran/common/basic_vnf.h"
#include "srsran/interfaces/enb_metrics_interface.h"
#include "srsran/interfaces/radio_interfaces.h"
#include "srsran/interfaces/ue_interfaces.h"
#include "srsran/interfaces/ue_nr_interfaces.h"
#include "srsue/hdr/phy/ue_nr_phy_base.h"
5 years ago
namespace srsue {
class vnf_phy_nr : public srsue::ue_phy_base, public srsue::phy_interface_stack_nr
{
public:
vnf_phy_nr() = default;
5 years ago
~vnf_phy_nr();
int init(const srsue::phy_args_t& args, srsue::stack_interface_phy_nr* stack_);
4 years ago
int init(const srsue::phy_args_t& args_) override;
5 years ago
void set_earfcn(std::vector<uint32_t> earfcns);
4 years ago
void stop() override;
5 years ago
4 years ago
void wait_initialize() override;
void get_metrics(phy_metrics_t* m) override;
5 years ago
4 years ago
std::string get_type() override { return "vnf_nr"; };
5 years ago
4 years ago
void start_plot() override;
5 years ago
// RRC interface
bool set_config(const srsran::phy_cfg_nr_t& cfg) override;
5 years ago
// MAC interface
int tx_request(const tx_request_t& request) override;
int set_ul_grant(std::array<uint8_t, SRSRAN_RAR_UL_GRANT_NBITS>, uint16_t rnti, srsran_rnti_type_t rnti_type) override
{
return SRSRAN_SUCCESS;
};
4 years ago
void send_prach(const uint32_t preamble_idx,
const int prach_occasion,
const float target_power_dbm,
const float ta_base_sec = 0.0f) override{};
void sr_send(uint32_t sr_id) override;
5 years ago
private:
std::unique_ptr<srsran::srsran_basic_vnf> vnf;
5 years ago
srsue::stack_interface_phy_nr* stack = nullptr;
bool initialized = false;
};
} // namespace srsue
#endif // SRSUE_VNF_PHY_NR_H