aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc/bsc_ctrl_commands.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-03-23 11:17:27 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-03-23 14:05:22 +0100
commitd092f486486db4b2cb2cdc018ad3948d48a26827 (patch)
treeaae83e7b73bfec0cce82f05138df0470b49e4ece /openbsc/src/libbsc/bsc_ctrl_commands.c
parentebe55aa95a11bff56779e1354cf8f6640a1a7a9e (diff)
nitb/ctrl: Add ctrl command to set the TRX max_power_reduction
In case the BTS is connected the new attribute should be set through OML. This is left as a todo item. Addresses: SYS#267
Diffstat (limited to 'openbsc/src/libbsc/bsc_ctrl_commands.c')
-rw-r--r--openbsc/src/libbsc/bsc_ctrl_commands.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/openbsc/src/libbsc/bsc_ctrl_commands.c b/openbsc/src/libbsc/bsc_ctrl_commands.c
index a137efac6..5959d278d 100644
--- a/openbsc/src/libbsc/bsc_ctrl_commands.c
+++ b/openbsc/src/libbsc/bsc_ctrl_commands.c
@@ -151,6 +151,27 @@ oom:
}
CTRL_CMD_DEFINE(net_mcc_mnc_apply, "mcc-mnc-apply");
+/* TRX related commands below here */
+CTRL_HELPER_GET_INT(trx_max_power, struct gsm_bts_trx, max_power_red);
+CTRL_HELPER_SET_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)
+{
+ int tmp = atoi(value);
+
+ if (tmp < 0 || tmp > 22) {
+ cmd->reply = "Value must be between 0 and 22";
+ return -1;
+ }
+
+ if (tmp & 1) {
+ cmd->reply = "Value must be even";
+ return -1;
+ }
+
+ return 0;
+}
+CTRL_CMD_DEFINE(trx_max_power, "max-power-reduction");
+
int bsc_base_ctrl_cmds_install(void)
{
int rc = 0;
@@ -161,5 +182,6 @@ 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_TRX, &cmd_trx_max_power);
return rc;
}