aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-11-10 11:41:03 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-11-10 11:41:03 +0100
commit054bc24e6dc700d4b8e8eec647cbead63454671e (patch)
tree9235c6dadcb447ffb847f9335eae59a0e0fd60af
parent74b2028167ddf04a867ae9f269bfa3435c93f252 (diff)
bts: Allow to set the LAC through the CTRL interface
Allow to set the LAC of the BTS through the CTRL interface. The change will not be effective immediately. Fixes: SYS#738
-rw-r--r--openbsc/src/libbsc/bsc_ctrl_commands.c5
-rw-r--r--openbsc/tests/ctrl_test_runner.py20
2 files changed, 25 insertions, 0 deletions
diff --git a/openbsc/src/libbsc/bsc_ctrl_commands.c b/openbsc/src/libbsc/bsc_ctrl_commands.c
index 3cd0ee379..64f78636e 100644
--- a/openbsc/src/libbsc/bsc_ctrl_commands.c
+++ b/openbsc/src/libbsc/bsc_ctrl_commands.c
@@ -153,6 +153,9 @@ oom:
}
CTRL_CMD_DEFINE(net_mcc_mnc_apply, "mcc-mnc-apply");
+/* BTS related commands below */
+CTRL_CMD_DEFINE_RANGE(bts_lac, "location-area-code", struct gsm_bts, location_area_code, 0, 65535);
+
/* TRX related commands below here */
CTRL_HELPER_GET_INT(trx_max_power, struct gsm_bts_trx, max_power_red);
static int verify_trx_max_power(struct ctrl_cmd *cmd, const char *value, void *_data)
@@ -203,6 +206,8 @@ int bsc_base_ctrl_cmds_install(void)
rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_apply_config);
rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_mcc_mnc_apply);
+ rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_lac);
+
rc |= ctrl_cmd_install(CTRL_NODE_TRX, &cmd_trx_max_power);
return rc;
}
diff --git a/openbsc/tests/ctrl_test_runner.py b/openbsc/tests/ctrl_test_runner.py
index b50e93c51..aae9df5cc 100644
--- a/openbsc/tests/ctrl_test_runner.py
+++ b/openbsc/tests/ctrl_test_runner.py
@@ -176,6 +176,26 @@ class TestCtrlBSC(TestCtrlBase):
self.assertEquals(r['mtype'], 'ERROR')
self.assertEquals(r['error'], 'Error while resolving object')
+ def testBtsLac(self):
+ r = self.do_get('bts.0.location-area-code')
+ self.assertEquals(r['mtype'], 'GET_REPLY')
+ self.assertEquals(r['var'], 'bts.0.location-area-code')
+ self.assertEquals(r['value'], '1')
+
+ r = self.do_set('bts.0.location-area-code', '23')
+ self.assertEquals(r['mtype'], 'SET_REPLY')
+ self.assertEquals(r['var'], 'bts.0.location-area-code')
+ self.assertEquals(r['value'], '23')
+
+ r = self.do_get('bts.0.location-area-code')
+ self.assertEquals(r['mtype'], 'GET_REPLY')
+ self.assertEquals(r['var'], 'bts.0.location-area-code')
+ self.assertEquals(r['value'], '23')
+
+ r = self.do_set('bts.0.location-area-code', '-1')
+ self.assertEquals(r['mtype'], 'ERROR')
+ self.assertEquals(r['error'], 'Input not within the range')
+
def testTrxPowerRed(self):
r = self.do_get('bts.0.trx.0.max-power-reduction')
self.assertEquals(r['mtype'], 'GET_REPLY')