aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcu_vty_functions.cpp
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-09-22 17:01:31 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2020-09-22 20:56:53 +0200
commita1ac2f017ffb8dfe3396ed63d7db5ea4f5ff678d (patch)
treec36e45729583beafb7cb06fb0323ea15cb80e860 /src/pcu_vty_functions.cpp
parent5fc95771bbe89b6ff6b6fbd0b0e6c2d50ef30484 (diff)
vty: Add 'show bts pdch' command
This allows to see which channels have been enabled according to PCU. Change-Id: If72e67ba80aab4e0c68408e6996d74d2ff70c322
Diffstat (limited to 'src/pcu_vty_functions.cpp')
-rw-r--r--src/pcu_vty_functions.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp
index 3e9973ca..33a4637e 100644
--- a/src/pcu_vty_functions.cpp
+++ b/src/pcu_vty_functions.cpp
@@ -239,3 +239,31 @@ int pcu_vty_show_ms_by_imsi(struct vty *vty, struct gprs_rlcmac_bts *bts_data,
return show_ms(vty, ms);
}
+
+int pcu_vty_show_bts_pdch(struct vty *vty, const struct gprs_rlcmac_bts *bts_data)
+{
+ unsigned int trx_nr, ts_nr;
+
+ vty_out(vty, "BTS (%s)%s", bts_data->active ? "active" : "disabled", VTY_NEWLINE);
+ for (trx_nr = 0; trx_nr < ARRAY_SIZE(bts_data->trx); trx_nr++) {
+ const struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_nr];
+
+ for (ts_nr = 0; ts_nr < ARRAY_SIZE(trx->pdch); ts_nr++) {
+ if (trx->pdch[ts_nr].is_enabled())
+ break;
+ }
+ if (ts_nr == ARRAY_SIZE(trx->pdch))
+ continue; /* no pdch active, skip */
+
+ vty_out(vty, " TRX%u%s", trx->trx_no, VTY_NEWLINE);
+ for (ts_nr = 0; ts_nr < ARRAY_SIZE(trx->pdch); ts_nr++) {
+ const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts_nr];
+
+ vty_out(vty, " TS%u: PDCH %s, %u UL TBFs, %u DL TBFs%s", pdch->ts_no,
+ pdch->is_enabled() ? "enabled" : "disabled",
+ pdch->num_tbfs(GPRS_RLCMAC_DL_TBF),
+ pdch->num_tbfs(GPRS_RLCMAC_UL_TBF), VTY_NEWLINE);
+ }
+ }
+ return CMD_SUCCESS;
+}