summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2017-12-03 22:01:50 +0000
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2017-12-03 22:01:50 +0000
commit238df986b9c705392898f74271c3258c16ffe927 (patch)
treeca9cf44445790d211e6b714479ac92cda40aaaf9
parenta0fc36f859fcfd089c0490648a92d66c0928ecca (diff)
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
-rw-r--r--src/host/layer23/src/mobile/script_lua.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/host/layer23/src/mobile/script_lua.c b/src/host/layer23/src/mobile/script_lua.c
index e63d205a..1b80c485 100644
--- a/src/host/layer23/src/mobile/script_lua.c
+++ b/src/host/layer23/src/mobile/script_lua.c
@@ -389,6 +389,12 @@ static int lua_ms_sms_send_simple(lua_State *L)
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 @@ static const struct luaL_Reg ms_funcs[] = {
{ "start", lua_ms_no_shutdown },
{ "stop", lua_ms_shutdown },
{ "sms_send_simple", lua_ms_sms_send_simple },
+ { "number", lua_ms_name },
{ NULL, NULL },
};