Hi all,

Attached is a patch for the openbsc which extends meas_feed with
channel information - type and id (bts/trx/ts/ss). This is used by the
web incarnation of meas_vis utility we wrote [1]. Originally it was a
pure copy of the original meas_vis, but when we deployed it at
Rhizomatica, they suggested it would be more useful if the channel
information is displayed.

It would be great to see this patch merged to master.

When/if this is merged, I'll submit a patch with meas_json utility
which listens on the meas_feed socket and converts it to JSON format
digestible by web tools. This JSON is what meas_web uses as a data
feed.

[1] https://github.com/fairwaves/meas_web

PS Apologies for attaching the patch instead of inlining it. GMail
would ruin it.

-- 
Regards,
Alexander Chemeris.
CEO, Fairwaves, Inc.
https://fairwaves.co

Subscribe to Fairwaves news: http://eepurl.com/baL_pf
From 810d29aa03a5ab34917e759aa77d8b2afcaba58b Mon Sep 17 00:00:00 2001
From: Alexander Chemeris <[email protected]>
Date: Thu, 20 Aug 2015 20:48:39 -0400
Subject: [PATCH] msc: Add channel information to the meas_feed, bump version
 to v1.

---
 openbsc/include/openbsc/meas_feed.h | 14 +++++++++++++-
 openbsc/src/libmsc/meas_feed.c      |  9 +++++++++
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/openbsc/include/openbsc/meas_feed.h b/openbsc/include/openbsc/meas_feed.h
index 65d09b8..f77ee07 100644
--- a/openbsc/include/openbsc/meas_feed.h
+++ b/openbsc/include/openbsc/meas_feed.h
@@ -17,13 +17,25 @@ struct meas_feed_meas {
 	char name[31+1];
 	char scenario[31+1];
 	struct gsm_meas_rep mr;
+	/* The logical channel type, enum gsm_chan_t */
+	uint8_t lchan_type;
+	/* The physical channel type, enum gsm_phys_chan_config */
+	uint8_t pchan_type;
+	/* number of ths BTS in network */
+	uint8_t bts_nr;
+	/* number of this TRX in the BTS */
+	uint8_t trx_nr;
+	/* number of this timeslot at the TRX */
+	uint8_t ts_nr;
+	/* The logical subslot number in the TS */
+	uint8_t ss_nr;
 };
 
 enum meas_feed_msgtype {
 	MEAS_FEED_MEAS		= 0,
 };
 
-#define MEAS_FEED_VERSION	0
+#define MEAS_FEED_VERSION	1
 
 
 #endif
diff --git a/openbsc/src/libmsc/meas_feed.c b/openbsc/src/libmsc/meas_feed.c
index 86d679a..6a91886 100644
--- a/openbsc/src/libmsc/meas_feed.c
+++ b/openbsc/src/libmsc/meas_feed.c
@@ -60,6 +60,15 @@ static int process_meas_rep(struct gsm_meas_rep *mr)
 	/* copy the entire measurement report */
 	memcpy(&mfm->mr, mr, sizeof(mfm->mr));
 
+	/* copy channel information */
+	/* we assume that the measurement report always belong to some timeslot */
+	mfm->lchan_type = (uint8_t)mr->lchan->type;
+	mfm->pchan_type = (uint8_t)mr->lchan->ts->pchan;
+	mfm->bts_nr = mr->lchan->ts->trx->bts->nr;
+	mfm->trx_nr = mr->lchan->ts->trx->nr;
+	mfm->ts_nr = mr->lchan->ts->nr;
+	mfm->ss_nr = mr->lchan->nr;
+
 	/* and send it to the socket */
 	if (osmo_wqueue_enqueue(&g_mfs.wqueue, msg) != 0)
 		msgb_free(msg);
-- 
1.9.1

Reply via email to