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
This commit is contained in:
Jacob Erlbeck 2015-06-08 11:26:38 +02:00
parent 4ff709c3ac
commit 3bea905e0d
4 changed files with 34 additions and 0 deletions

View File

@ -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);
}

View File

@ -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

View File

@ -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(),

View File

@ -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))