From 0ef8e1fdacc7041c28d641d9a704085f24090dd6 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Thu, 1 Oct 2020 18:51:07 +0200 Subject: [PATCH] rrc: include pci when logging serving cell measurement this should facilitate easier log parsing and plotting if the cell measurements _always_ include the PCI, even in the case of the serving cell 15:49:11.357447 [RRC ] [I] MEAS: New measurement serving cell: earfcn=0, pci=1, rsrp=-11.52 dBm, cfo=+0.1 Hz 15:49:11.391610 [RRC ] [I] MEAS: New measurement serving cell: earfcn=0, pci=1, rsrp=-11.52 dBm, cfo=-0.4 Hz 15:49:11.427325 [RRC ] [I] MEAS: New measurement serving cell: earfcn=0, pci=1, rsrp=-11.52 dBm, cfo=-0.6 Hz 15:49:11.463101 [RRC ] [I] MEAS: New measurement serving cell: earfcn=0, pci=1, rsrp=-11.52 dBm, cfo=-0.7 Hz 15:49:11.499817 [RRC ] [I] MEAS: New measurement serving cell: earfcn=0, pci=1, rsrp=-11.51 dBm, cfo=+0.1 Hz 15:49:11.499828 [RRC ] [I] MEAS: New measurement neighbour cell: earfcn=2850, pci=0, rsrp=-12.16 dBm, cfo=-0.8 Hz 15:49:11.535027 [RRC ] [I] MEAS: New measurement serving cell: earfcn=0, pci=1, rsrp=-11.46 dBm, cfo=-0.8 Hz 15:49:11.571707 [RRC ] [I] MEAS: New measurement serving cell: earfcn=0, pci=1, rsrp=-11.46 dBm, cfo=-0.9 Hz 15:49:11.607932 [RRC ] [I] MEAS: New measurement serving cell: earfcn=0, pci=1, rsrp=-11.52 dBm, cfo=-0.8 Hz --- srsue/hdr/stack/rrc/rrc.h | 1 - srsue/src/stack/rrc/rrc_cell.cc | 23 ++++++++++------------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/srsue/hdr/stack/rrc/rrc.h b/srsue/hdr/stack/rrc/rrc.h index 8152c45b4..2ee1d0760 100644 --- a/srsue/hdr/stack/rrc/rrc.h +++ b/srsue/hdr/stack/rrc/rrc.h @@ -66,7 +66,6 @@ using srslte::byte_buffer_t; namespace srsue { - class phy_controller; class rrc : public rrc_interface_nas, diff --git a/srsue/src/stack/rrc/rrc_cell.cc b/srsue/src/stack/rrc/rrc_cell.cc index 17add2995..9bb852ab0 100644 --- a/srsue/src/stack/rrc/rrc_cell.cc +++ b/srsue/src/stack/rrc/rrc_cell.cc @@ -181,10 +181,10 @@ const cell_t* meas_cell_list::get_neighbour_cell_handle(uint32_t earfcn, uint32_ // If only neighbour PCI is provided, copy full cell from serving cell bool meas_cell_list::add_meas_cell(const rrc_interface_phy_lte::phy_meas_t& meas) { - phy_cell_t phy_cell = {}; - phy_cell.earfcn = meas.earfcn; - phy_cell.pci = meas.pci; - unique_cell_t c = unique_cell_t(new cell_t(phy_cell)); + phy_cell_t phy_cell = {}; + phy_cell.earfcn = meas.earfcn; + phy_cell.pci = meas.pci; + unique_cell_t c = unique_cell_t(new cell_t(phy_cell)); c.get()->set_rsrp(meas.rsrp); c.get()->set_rsrq(meas.rsrq); c.get()->set_cfo(meas.cfo_hz); @@ -403,15 +403,12 @@ bool meas_cell_list::process_new_cell_meas(const std::vector& neighbour_added |= add_meas_cell(m); } - if (is_serving_cell) { - log_h->info("MEAS: New measurement serving cell: rsrp=%.2f dBm.\n", m.rsrp); - } else { - log_h->info("MEAS: New measurement neighbour cell: earfcn=%d, pci=%d, rsrp=%.2f dBm, cfo=%+.1f Hz\n", - m.earfcn, - m.pci, - m.rsrp, - m.cfo_hz); - } + log_h->info("MEAS: New measurement %s cell: earfcn=%d, pci=%d, rsrp=%.2f dBm, cfo=%+.1f Hz\n", + is_serving_cell ? "serving" : "neighbour", + m.earfcn, + m.pci, + m.rsrp, + m.cfo_hz); } return neighbour_added; }