mirror of https://github.com/PentHertz/srsLTE.git
Fix previous commit could not HO more than once due to not refreshing serving cell after 1st HO
This commit is contained in:
parent
df67735a99
commit
cfaa5e9b28
|
@ -160,7 +160,7 @@ public:
|
|||
virtual void in_sync() = 0;
|
||||
virtual void out_of_sync() = 0;
|
||||
virtual void earfcn_end() = 0;
|
||||
virtual void cell_found(uint32_t earfcn, srslte_cell_t phy_cell, float rsrp) = 0;
|
||||
virtual void cell_camping(uint32_t earfcn, srslte_cell_t phy_cell, float rsrp = NAN) = 0;
|
||||
virtual void new_phy_meas(float rsrp, float rsrq, uint32_t tti, int earfcn = -1, int pci = -1) = 0;
|
||||
};
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "srslte/common/security.h"
|
||||
#include "srslte/common/threads.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <map>
|
||||
#include <queue>
|
||||
|
||||
|
@ -106,7 +107,9 @@ class cell_t
|
|||
}
|
||||
|
||||
void set_rsrp(float rsrp) {
|
||||
if (~isnan(rsrp)) {
|
||||
this->rsrp = rsrp;
|
||||
}
|
||||
in_sync = true;
|
||||
gettimeofday(&last_update, NULL);
|
||||
}
|
||||
|
@ -252,7 +255,7 @@ public:
|
|||
void in_sync();
|
||||
void out_of_sync();
|
||||
void earfcn_end();
|
||||
void cell_found(uint32_t earfcn, srslte_cell_t phy_cell, float rsrp);
|
||||
void cell_camping(uint32_t earfcn, srslte_cell_t phy_cell, float rsrp);
|
||||
void new_phy_meas(float rsrp, float rsrq, uint32_t tti, int earfcn, int pci);
|
||||
|
||||
// MAC interface
|
||||
|
|
|
@ -651,6 +651,7 @@ void phch_recv::run_thread()
|
|||
if (!cell_search_in_progress) {
|
||||
log_h->info("Sync OK. Camping on cell PCI=%d...\n", cell.id);
|
||||
phy_state = CELL_CAMP;
|
||||
rrc->cell_camping(earfcn[cur_earfcn_index], cell);
|
||||
} else {
|
||||
log_h->info("Sync OK. Measuring PCI=%d...\n", cell.id);
|
||||
measure_p.reset();
|
||||
|
@ -680,7 +681,7 @@ void phch_recv::run_thread()
|
|||
log_h->info("SYNC: Measured OK. Camping on cell PCI=%d...\n", cell.id);
|
||||
phy_state = CELL_CAMP;
|
||||
cell_search_in_progress = false;
|
||||
rrc->cell_found(earfcn[cur_earfcn_index], cell, measure_p.rsrp());
|
||||
rrc->cell_camping(earfcn[cur_earfcn_index], cell, measure_p.rsrp());
|
||||
break;
|
||||
case measure::IDLE:
|
||||
break;
|
||||
|
|
|
@ -590,14 +590,16 @@ void rrc::new_phy_meas(float rsrp, float rsrq, uint32_t tti, int earfcn_i, int p
|
|||
}
|
||||
}
|
||||
|
||||
void rrc::cell_found(uint32_t earfcn, srslte_cell_t phy_cell, float rsrp) {
|
||||
/* PHY begins camping in a cell. RRC updates RSRP measurement,
|
||||
* proceeds with PLMN selection/cell search if applicable and sets
|
||||
* new cell as current serving cell */
|
||||
void rrc::cell_camping(uint32_t earfcn, srslte_cell_t phy_cell, float rsrp) {
|
||||
|
||||
bool found = false;
|
||||
int cell_idx = -1;
|
||||
|
||||
if (serving_cell->equals(earfcn, phy_cell.id)) {
|
||||
serving_cell->set_rsrp(rsrp);
|
||||
serving_cell->in_sync = true;
|
||||
found = true;
|
||||
} else {
|
||||
// Check if cell is in our list of neighbour cells
|
||||
|
@ -605,7 +607,6 @@ void rrc::cell_found(uint32_t earfcn, srslte_cell_t phy_cell, float rsrp) {
|
|||
if (cell_idx >= 0) {
|
||||
set_serving_cell(cell_idx);
|
||||
serving_cell->set_rsrp(rsrp);
|
||||
serving_cell->in_sync = true;
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
@ -629,7 +630,6 @@ void rrc::cell_found(uint32_t earfcn, srslte_cell_t phy_cell, float rsrp) {
|
|||
phy->cell_search_next();
|
||||
} else {
|
||||
set_serving_cell(earfcn, phy_cell.id);
|
||||
|
||||
si_acquire_state = SI_ACQUIRE_SIB1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue