fixed phy cell selection state update for the fail path

master
Francisco Paisana 4 years ago
parent 665b3996bb
commit 0842ed9db1

@ -319,15 +319,14 @@ bool sync::cell_select_start(phy_cell_t new_cell)
{ {
std::unique_lock<std::mutex> ul(rrc_mutex); std::unique_lock<std::mutex> ul(rrc_mutex);
bool ret = false;
if (rrc_proc_state != PROC_SELECT_START) { 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); 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; rrc_proc_state = PROC_SELECT_RUNNING;
bool ret = false;
sfn_p.reset(); sfn_p.reset();
search_p.reset(); search_p.reset();
srslte_ue_sync_reset(&ue_sync); 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; cell.id = new_cell.pci;
if (not set_cell(new_cell.cfo_hz)) { if (not set_cell(new_cell.cfo_hz)) {
Error("Cell Select: Reconfiguring cell\n"); Error("Cell Select: Reconfiguring cell\n");
return false; goto clean_exit;
} }
/* Select new frequency if necessary */ /* 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); Info("Cell Select: Setting new frequency EARFCN=%d\n", new_cell.earfcn);
if (!set_frequency()) { if (!set_frequency()) {
Error("Cell Select: Setting new frequency EARFCN=%d\n", new_cell.earfcn); 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"); Info("Cell Select: Could not synchronize SFN\n");
} }
clean_exit:
rrc_proc_state = PROC_IDLE; rrc_proc_state = PROC_IDLE;
return ret; return ret;
} }

Loading…
Cancel
Save