|
|
@ -259,6 +259,7 @@ void phy::get_metrics(phy_metrics_t* m)
|
|
|
|
void phy::set_timeadv_rar(uint32_t ta_cmd)
|
|
|
|
void phy::set_timeadv_rar(uint32_t ta_cmd)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
n_ta = srslte_N_ta_new_rar(ta_cmd);
|
|
|
|
n_ta = srslte_N_ta_new_rar(ta_cmd);
|
|
|
|
|
|
|
|
n_ta += n_ta_base;
|
|
|
|
sfsync.set_time_adv_sec(((float)n_ta) * SRSLTE_LTE_TS);
|
|
|
|
sfsync.set_time_adv_sec(((float)n_ta) * SRSLTE_LTE_TS);
|
|
|
|
Info("PHY: Set TA RAR: ta_cmd: %d, n_ta: %d, ta_usec: %.1f\n", ta_cmd, n_ta, ((float)n_ta) * SRSLTE_LTE_TS * 1e6);
|
|
|
|
Info("PHY: Set TA RAR: ta_cmd: %d, n_ta: %d, ta_usec: %.1f\n", ta_cmd, n_ta, ((float)n_ta) * SRSLTE_LTE_TS * 1e6);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -339,10 +340,11 @@ float phy::get_pathloss_db()
|
|
|
|
return common.cur_pathloss;
|
|
|
|
return common.cur_pathloss;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void phy::prach_send(uint32_t preamble_idx, int allowed_subframe, float target_power_dbm)
|
|
|
|
void phy::prach_send(uint32_t preamble_idx, int allowed_subframe, float target_power_dbm, float ta_base_sec)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
n_ta = 0;
|
|
|
|
n_ta = 0; /* Reset Time aligment */
|
|
|
|
sfsync.set_time_adv_sec(0.0f);
|
|
|
|
n_ta_base = (uint32_t)roundf(ta_base_sec / SRSLTE_LTE_TS);
|
|
|
|
|
|
|
|
sfsync.set_time_adv_sec(ta_base_sec);
|
|
|
|
common.reset_radio();
|
|
|
|
common.reset_radio();
|
|
|
|
if (!prach_buffer.prepare_to_send(preamble_idx, allowed_subframe, target_power_dbm)) {
|
|
|
|
if (!prach_buffer.prepare_to_send(preamble_idx, allowed_subframe, target_power_dbm)) {
|
|
|
|
Error("Preparing PRACH to send\n");
|
|
|
|
Error("Preparing PRACH to send\n");
|
|
|
@ -370,6 +372,7 @@ void phy::reset()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Info("Resetting PHY\n");
|
|
|
|
Info("Resetting PHY\n");
|
|
|
|
n_ta = 0;
|
|
|
|
n_ta = 0;
|
|
|
|
|
|
|
|
n_ta_base = 0;
|
|
|
|
sfsync.set_time_adv_sec(0);
|
|
|
|
sfsync.set_time_adv_sec(0);
|
|
|
|
for (uint32_t i = 0; i < nof_workers; i++) {
|
|
|
|
for (uint32_t i = 0; i < nof_workers; i++) {
|
|
|
|
workers[i]->reset();
|
|
|
|
workers[i]->reset();
|
|
|
|