SRSUE: cell select RRC MEAS CFO is carried to PHY Cell object

master
Xavier Arteaga 5 years ago committed by Xavier Arteaga
parent cbaba9c0bd
commit 25312e81b4

@ -576,11 +576,12 @@ public:
typedef struct { typedef struct {
uint32_t pci; uint32_t pci;
uint32_t earfcn; uint32_t earfcn;
float cfo_hz;
} phy_cell_t; } phy_cell_t;
/* Cell search and selection procedures */ /* Cell search and selection procedures */
virtual cell_search_ret_t cell_search(phy_cell_t* cell) = 0; virtual cell_search_ret_t cell_search(phy_cell_t* cell) = 0;
virtual bool cell_select(const phy_cell_t* cell = nullptr, float cfo_hz = 0.0f) = 0; virtual bool cell_select(const phy_cell_t* cell = nullptr) = 0;
virtual bool cell_is_camping() = 0; virtual bool cell_is_camping() = 0;
virtual void reset() = 0; virtual void reset() = 0;

@ -69,7 +69,7 @@ public:
/********** RRC INTERFACE ********************/ /********** RRC INTERFACE ********************/
void reset() final; void reset() final;
cell_search_ret_t cell_search(phy_cell_t* cell) final; cell_search_ret_t cell_search(phy_cell_t* cell) final;
bool cell_select(const phy_cell_t* cell, float cfo) final; bool cell_select(const phy_cell_t* cell) final;
void set_cells_to_meas(uint32_t earfcn, const std::set<uint32_t>& pci) final; void set_cells_to_meas(uint32_t earfcn, const std::set<uint32_t>& pci) final;
void meas_stop() final; void meas_stop() final;

@ -65,7 +65,7 @@ public:
// RRC interface for controling the SYNC state // RRC interface for controling the SYNC state
phy_interface_rrc_lte::cell_search_ret_t cell_search(phy_interface_rrc_lte::phy_cell_t* cell); phy_interface_rrc_lte::cell_search_ret_t cell_search(phy_interface_rrc_lte::phy_cell_t* cell);
bool cell_select(const phy_interface_rrc_lte::phy_cell_t* cell, float cfo); bool cell_select(const phy_interface_rrc_lte::phy_cell_t* cell);
bool cell_is_camping(); bool cell_is_camping();
// RRC interface for controlling the neighbour cell measurement // RRC interface for controlling the neighbour cell measurement

@ -151,13 +151,13 @@ public:
void set_cfo(float cfo_Hz_) void set_cfo(float cfo_Hz_)
{ {
if (not std::isnan(cfo_Hz_) && not std::isinf(cfo_Hz_)) { if (not std::isnan(cfo_Hz_) && not std::isinf(cfo_Hz_)) {
cfo_hz = cfo_Hz_; phy_cell.cfo_hz = cfo_Hz_;
} }
} }
float get_rsrp() { return rsrp; } float get_rsrp() { return rsrp; }
float get_rsrq() { return rsrq; } float get_rsrq() { return rsrq; }
float get_cfo_hz() { return cfo_hz; } float get_cfo_hz() { return phy_cell.cfo_hz; }
void set_sib1(asn1::rrc::sib_type1_s* sib1_); void set_sib1(asn1::rrc::sib_type1_s* sib1_);
void set_sib2(asn1::rrc::sib_type2_s* sib2_); void set_sib2(asn1::rrc::sib_type2_s* sib2_);
@ -264,7 +264,6 @@ public:
private: private:
float rsrp = NAN; float rsrp = NAN;
float rsrq = NAN; float rsrq = NAN;
float cfo_hz = 0.0f;
struct timeval last_update = {}; struct timeval last_update = {};

@ -314,9 +314,9 @@ void phy::meas_stop()
sfsync.meas_stop(); sfsync.meas_stop();
} }
bool phy::cell_select(const phy_cell_t* cell, float cfo) bool phy::cell_select(const phy_cell_t* cell)
{ {
return sfsync.cell_select(cell, cfo); return sfsync.cell_select(cell);
} }
phy_interface_rrc_lte::cell_search_ret_t phy::cell_search(phy_cell_t* cell) phy_interface_rrc_lte::cell_search_ret_t phy::cell_search(phy_cell_t* cell)

@ -252,7 +252,7 @@ phy_interface_rrc_lte::cell_search_ret_t sync::cell_search(phy_interface_rrc_lte
/* Cell select synchronizes to a new cell (e.g. during HO or during cell reselection on IDLE) or /* Cell select synchronizes to a new cell (e.g. during HO or during cell reselection on IDLE) or
* re-synchronizes with the current cell if cell argument is NULL * re-synchronizes with the current cell if cell argument is NULL
*/ */
bool sync::cell_select(const phy_interface_rrc_lte::phy_cell_t* new_cell, float cfo) bool sync::cell_select(const phy_interface_rrc_lte::phy_cell_t* new_cell)
{ {
std::unique_lock<std::mutex> ul(rrc_mutex); std::unique_lock<std::mutex> ul(rrc_mutex);
@ -288,7 +288,7 @@ bool sync::cell_select(const phy_interface_rrc_lte::phy_cell_t* new_cell, float
/* Reconfigure cell if necessary */ /* Reconfigure cell if necessary */
if (new_cell != nullptr) { if (new_cell != nullptr) {
cell.id = new_cell->pci; cell.id = new_cell->pci;
if (not set_cell(cfo)) { if (not set_cell(new_cell->cfo_hz)) {
Error("Cell Select: Reconfiguring cell\n"); Error("Cell Select: Reconfiguring cell\n");
return ret; return ret;
} }
@ -686,7 +686,7 @@ void sync::set_ue_sync_opts(srslte_ue_sync_t* q, float cfo)
worker_com->args->cfo_loop_pss_conv); worker_com->args->cfo_loop_pss_conv);
// Disable CP based CFO estimation during find // Disable CP based CFO estimation during find
if (isnormal(cfo)) { if (std::isnormal(cfo)) {
srslte_ue_sync_cfo_reset(q, cfo); srslte_ue_sync_cfo_reset(q, cfo);
q->cfo_current_value = cfo / 15000; q->cfo_current_value = cfo / 15000;
q->cfo_is_copied = true; q->cfo_is_copied = true;

@ -1085,7 +1085,7 @@ bool rrc::ho_prepare()
} }
cell_t* target_cell = get_neighbour_cell_handle(target_earfcn, mob_ctrl_info->target_pci); cell_t* target_cell = get_neighbour_cell_handle(target_earfcn, mob_ctrl_info->target_pci);
if (not phy->cell_select(&target_cell->phy_cell, target_cell->get_cfo_hz())) { if (not phy->cell_select(&target_cell->phy_cell)) {
rrc_log->error("Could not synchronize with target cell %s. Removing cell and trying to return to source %s\n", rrc_log->error("Could not synchronize with target cell %s. Removing cell and trying to return to source %s\n",
target_cell->to_string().c_str(), target_cell->to_string().c_str(),
serving_cell->to_string().c_str()); serving_cell->to_string().c_str());

@ -87,7 +87,7 @@ public:
// Cell search and selection procedures // Cell search and selection procedures
cell_search_ret_t cell_search(phy_cell_t* found_cell); cell_search_ret_t cell_search(phy_cell_t* found_cell);
bool cell_select(const phy_cell_t* cell, float cfo) override; bool cell_select(const phy_cell_t* cell) override;
bool cell_is_camping(); bool cell_is_camping();
void reset(); void reset();

@ -151,7 +151,7 @@ phy_interface_rrc_lte::cell_search_ret_t lte_ttcn3_phy::cell_search(phy_cell_t*
return ret; return ret;
}; };
bool lte_ttcn3_phy::cell_select(const phy_cell_t* rrc_cell, float cfo) bool lte_ttcn3_phy::cell_select(const phy_cell_t* rrc_cell)
{ {
// try to find RRC cell in current cell map // try to find RRC cell in current cell map
for (auto& cell : cells) { for (auto& cell : cells) {

@ -55,7 +55,7 @@ public:
void set_config_mbsfn_mcch(const srslte::mcch_msg_t& mcch) override {} void set_config_mbsfn_mcch(const srslte::mcch_msg_t& mcch) override {}
cell_search_ret_t cell_search(phy_cell_t* cell) override { return {}; } cell_search_ret_t cell_search(phy_cell_t* cell) override { return {}; }
bool cell_is_camping() override { return false; } bool cell_is_camping() override { return false; }
bool cell_select(const phy_cell_t* cell = nullptr, float cfo = 0.0f) override { return false; } bool cell_select(const phy_cell_t* cell = nullptr) override { return false; }
void reset() override {} void reset() override {}
void enable_pregen_signals(bool enable) override {} void enable_pregen_signals(bool enable) override {}

Loading…
Cancel
Save