summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Kluchnikov <kluchnikovi@gmail.com>2014-04-11 14:21:41 +0400
committerIvan Kluchnikov <kluchnikovi@gmail.com>2014-05-06 15:40:30 +0400
commitf76ec6c87b9b088662003df07398075e7bfeef94 (patch)
tree2b806aa6dc3a203503ad53e030df5c943891cee9
parente4448ac1496ff19e38709d897b4ba97e8626837d (diff)
nitb/ctrl: Add ctrl command to get/set arfcn
-rw-r--r--openbsc/src/libbsc/bsc_ctrl_commands.c2
-rw-r--r--openbsc/tests/ctrl_test_runner.py15
2 files changed, 17 insertions, 0 deletions
diff --git a/openbsc/src/libbsc/bsc_ctrl_commands.c b/openbsc/src/libbsc/bsc_ctrl_commands.c
index bbd4fbd54..d1edf2903 100644
--- a/openbsc/src/libbsc/bsc_ctrl_commands.c
+++ b/openbsc/src/libbsc/bsc_ctrl_commands.c
@@ -253,6 +253,7 @@ static int set_trx_max_power(struct ctrl_cmd *cmd, void *_data)
return get_trx_max_power(cmd, _data);
}
CTRL_CMD_DEFINE(trx_max_power, "max-power-reduction");
+CTRL_CMD_DEFINE_RANGE(trx_arfcn, "arfcn", struct gsm_bts_trx, arfcn, 0, 1023);
int bsc_base_ctrl_cmds_install(void)
{
@@ -268,5 +269,6 @@ int bsc_base_ctrl_cmds_install(void)
rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_band);
rc |= ctrl_cmd_install(CTRL_NODE_TRX, &cmd_trx_max_power);
+ rc |= ctrl_cmd_install(CTRL_NODE_TRX, &cmd_trx_arfcn);
return rc;
}
diff --git a/openbsc/tests/ctrl_test_runner.py b/openbsc/tests/ctrl_test_runner.py
index 243ac0f15..0dc9800f0 100644
--- a/openbsc/tests/ctrl_test_runner.py
+++ b/openbsc/tests/ctrl_test_runner.py
@@ -399,6 +399,21 @@ class TestCtrlNITB(TestCtrlBase):
self.assertEquals(r['mtype'], 'ERROR')
self.assertEquals(r['error'], 'Value failed verification.')
+ def testTrxArfcn(self):
+ r = self.do_set('bts.0.trx.0.arfcn', '51')
+ self.assertEquals(r['mtype'], 'SET_REPLY')
+ self.assertEquals(r['var'], 'bts.0.trx.0.arfcn')
+ self.assertEquals(r['value'], '51')
+
+ r = self.do_get('bts.0.trx.0.arfcn')
+ self.assertEquals(r['mtype'], 'GET_REPLY')
+ self.assertEquals(r['var'], 'bts.0.trx.0.arfcn')
+ self.assertEquals(r['value'], '51')
+
+ r = self.do_set('bts.0.trx.0.arfcn', '3000')
+ self.assertEquals(r['mtype'], 'ERROR')
+ self.assertEquals(r['error'], 'Input not within the range')
+
def testSubscriberAddRemove(self):
r = self.do_set('subscriber-modify-v1', '2620345,445566')
self.assertEquals(r['mtype'], 'SET_REPLY')