diff options
-rw-r--r-- | src/common/bts_ctrl_commands.c | 15 |
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; } |