2020-11-26 01:25:22 -08:00
|
|
|
/**
|
2017-05-30 06:38:04 -07:00
|
|
|
*
|
2020-11-26 01:25:22 -08:00
|
|
|
* \section COPYRIGHT
|
2017-05-30 06:38:04 -07:00
|
|
|
*
|
2021-03-19 03:45:56 -07:00
|
|
|
* Copyright 2013-2021 Software Radio Systems Limited
|
2017-05-30 06:38:04 -07:00
|
|
|
*
|
2020-11-26 01:25:22 -08:00
|
|
|
* 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.
|
2017-05-30 06:38:04 -07:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2018-03-31 10:04:04 -07:00
|
|
|
#ifndef SRSUE_PROC_PHR_H
|
|
|
|
#define SRSUE_PROC_PHR_H
|
2017-05-30 06:38:04 -07:00
|
|
|
|
2021-03-19 03:45:56 -07:00
|
|
|
#include "srsran/common/task_scheduler.h"
|
|
|
|
#include "srsran/interfaces/ue_mac_interfaces.h"
|
|
|
|
#include "srsran/srslog/srslog.h"
|
2019-12-16 07:04:22 -08:00
|
|
|
#include <stdint.h>
|
2017-05-30 06:38:04 -07:00
|
|
|
|
|
|
|
/* Power headroom report procedure */
|
|
|
|
|
|
|
|
namespace srsue {
|
|
|
|
|
2021-02-25 12:47:28 -08:00
|
|
|
class phy_interface_mac_lte;
|
|
|
|
|
2021-03-19 03:45:56 -07:00
|
|
|
class phr_proc : public srsran::timer_callback
|
2017-05-30 06:38:04 -07:00
|
|
|
{
|
|
|
|
public:
|
2021-01-28 08:17:43 -08:00
|
|
|
explicit phr_proc(srslog::basic_logger& logger);
|
2021-03-19 03:45:56 -07:00
|
|
|
void init(phy_interface_mac_lte* phy_h, srsran::ext_task_sched_handle* task_sched_);
|
|
|
|
void set_config(srsran::phr_cfg_t& cfg);
|
2020-03-18 09:34:51 -07:00
|
|
|
void step();
|
2017-05-30 06:38:04 -07:00
|
|
|
void reset();
|
2019-10-21 10:00:49 -07:00
|
|
|
|
|
|
|
bool generate_phr_on_ul_grant(float* phr);
|
2019-04-23 01:53:11 -07:00
|
|
|
bool is_extended();
|
2017-05-30 06:38:04 -07:00
|
|
|
void timer_expired(uint32_t timer_id);
|
2017-09-19 08:51:35 -07:00
|
|
|
|
2020-10-07 06:06:33 -07:00
|
|
|
void start_periodic_timer();
|
2017-09-19 08:51:35 -07:00
|
|
|
|
2017-05-30 06:38:04 -07:00
|
|
|
private:
|
2019-10-21 10:00:49 -07:00
|
|
|
bool pathloss_changed();
|
2017-09-19 08:51:35 -07:00
|
|
|
|
2021-01-28 08:17:43 -08:00
|
|
|
srslog::basic_logger& logger;
|
2020-07-09 08:03:22 -07:00
|
|
|
phy_interface_mac_lte* phy_h;
|
2021-03-19 03:45:56 -07:00
|
|
|
srsran::ext_task_sched_handle* task_sched;
|
|
|
|
srsran::phr_cfg_t phr_cfg;
|
2020-07-09 08:03:22 -07:00
|
|
|
bool initiated;
|
|
|
|
int last_pathloss_db;
|
|
|
|
bool phr_is_triggered;
|
2017-09-19 08:51:35 -07:00
|
|
|
|
2021-03-19 03:45:56 -07:00
|
|
|
srsran::timer_handler::unique_timer timer_periodic;
|
|
|
|
srsran::timer_handler::unique_timer timer_prohibit;
|
2021-09-15 08:10:54 -07:00
|
|
|
|
|
|
|
std::mutex mutex;
|
2017-05-30 06:38:04 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace srsue
|
|
|
|
|
2018-03-31 10:04:04 -07:00
|
|
|
#endif // SRSUE_PROC_PHR_H
|