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;
} }
@ -399,7 +398,7 @@ void sync::run_sfn_sync_state()
log_h->error("Detected cell during SFN synchronization differs from configured cell. Cell reselection to " log_h->error("Detected cell during SFN synchronization differs from configured cell. Cell reselection to "
"cells with different MIB is not supported\n"); "cells with different MIB is not supported\n");
srslte::console("Detected cell during SFN synchronization differs from configured cell. Cell reselection " srslte::console("Detected cell during SFN synchronization differs from configured cell. Cell reselection "
"to cells with different MIB is not supported\n"); "to cells with different MIB is not supported\n");
phy_state.state_exit(false); phy_state.state_exit(false);
} }
stack->in_sync(); stack->in_sync();
@ -453,7 +452,7 @@ void sync::run_camping_in_sync_state(sf_worker* worker, srslte::rf_buffer_t& syn
log_h->error("Detected cell during SFN synchronization differs from configured cell. Cell " log_h->error("Detected cell during SFN synchronization differs from configured cell. Cell "
"reselection to cells with different MIB is not supported\n"); "reselection to cells with different MIB is not supported\n");
srslte::console("Detected cell during SFN synchronization differs from configured cell. Cell " srslte::console("Detected cell during SFN synchronization differs from configured cell. Cell "
"reselection to cells with different MIB is not supported\n"); "reselection to cells with different MIB is not supported\n");
} else { } else {
log_h->info("SFN resynchronized successfully\n"); log_h->info("SFN resynchronized successfully\n");
} }

Loading…
Cancel
Save