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.

71 lines
2.2 KiB
C

/*
* Copyright 2013-2020 Software Radio Systems Limited
*
* This file is part of srsLTE.
*
* 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.
*
* 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/.
*
*/
#ifndef SRSUE_DUMMY_CLASSES_H
#define SRSUE_DUMMY_CLASSES_H
#include "srslte/common/task_scheduler.h"
#include "srslte/interfaces/ue_interfaces.h"
namespace srsue {
class stack_test_dummy : public stack_interface_rrc
{
public:
stack_test_dummy() {}
srslte::tti_point get_current_tti() override
{
return srslte::tti_point{task_sched.get_timer_handler()->get_cur_time() % 10240};
}
// Testing utility functions
void run_tti()
{
// update clock and run internal tasks
task_sched.tic();
task_sched.run_pending_tasks();
}
// run pending tasks without updating timers
void run_pending_tasks() { task_sched.run_pending_tasks(); }
srslte::task_scheduler task_sched{512, 0, 100};
};
class rlc_dummy_interface : public rlc_interface_mac
{
public:
bool has_data(const uint32_t lcid) override { return false; }
uint32_t get_buffer_state(const uint32_t lcid) override { return 0; }
int read_pdu(uint32_t lcid, uint8_t* payload, uint32_t nof_bytes) override { return 0; }
void write_pdu(uint32_t lcid, uint8_t* payload, uint32_t nof_bytes) override {}
void write_pdu_bcch_bch(srslte::unique_byte_buffer_t payload) override {}
void write_pdu_bcch_dlsch(uint8_t* payload, uint32_t nof_bytes) override {}
void write_pdu_pcch(srslte::unique_byte_buffer_t payload) override {}
void write_pdu_mch(uint32_t lcid, uint8_t* payload, uint32_t nof_bytes) override {}
};
} // namespace srsue
#endif // SRSUE_DUMMY_CLASSES_H