fixed phy cell selection state update for the fail path

This commit is contained in:
Francisco Paisana 2020-10-16 11:27:51 +01:00
parent 665b3996bb
commit 0842ed9db1
1 changed files with 7 additions and 8 deletions

View File

@ -319,15 +319,14 @@ bool sync::cell_select_start(phy_cell_t new_cell)
{
std::unique_lock<std::mutex> ul(rrc_mutex);
bool ret = false;
if (rrc_proc_state != PROC_SELECT_START) {
Error("Cell Select: Can't run procedure. Must call cell_select_init() first (%d)\n", (uint32_t)rrc_proc_state);
return false;
goto clean_exit;
}
rrc_proc_state = PROC_SELECT_RUNNING;
bool ret = false;
sfn_p.reset();
search_p.reset();
srslte_ue_sync_reset(&ue_sync);
@ -336,7 +335,7 @@ bool sync::cell_select_start(phy_cell_t new_cell)
cell.id = new_cell.pci;
if (not set_cell(new_cell.cfo_hz)) {
Error("Cell Select: Reconfiguring cell\n");
return false;
goto clean_exit;
}
/* Select new frequency if necessary */
@ -346,7 +345,7 @@ bool sync::cell_select_start(phy_cell_t new_cell)
Info("Cell Select: Setting new frequency EARFCN=%d\n", new_cell.earfcn);
if (!set_frequency()) {
Error("Cell Select: Setting new frequency EARFCN=%d\n", new_cell.earfcn);
return false;
goto clean_exit;
}
}
@ -369,8 +368,8 @@ bool sync::cell_select_start(phy_cell_t new_cell)
Info("Cell Select: Could not synchronize SFN\n");
}
clean_exit:
rrc_proc_state = PROC_IDLE;
return ret;
}