mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
CLuaInstMisc:: Add script function postMsg() to send a neutrino message
- Currently possible message: POSTMSG.STANDBY_ON - Set Lua api version to 1.33
This commit is contained in:
@@ -57,6 +57,7 @@ void CLuaInstMisc::LuaMiscRegister(lua_State *L)
|
||||
{ "runScript", CLuaInstMisc::runScriptExt },
|
||||
{ "GetRevision", CLuaInstMisc::GetRevision },
|
||||
{ "checkVersion", CLuaInstMisc::checkVersion },
|
||||
{ "postMsg", CLuaInstMisc::postMsg },
|
||||
{ "__gc", CLuaInstMisc::MiscDelete },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
@@ -198,6 +199,22 @@ int CLuaInstMisc::checkVersion(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int CLuaInstMisc::postMsg(lua_State *L)
|
||||
{
|
||||
lua_Integer msg = 0;
|
||||
neutrino_msg_t post_msg = 0;
|
||||
msg = luaL_checkint(L, 2);
|
||||
switch (msg) {
|
||||
case POSTMSG_STANDBY_ON:
|
||||
post_msg = NeutrinoMessages::STANDBY_ON;
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
g_RCInput->postMsg(post_msg, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CLuaInstMisc::MiscDelete(lua_State *L)
|
||||
{
|
||||
CLuaMisc *D = MiscCheckData(L, 1);
|
||||
|
Reference in New Issue
Block a user