fix invalid neighbor cell addition

if phy measurements are received and processes before a serving cell
is selected, an invalid neighbor cell is added because the uninitlized
serving cell is used.

fix the issue by checking if the serving cell is valid
master
Andre Puschmann 5 years ago
parent 8b015ee128
commit 761fda542d

@ -686,12 +686,16 @@ bool rrc::add_neighbour_cell(cell_t *new_cell) {
}
// If only neighbour PCI is provided, copy full cell from serving cell
bool rrc::add_neighbour_cell(uint32_t earfcn, uint32_t pci, float rsrp) {
phy_interface_rrc_lte::phy_cell_t phy_cell;
phy_cell = serving_cell->phy_cell;
phy_cell.earfcn = earfcn;
phy_cell.cell.id = pci;
return add_neighbour_cell(phy_cell, rsrp);
bool rrc::add_neighbour_cell(uint32_t earfcn, uint32_t pci, float rsrp)
{
if (serving_cell->is_valid()) {
phy_interface_rrc_lte::phy_cell_t phy_cell;
phy_cell = serving_cell->phy_cell;
phy_cell.earfcn = earfcn;
phy_cell.cell.id = pci;
return add_neighbour_cell(phy_cell, rsrp);
}
return false;
}
bool rrc::add_neighbour_cell(phy_interface_rrc_lte::phy_cell_t phy_cell, float rsrp)

Loading…
Cancel
Save