summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/src/mobile/script_lua.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2018-08-29 08:27:03 +0100
committerHolger Freyther <holger@freyther.de>2018-09-16 13:51:29 +0000
commitb4294471684b6b56c4c93479be7e7771f5d8a676 (patch)
treee4da5d4ffd292e1047dc8e2c9e38a235c3028e6a /src/host/layer23/src/mobile/script_lua.c
parent6b8fd006d4f3f0e28f8f8b185ac2b28659faf4c0 (diff)
lua: Expose API to trigger a network reselection
Same as the "network search" VTY command but implemented as primitive and exposed to LUA. Change-Id: I096233a2ca9dd7daa358cebed0523cb8c0dbf593
Diffstat (limited to 'src/host/layer23/src/mobile/script_lua.c')
-rw-r--r--src/host/layer23/src/mobile/script_lua.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/host/layer23/src/mobile/script_lua.c b/src/host/layer23/src/mobile/script_lua.c
index 924ed6ec..9117cdd4 100644
--- a/src/host/layer23/src/mobile/script_lua.c
+++ b/src/host/layer23/src/mobile/script_lua.c
@@ -425,6 +425,16 @@ static int lua_ms_name(lua_State *L)
return 1;
}
+static int lua_reselect_network(lua_State *L)
+{
+ struct mobile_prim *prim;
+
+ prim = mobile_prim_alloc(PRIM_MOB_NETWORK_RESELECT, PRIM_OP_REQUEST);
+ mobile_prim_intf_req(get_primitive(L), prim);
+
+ return 1;
+}
+
/* Expect a fd on the stack and enable SO_PASSCRED */
static int lua_unix_passcred(lua_State *L)
{
@@ -546,6 +556,7 @@ static const struct luaL_Reg ms_funcs[] = {
{ "stop", lua_ms_shutdown },
{ "sms_send_simple", lua_ms_sms_send_simple },
{ "number", lua_ms_name },
+ { "reselect_network", lua_reselect_network },
{ NULL, NULL },
};