Add ctrl command to send OML alert

Change-Id: I228cb71ab945e19e3747843469a52f577ee32f97
Related: OS#1615
This commit is contained in:
Max 2017-01-11 17:25:05 +01:00
parent 871e0bec7e
commit f65b57a707
1 changed files with 15 additions and 0 deletions

View File

@ -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;
}