mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 00:41:09 +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
Origin commit data
------------------
Branch: ni/coolstream
Commit: 37e8c328c5
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2015-12-15 (Tue, 15 Dec 2015)
------------------
This commit was generated by Migit
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