ASCI: Add VTY command to display group call neighbor cells

Related: OS#5782
Change-Id: Ie84221507bdf247c1563b829d6cf0adb53ce161f
This commit is contained in:
Andreas Eversberg 2023-09-29 15:25:53 +02:00
parent 61ea0ac0ab
commit c8fed7fba7
3 changed files with 60 additions and 2 deletions

View File

@ -185,6 +185,7 @@ uint8_t gsm_refer_pcs(uint16_t arfcn, const struct gsm48_sysinfo *s);
int gsm48_sysinfo_dump(const struct gsm48_sysinfo *s, uint16_t arfcn,
void (*print)(void *, const char *, ...),
void *priv, uint8_t *freq_map);
int gsm48_si10_dump(const struct gsm48_sysinfo *s, void (*print)(void *, const char *, ...), void *priv);
int gsm48_decode_lai(struct gsm48_loc_area_id *lai, uint16_t *mcc,
uint16_t *mnc, uint16_t *lac);
int gsm48_decode_chan_h0(const struct gsm48_chan_desc *cd,

View File

@ -311,6 +311,48 @@ int gsm48_sysinfo_dump(const struct gsm48_sysinfo *s, uint16_t arfcn,
return 0;
}
int gsm48_si10_dump(const struct gsm48_sysinfo *s, void (*print)(void *, const char *, ...), void *priv)
{
const struct si10_cell_info *c;
int i;
if (!s || !s->si10) {
print(priv, "No group channel neighbor information available.\n");
return 0;
}
if (!s->si10_cell_num) {
print(priv, "No group channel neighbors exist.\n");
return 0;
}
/* Group call neighbor cells. */
print(priv, "Group channel neighbor cells (current or last call):\n");
for (i = 0; i < s->si10_cell_num; i++) {
c = &s->si10_cell[i];
print(priv, " index = %d", c->index);
if (c->arfcn >= 0)
print(priv, " ARFCN = %d", c->arfcn);
else
print(priv, " ARFCN = not in SI5*");
print(priv, " BSIC = %d,%d", c->bsic >> 3, c->bsic & 0x7);
if (c->barred) {
print(priv, " barred");
continue;
}
if (c->la_different)
print(priv, " CRH = %d", c->cell_resel_hyst_db);
print(priv, " MS_TXPWR_MAX_CCCH = %d\n", c->ms_txpwr_max_cch);
print(priv, " RXLEV_MIN = %d", c->rxlev_acc_min_db);
print(priv, " CRO = %d", c->cell_resel_offset);
print(priv, " TEMP_OFFSET = %d", c->temp_offset);
print(priv, " PENALTY_TIME = %d", c->penalty_time);
}
print(priv, "\n");
return 0;
}
/*
* decoding
*/

View File

@ -373,10 +373,10 @@ DEFUN(show_forb_la, show_forb_la_cmd, "show forbidden location-area MS_NAME",
return CMD_SUCCESS;
}
#define ASCI_STR SHOW_STR "Display information about ASCI items\nName of MS (see \"show ms\")\n"
#define SHOW_ASCI_STR SHOW_STR "Display information about ASCI items\nName of MS (see \"show ms\")\n"
DEFUN(show_asci_calls, show_asci_calls_cmd, "show asci MS_NAME calls",
ASCI_STR "Display ongoing ASCI calls")
SHOW_ASCI_STR "Display ongoing ASCI calls")
{
struct osmocom_ms *ms;
@ -389,6 +389,20 @@ DEFUN(show_asci_calls, show_asci_calls_cmd, "show asci MS_NAME calls",
return CMD_SUCCESS;
}
DEFUN(show_asci_neighbors, show_asci_neighbors_cmd, "show asci MS_NAME neighbors",
SHOW_ASCI_STR "Display neigbor cells of ongoing or last ASCI call")
{
struct osmocom_ms *ms;
ms = l23_vty_get_ms(argv[0], vty);
if (!ms)
return CMD_WARNING;
gsm48_si10_dump(ms->cellsel.si, l23_vty_printf, vty);
return CMD_SUCCESS;
}
DEFUN(monitor_network, monitor_network_cmd, "monitor network MS_NAME",
"Monitor...\nMonitor network information\nName of MS (see \"show ms\")")
{
@ -2484,6 +2498,7 @@ int ms_vty_init(void)
install_element_ve(&show_forb_la_cmd);
install_element_ve(&show_forb_plmn_cmd);
install_element_ve(&show_asci_calls_cmd);
install_element_ve(&show_asci_neighbors_cmd);
install_element_ve(&monitor_network_cmd);
install_element_ve(&no_monitor_network_cmd);
install_element(ENABLE_NODE, &off_cmd);