|
|
@ -631,11 +631,32 @@ static int func_xtty_set_volume(lua_State *L) |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
static int func_xtty_cmd(lua_State *L) |
|
|
|
{ |
|
|
|
int cmd, rw, subtype; |
|
|
|
const char *dt = NULL; |
|
|
|
size_t len = 0; |
|
|
|
int r; |
|
|
|
|
|
|
|
cmd = luaL_checkinteger(L, 1); /* cmd code */ |
|
|
|
rw = luaL_checkinteger(L, 2); /* rw code */ |
|
|
|
subtype = luaL_checkinteger(L, 3); /* subtype code */ |
|
|
|
|
|
|
|
if (lua_gettop(L) >= 4) { |
|
|
|
dt = luaL_checklstring(L, 4, &len); |
|
|
|
} |
|
|
|
|
|
|
|
r = xtty_cmd_generic(cmd, rw, subtype, dt, len); |
|
|
|
lua_pushboolean(L, r == 0); |
|
|
|
return 1; |
|
|
|
} |
|
|
|
|
|
|
|
static int luaopen_xtty(lua_State *L) |
|
|
|
{ |
|
|
|
static luaL_Reg funcs[] = { |
|
|
|
{"init", func_xtty_init}, |
|
|
|
{"exit", func_xtty_exit}, |
|
|
|
{"cmd", func_xtty_cmd}, |
|
|
|
{"set_ingress", func_xtty_ingress}, |
|
|
|
{"set_channel", func_xtty_set_channel}, |
|
|
|
{"set_freq", func_xtty_set_freq}, |
|
|
|