SRSUE: Added Cell PCI in console trace

master
Xavier Arteaga 5 years ago committed by Xavier Arteaga
parent d96836a0fa
commit a8763cb7a0

@ -26,6 +26,11 @@
namespace srsue { namespace srsue {
struct info_metrics_t {
uint32_t pci;
uint32_t dl_earfcn;
};
struct sync_metrics_t struct sync_metrics_t
{ {
float ta_us; float ta_us;
@ -55,6 +60,7 @@ struct ul_metrics_t
struct phy_metrics_t struct phy_metrics_t
{ {
info_metrics_t info[SRSLTE_MAX_CARRIERS];
sync_metrics_t sync[SRSLTE_MAX_CARRIERS]; sync_metrics_t sync[SRSLTE_MAX_CARRIERS];
dl_metrics_t dl[SRSLTE_MAX_CARRIERS]; dl_metrics_t dl[SRSLTE_MAX_CARRIERS];
ul_metrics_t ul[SRSLTE_MAX_CARRIERS]; ul_metrics_t ul[SRSLTE_MAX_CARRIERS];

@ -41,11 +41,9 @@ char const * const prefixes[2][9] =
{ "", "k", "M", "G", "T", "P", "E", "Z", "Y", }, { "", "k", "M", "G", "T", "P", "E", "Z", "Y", },
}; };
metrics_stdout::metrics_stdout() metrics_stdout::metrics_stdout() : do_print(false), n_reports(10), ue(nullptr)
:do_print(false)
,n_reports(10)
,ue(NULL)
{ {
// Do nothing
} }
void metrics_stdout::set_ue_handle(ue_metrics_interface *ue_) void metrics_stdout::set_ue_handle(ue_metrics_interface *ue_)
@ -60,7 +58,7 @@ void metrics_stdout::toggle_print(bool b)
void metrics_stdout::set_metrics(ue_metrics_t &metrics, const uint32_t period_usec) void metrics_stdout::set_metrics(ue_metrics_t &metrics, const uint32_t period_usec)
{ {
if (ue == NULL) { if (ue == nullptr) {
return; return;
} }
@ -82,11 +80,12 @@ void metrics_stdout::set_metrics(ue_metrics_t &metrics, const uint32_t period_us
{ {
n_reports = 0; n_reports = 0;
cout << endl; cout << endl;
cout << "----Signal--------------DL-------------------------------------UL----------------------" << endl; cout << "--------Signal--------------DL-------------------------------------UL----------------------" << endl;
cout << "cc rsrp pl cfo mcs snr turbo brate bler ta_us mcs buff brate bler" << endl; cout << "cc pci rsrp pl cfo mcs snr turbo brate bler ta_us mcs buff brate bler" << endl;
} }
for (uint32_t r = 0; r < metrics.phy.nof_active_cc; r++) { for (uint32_t r = 0; r < metrics.phy.nof_active_cc; r++) {
cout << " " << r; cout << std::setw(2) << r;
cout << std::setw(4) << metrics.phy.info[r].pci << std::setw(0);
cout << float_to_string(metrics.phy.dl[r].rsrp, 2); cout << float_to_string(metrics.phy.dl[r].rsrp, 2);
cout << float_to_string(metrics.phy.dl[r].pathloss, 2); cout << float_to_string(metrics.phy.dl[r].pathloss, 2);
cout << float_to_eng_string(metrics.phy.sync[r].cfo, 2); cout << float_to_eng_string(metrics.phy.sync[r].cfo, 2);

@ -235,6 +235,17 @@ void phy::stop()
void phy::get_metrics(phy_metrics_t* m) void phy::get_metrics(phy_metrics_t* m)
{ {
uint32_t dl_earfcn = 0;
srslte_cell_t cell = {};
get_current_cell(&cell, &dl_earfcn);
m->info[0].pci = cell.id;
m->info[0].dl_earfcn = dl_earfcn;
for (uint32_t i = 1; i < args.nof_carriers; i++) {
m->info[i].dl_earfcn = common.scell_cfg[i].earfcn;
m->info[i].pci = common.scell_cfg[i].pci;
}
common.get_dl_metrics(m->dl); common.get_dl_metrics(m->dl);
common.get_ul_metrics(m->ul); common.get_ul_metrics(m->ul);
common.get_sync_metrics(m->sync); common.get_sync_metrics(m->sync);

Loading…
Cancel
Save