aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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 f0379ce..189e4bd 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 90b81fe..6752b2b 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 39c5ee4..bf4843f 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 b9ea659..a79657d 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))