aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-06-08 11:26:38 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-06-12 15:35:10 +0200
commit3bea905e0d013de9a0b9d77fdc5318a133a6af9b (patch)
tree4ec50c829ed31bc9ad1fd12083b14369fae6956b
parent4ff709c3aca86f9974c99b99aea3da9bfde714a3 (diff)
ms: Store the L1 measurement values in the MS objects
This commits adds the GprsMs::update_l1_meas() and GprsMs::l1_meas() methods to store and access the measurement values. The internal state is updated depending on which values are actually set. In addition, these values are shown in the output of the 'show ms imsi|tlli' command. Sponsored-by: On-Waves ehf
-rw-r--r--src/gprs_ms.cpp12
-rw-r--r--src/gprs_ms.h6
-rw-r--r--src/pcu_vty_functions.cpp12
-rw-r--r--src/tbf_ul.cpp4
4 files changed, 34 insertions, 0 deletions
diff --git a/src/gprs_ms.cpp b/src/gprs_ms.cpp
index f0379ce8..189e4bd2 100644
--- a/src/gprs_ms.cpp
+++ b/src/gprs_ms.cpp
@@ -421,3 +421,15 @@ void GprsMs::update_error_rate(gprs_rlcmac_tbf *tbf, int error_rate)
m_last_cs_not_low = now;
}
}
+
+void GprsMs::update_l1_meas(const pcu_l1_meas *meas)
+{
+ if (meas->have_rssi)
+ m_l1_meas.set_rssi(meas->rssi);
+ if (meas->have_bto)
+ m_l1_meas.set_bto(meas->bto);
+ if (meas->have_ber)
+ m_l1_meas.set_ber(meas->ber);
+ if (meas->have_link_qual)
+ m_l1_meas.set_link_qual(meas->link_qual);
+}
diff --git a/src/gprs_ms.h b/src/gprs_ms.h
index 90b81fee..6752b2b6 100644
--- a/src/gprs_ms.h
+++ b/src/gprs_ms.h
@@ -26,6 +26,7 @@ struct gprs_rlcmac_ul_tbf;
#include "cxx_linuxlist.h"
#include "llc.h"
+#include "pcu_l1_if.h"
extern "C" {
#include <osmocom/core/timer.h>
@@ -96,6 +97,9 @@ public:
LListHead<GprsMs>& list() {return this->m_list;}
const LListHead<GprsMs>& list() const {return this->m_list;}
+ void update_l1_meas(const pcu_l1_meas *meas);
+ const pcu_l1_meas* l1_meas() const {return &m_l1_meas;};
+
/* internal use */
static void timeout(void *priv_);
@@ -132,6 +136,8 @@ private:
unsigned m_delay;
int64_t m_last_cs_not_low;
+
+ pcu_l1_meas m_l1_meas;
};
inline uint32_t GprsMs::tlli() const
diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp
index 39c5ee44..bf4843f1 100644
--- a/src/pcu_vty_functions.cpp
+++ b/src/pcu_vty_functions.cpp
@@ -67,6 +67,18 @@ static int show_ms(struct vty *vty, GprsMs *ms)
vty_out(vty, " MS class: %d%s", ms->ms_class(), VTY_NEWLINE);
vty_out(vty, " LLC queue length: %d%s", ms->llc_queue()->size(),
VTY_NEWLINE);
+ if (ms->l1_meas()->have_rssi)
+ vty_out(vty, " RSSI: %d dBm%s",
+ ms->l1_meas()->rssi, VTY_NEWLINE);
+ if (ms->l1_meas()->have_ber)
+ vty_out(vty, " Bit error rate: %d %%%s",
+ ms->l1_meas()->ber, VTY_NEWLINE);
+ if (ms->l1_meas()->have_link_qual)
+ vty_out(vty, " Link quality: %d dB%s",
+ ms->l1_meas()->link_qual, VTY_NEWLINE);
+ if (ms->l1_meas()->have_bto)
+ vty_out(vty, " Burst timing offset: %d/4 bit%s",
+ ms->l1_meas()->bto, VTY_NEWLINE);
if (ms->ul_tbf())
vty_out(vty, " Uplink TBF: TFI=%d, state=%s%s",
ms->ul_tbf()->tfi(),
diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp
index b9ea6599..a79657d7 100644
--- a/src/tbf_ul.cpp
+++ b/src/tbf_ul.cpp
@@ -281,6 +281,10 @@ int gprs_rlcmac_ul_tbf::rcv_data_block_acknowledged(const uint8_t *data,
/* process RSSI */
gprs_rlcmac_rssi(this, rssi);
+ /* store measurement values */
+ if (ms())
+ ms()->update_l1_meas(meas);
+
/* get TLLI */
if (!this->is_tlli_valid()) {
if (!extract_tlli(data, len))