[PATCH] osmo-bts[master]: Add ctrl command to send OML alert

Max gerrit-no-reply at lists.osmocom.org
Wed Jan 25 12:29:25 UTC 2017


Hello Harald Welte, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/1575

to look at the new patch set (#6).

Add ctrl command to send OML alert

Change-Id: I228cb71ab945e19e3747843469a52f577ee32f97
Related: OS#1615
---
M src/common/bts_ctrl_commands.c
1 file changed, 15 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/75/1575/6

diff --git a/src/common/bts_ctrl_commands.c b/src/common/bts_ctrl_commands.c
index 6d223ff..4efb4ee 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 @@
 	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;
 }

-- 
To view, visit https://gerrit.osmocom.org/1575
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I228cb71ab945e19e3747843469a52f577ee32f97
Gerrit-PatchSet: 6
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder


More information about the gerrit-log mailing list