during cell search don't configure found cell as serving cell

this fixes an issue in which, during cell search, the sync code
itself would set the serving cell whenever it found a new cell.

instead, only report the found cell to RRC and keep the sample
rate at 1.92 MHz. RRC may select a new serving cell and then tell
PHY to camp on it.
master
Andre Puschmann 5 years ago
parent ca54f02b87
commit 2a46413121

@ -759,7 +759,6 @@ int srslte_ue_sync_zerocopy(srslte_ue_sync_t* q, cf_t* input_buffer[SRSLTE_MAX_P
n = srslte_sync_find(&q->sfind, input_buffer[0], 0, &q->peak_idx);
switch (n) {
case SRSLTE_SYNC_ERROR:
ret = SRSLTE_ERROR;
ERROR("Error finding correlation peak (%d)\n", ret);
return SRSLTE_ERROR;
case SRSLTE_SYNC_FOUND:

@ -231,30 +231,12 @@ phy_interface_rrc_lte::cell_search_ret_t sync::cell_search(phy_interface_rrc_lte
// Check return state
switch (cell_search_ret) {
case search::CELL_FOUND:
// If a cell is found, configure it, synchronize and measure it
if (set_cell()) {
// Reconfigure first intra-frequency measurement
intra_freq_meas[0]->set_primary_cell(current_earfcn, cell);
Info("Cell Search: Setting sampling rate and synchronizing SFN...\n");
set_sampling_rate();
phy_state.run_sfn_sync();
if (phy_state.is_camping()) {
log_h->info("Cell Search: Sync OK. Camping on cell PCI=%d\n", cell.id);
log_h->info("Cell Search: Found cell with PCI=%d with %d PRB\n", cell.id, cell.nof_prb);
if (found_cell) {
found_cell->earfcn = current_earfcn;
found_cell->pci = cell.id;
}
ret.found = phy_interface_rrc_lte::cell_search_ret_t::CELL_FOUND;
} else {
log_h->info("Cell Search: Could not synchronize with cell\n");
ret.found = phy_interface_rrc_lte::cell_search_ret_t::CELL_NOT_FOUND;
}
} else {
Error("Cell Search: Setting cell PCI=%d, nof_prb=%d\n", cell.id, cell.nof_prb);
}
break;
case search::CELL_NOT_FOUND:
Info("Cell Search: No cell found in this frequency\n");
@ -294,7 +276,7 @@ bool sync::cell_select(phy_interface_rrc_lte::phy_cell_t* new_cell)
Info("Cell Select: Starting cell resynchronization\n");
} else {
if (!srslte_cellid_isvalid(new_cell->pci)) {
log_h->error("Cell Select: Invalid cell_id=%d\n", cell.id);
log_h->error("Cell Select: Invalid cell_id=%d\n", new_cell->pci);
return ret;
}
Info("Cell Select: Starting cell selection for PCI=%d, EARFCN=%d\n", new_cell->pci, new_cell->earfcn);
@ -317,14 +299,11 @@ bool sync::cell_select(phy_interface_rrc_lte::phy_cell_t* new_cell)
/* Reconfigure cell if necessary */
if (new_cell) {
if (new_cell->pci != cell.id) {
Info("Cell Select: Reconfiguring cell ID\n");
cell.id = new_cell->pci;
if (!set_cell()) {
Error("Cell Select: Reconfiguring cell\n");
return ret;
}
}
/* Select new frequency if necessary */
if ((int)new_cell->earfcn != current_earfcn) {
@ -821,7 +800,6 @@ void sync::set_ue_sync_opts(srslte_ue_sync_t* q, float cfo)
bool sync::set_cell()
{
if (!phy_state.is_idle()) {
Warning("Can not change Cell while not in IDLE\n");
return false;

@ -79,6 +79,12 @@ proc_outcome_t rrc::cell_search_proc::handle_cell_found(const phy_interface_rrc_
rrc_ptr->set_serving_cell(new_cell, false);
// set new serving cell in PHY
if (not rrc_ptr->phy->cell_select(&rrc_ptr->serving_cell->phy_cell)) {
Error("Couldn't select new serving cell\n");
return proc_outcome_t::error;
}
if (not rrc_ptr->phy->cell_is_camping()) {
Warning("Could not camp on found cell.\n");
return proc_outcome_t::error;
@ -111,9 +117,8 @@ proc_outcome_t rrc::cell_search_proc::react(const cell_search_event_t& event)
Info("PHY cell search completed.\n");
// Transition to SI Acquire or finish
switch (search_result.cs_ret.found) {
case phy_interface_rrc_lte::cell_search_ret_t::CELL_FOUND: {
case phy_interface_rrc_lte::cell_search_ret_t::CELL_FOUND:
return handle_cell_found(search_result.found_cell);
}
case phy_interface_rrc_lte::cell_search_ret_t::CELL_NOT_FOUND:
rrc_ptr->phy_sync_state = phy_unknown_sync;
Info("No cells found.\n");

Loading…
Cancel
Save