|
|
@ -290,6 +290,41 @@ void phy::configure_prach_params()
|
|
|
|
|
|
|
|
|
|
|
|
void phy::set_cells_to_meas(uint32_t earfcn, const std::set<uint32_t>& pci)
|
|
|
|
void phy::set_cells_to_meas(uint32_t earfcn, const std::set<uint32_t>& pci)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
// Check if the EARFCN matches with serving cell
|
|
|
|
|
|
|
|
uint32_t pcell_earfcn = 0;
|
|
|
|
|
|
|
|
sfsync.get_current_cell(nullptr, &pcell_earfcn);
|
|
|
|
|
|
|
|
bool available = (pcell_earfcn == earfcn);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Find if there is secondary serving cell configured with the specified EARFCN
|
|
|
|
|
|
|
|
uint32_t cc_empty = 0;
|
|
|
|
|
|
|
|
for (uint32_t cc = 1; cc < args.nof_carriers and not available; cc++) {
|
|
|
|
|
|
|
|
// If it is configured...
|
|
|
|
|
|
|
|
if (common.cell_state.is_configured(cc)) {
|
|
|
|
|
|
|
|
// ... Check if the EARFCN match
|
|
|
|
|
|
|
|
if (common.cell_state.get_earfcn(cc) == earfcn) {
|
|
|
|
|
|
|
|
available = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (cc_empty == 0) {
|
|
|
|
|
|
|
|
// ... otherwise, save the CC as non-configured
|
|
|
|
|
|
|
|
cc_empty = cc;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// If not available and a non-configured carrier is available, configure it.
|
|
|
|
|
|
|
|
if (not available and cc_empty != 0) {
|
|
|
|
|
|
|
|
// Copy all attributes from serving cell
|
|
|
|
|
|
|
|
srslte_cell_t cell = selected_cell;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Select the first PCI in the list
|
|
|
|
|
|
|
|
if (not pci.empty()) {
|
|
|
|
|
|
|
|
cell.id = *pci.begin();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Configure a the empty carrier as it was CA
|
|
|
|
|
|
|
|
set_scell(cell, cc_empty, earfcn);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Finally, set the serving cell measure
|
|
|
|
sfsync.set_cells_to_meas(earfcn, pci);
|
|
|
|
sfsync.set_cells_to_meas(earfcn, pci);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -454,7 +489,7 @@ bool phy::set_config(srslte::phy_cfg_t config_, uint32_t cc_idx)
|
|
|
|
// Check parameters are valid
|
|
|
|
// Check parameters are valid
|
|
|
|
if (cc_idx >= args.nof_carriers) {
|
|
|
|
if (cc_idx >= args.nof_carriers) {
|
|
|
|
srslte::console("Received SCell configuration for index %d but there are not enough CC workers available\n",
|
|
|
|
srslte::console("Received SCell configuration for index %d but there are not enough CC workers available\n",
|
|
|
|
cc_idx);
|
|
|
|
cc_idx);
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -509,7 +544,7 @@ bool phy::set_scell(srslte_cell_t cell_info, uint32_t cc_idx, uint32_t earfcn)
|
|
|
|
// Check parameters are valid
|
|
|
|
// Check parameters are valid
|
|
|
|
if (cc_idx >= args.nof_carriers) {
|
|
|
|
if (cc_idx >= args.nof_carriers) {
|
|
|
|
srslte::console("Received SCell configuration for index %d but there are not enough CC workers available\n",
|
|
|
|
srslte::console("Received SCell configuration for index %d but there are not enough CC workers available\n",
|
|
|
|
cc_idx);
|
|
|
|
cc_idx);
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|