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

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Max gerrit-no-reply at lists.osmocom.org
Wed Jan 11 17:59:54 UTC 2017


Hello Jenkins Builder,

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

    https://gerrit.osmocom.org/1575

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

Add ctrl command to send OML alert

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


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

diff --git a/src/common/bts_ctrl_commands.c b/src/common/bts_ctrl_commands.c
index 6d223ff..d79d14b 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,26 @@
 	return 0;
 }
 
+CTRL_CMD_DEFINE_WO_NOVRF(oml_alert, "oml-alert");
+static int set_oml_alert(struct ctrl_cmd *cmd, void *data)
+{
+	char *rep = talloc_strdup(tall_bts_ctx, cmd->value);
+	if (!rep) {
+		cmd->reply = "Not enough memory";
+		return CTRL_CMD_ERROR;
+	}
+	osmo_signal_dispatch(SS_FAIL, OSMO_EVT_EXT_ALARM, rep);
+	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: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list