diff options
author | Max <msuraev@sysmocom.de> | 2016-06-15 17:55:21 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2016-06-16 13:39:42 +0000 |
commit | ecd5bc2aefe8611795229980105de2f0bc4e092a (patch) | |
tree | 7c937185188fae930f865eb1198e72eedbef8ab6 /src/osmo-bts-trx/trx_vty.c | |
parent | 7cc3c3156ef23500612724f8a38c3db95c05702b (diff) |
TRX: Add vty command to power on/off transceiver
Add vty command (under "phy X instance Y" hierarchy) to manually send
POWERON or POWEROFF command. It's useful for debugging issues related to
BTS/TRX initialization.
Change-Id: I6dfebaf118cdf5ad144516b2b839b17350a73ce4
Related: OS#1648
Diffstat (limited to 'src/osmo-bts-trx/trx_vty.c')
-rw-r--r-- | src/osmo-bts-trx/trx_vty.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index d2feea4c..3aec8bae 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -273,6 +273,24 @@ DEFUN(cfg_phyinst_slotmask, cfg_phyinst_slotmask_cmd, return CMD_SUCCESS; } +DEFUN(cfg_phy_power_on, cfg_phy_power_on_cmd, + "osmotrx power (on|off)", + OSMOTRX_STR + "Change TRX state\n" + "Turn it ON or OFF\n") +{ + struct phy_instance *pinst = vty->index; + struct trx_l1h *l1h = pinst->u.osmotrx.hdl; + + if (strcmp(argv[0], "on")) + vty_out(vty, "OFF: %d%s", trx_if_cmd_poweroff(l1h), VTY_NEWLINE); + else { + vty_out(vty, "ON: %d%s", trx_if_cmd_poweron(l1h), VTY_NEWLINE); + settsc_enabled = 1; + } + + return CMD_SUCCESS; +} DEFUN(cfg_phy_fn_advance, cfg_phy_fn_advance_cmd, "osmotrx fn-advance <0-30>", @@ -499,6 +517,7 @@ int bts_model_vty_init(struct gsm_bts *bts) install_element(PHY_NODE, &cfg_phy_no_tx_atten_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_slotmask_cmd); + install_element(PHY_INST_NODE, &cfg_phy_power_on_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_maxdly_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_no_maxdly_cmd); |