summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2013-02-22 10:52:35 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-03-06 23:05:13 +0100
commitd33b5e1a6575ac4c9469a40e212c7b647efa1671 (patch)
treebbb26e849e5d8b713e7a50eff7a51711538001ff
parentde72ee96d944a2556634d9d6b1d8f6f6a531050e (diff)
nitb: Add ctrl command to set the TRX max_power_reduction
-rw-r--r--openbsc/src/libbsc/bsc_ctrl_commands.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/openbsc/src/libbsc/bsc_ctrl_commands.c b/openbsc/src/libbsc/bsc_ctrl_commands.c
index c7b9323b6..8708b8204 100644
--- a/openbsc/src/libbsc/bsc_ctrl_commands.c
+++ b/openbsc/src/libbsc/bsc_ctrl_commands.c
@@ -372,6 +372,29 @@ error:
CTRL_CMD_RAW(bts_t200, "t200", bts_t200_get, bts_t200_set, bts_t200_verify);
+/* 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, "bs-power-reduction");
+
+
+
int bsc_base_ctrl_cmds_install(void)
{
int rc = 0;
@@ -405,5 +428,6 @@ int bsc_base_ctrl_cmds_install(void)
rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_neighbor_del);
rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_t200);
+ rc |= ctrl_cmd_install(CTRL_NODE_TRX, &cmd_trx_max_power);
return rc;
}