[PATCH] osmocom-bb[master]: mobile: Return the name of the configured "MS"

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/.

Holger Freyther gerrit-no-reply at lists.osmocom.org
Sun Dec 3 22:03:28 UTC 2017


Review at  https://gerrit.osmocom.org/5156

mobile: Return the name of the configured "MS"

In lua osmo.ms():name() will print the name/number of the MS. This
can be used by scripting code to use in events and then be analyzed.

Change-Id: I881d3e87daa19f4e6f4f5bd30fe95906129e60ef
---
M src/host/layer23/src/mobile/script_lua.c
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/56/5156/1

diff --git a/src/host/layer23/src/mobile/script_lua.c b/src/host/layer23/src/mobile/script_lua.c
index e63d205..1b80c48 100644
--- a/src/host/layer23/src/mobile/script_lua.c
+++ b/src/host/layer23/src/mobile/script_lua.c
@@ -389,6 +389,12 @@
 	return 1;
 }
 
+static int lua_ms_name(lua_State *L)
+{
+	lua_pushstring(L, get_primitive(L)->ms->name);
+	return 1;
+}
+
 static const struct luaL_Reg ms_funcs[] = {
 	{ "imsi", lua_ms_imsi },
 	{ "imei", lua_ms_imei },
@@ -398,6 +404,7 @@
 	{ "start", lua_ms_no_shutdown },
 	{ "stop", lua_ms_shutdown },
 	{ "sms_send_simple", lua_ms_sms_send_simple },
+	{ "number", lua_ms_name },
 	{ NULL, NULL },
 };
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I881d3e87daa19f4e6f4f5bd30fe95906129e60ef
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther <holger at freyther.de>



More information about the gerrit-log mailing list