aboutsummaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-01-11 17:25:05 +0100
committerMax <msuraev@sysmocom.de>2017-01-25 13:29:03 +0100
commitf65b57a7071acd23ed5429df71393e76907a7283 (patch)
tree6644c700fd4e1e08ac0fd1bf6972c59e3878de91 /src/common
parent871e0bec7e5218defc404b117dd6f89906c5c0da (diff)
Add ctrl command to send OML alert
Diffstat (limited to 'src/common')
-rw-r--r--src/common/bts_ctrl_commands.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/common/bts_ctrl_commands.c b/src/common/bts_ctrl_commands.c
index 6d223ff7..4efb4ee3 100644
--- a/src/common/bts_ctrl_commands.c
+++ b/src/common/bts_ctrl_commands.c
@@ -24,11 +24,15 @@
#include <errno.h>
#include <fcntl.h>
+#include <osmocom/gsm/protocol/gsm_12_21.h>
#include <osmocom/ctrl/control_cmd.h>
#include <osmo-bts/logging.h>
#include <osmo-bts/gsm_data.h>
#include <osmo-bts/tx_power.h>
+#include <osmo-bts/signal.h>
+#include <osmo-bts/oml.h>
+#include <osmo-bts/bts.h>
CTRL_CMD_DEFINE(therm_att, "thermal-attenuation");
static int get_therm_att(struct ctrl_cmd *cmd, void *data)
@@ -67,12 +71,23 @@ static int verify_therm_att(struct ctrl_cmd *cmd, const char *value, void *data)
return 0;
}
+CTRL_CMD_DEFINE_WO_NOVRF(oml_alert, "oml-alert");
+static int set_oml_alert(struct ctrl_cmd *cmd, void *data)
+{
+ /* Note: we expect signal dispatch to be synchronous */
+ osmo_signal_dispatch(SS_FAIL, OSMO_EVT_EXT_ALARM, cmd->value);
+
+ cmd->reply = "OK";
+
+ return CTRL_CMD_REPLY;
+}
int bts_ctrl_cmds_install(struct gsm_bts *bts)
{
int rc = 0;
rc |= ctrl_cmd_install(CTRL_NODE_TRX, &cmd_therm_att);
+ rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_oml_alert);
return rc;
}