Added reset_buffer()

This commit is contained in:
Davis C 2024-04-17 09:21:20 -05:00 committed by Martin Lund
parent 98653566a8
commit 794c5202f4
3 changed files with 14 additions and 0 deletions

View file

@ -256,6 +256,14 @@ bool match_regex(regex_t *regex)
return false;
}
// lua: reset_buffer()
static int reset_buffer(lua_State *L)
{
(void)L;
buffer_size = 0;
return 1;
}
// lua: expect(string, timeout)
static int expect(lua_State *L)
{
@ -352,6 +360,7 @@ static const struct luaL_Reg tio_lib[] =
{ "modem_send", modem_send},
{ "send", send},
{ "expect", expect},
{ "reset_buffer", reset_buffer},
{ "exit", exit_},
{NULL, NULL}
};