From 548a4ae29d02cfad20f6f14b14bae045a9ad91a7 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Fri, 16 Mar 2018 11:22:40 +0100 Subject: [PATCH] RRC is_connected return and srsgui crashing if ports=0 when init --- srsue/hdr/phy/phch_worker.h | 12 ++++++++++-- srsue/src/upper/rrc.cc | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/srsue/hdr/phy/phch_worker.h b/srsue/hdr/phy/phch_worker.h index e87603e5d..28c4715ad 100644 --- a/srsue/hdr/phy/phch_worker.h +++ b/srsue/hdr/phy/phch_worker.h @@ -63,8 +63,16 @@ public: void write_trace(std::string filename); int read_ce_abs(float *ce_abs, uint32_t tx_antenna, uint32_t rx_antenna); - uint32_t get_cell_nof_ports() {return cell.nof_ports;}; - uint32_t get_rx_nof_antennas() {return ue_dl.nof_rx_antennas;}; + uint32_t get_cell_nof_ports() { + if (cell_initiated) { + return cell.nof_ports; + } else { + return 1; + } + }; + uint32_t get_rx_nof_antennas() { + return ue_dl.nof_rx_antennas; + }; int read_pdsch_d(cf_t *pdsch_d); void start_plot(); diff --git a/srsue/src/upper/rrc.cc b/srsue/src/upper/rrc.cc index 83d7174ca..e419ea710 100644 --- a/srsue/src/upper/rrc.cc +++ b/srsue/src/upper/rrc.cc @@ -156,7 +156,7 @@ rrc_state_t rrc::get_state() { } bool rrc::is_connected() { - return (RRC_STATE_CONNECTED >= state && state < RRC_STATE_LEAVE_CONNECTED); + return (state >= RRC_STATE_CONNECTED && state < RRC_STATE_LEAVE_CONNECTED); } bool rrc::have_drb() {