Add Lua scripting feature

Add support for running Lua scripts that can manipulate the tty control
lines. Script is activated automatically on connect or manually via in
session key command.

The Lua scripting feature opens up for many posibilities in the future
such as adding expect like functionality to easily and programatically
interact with the connected device.
This commit is contained in:
Martin Lund 2024-04-01 15:37:25 +02:00
parent 6fee8514f4
commit 0becfa3274
12 changed files with 590 additions and 72 deletions

View file

@ -23,6 +23,9 @@
#include <stdbool.h>
#define LINE_HIGH true
#define LINE_LOW false
extern bool interactive_mode;
extern bool map_i_nl_cr;
extern bool map_i_cr_nl;
@ -36,3 +39,5 @@ void tty_wait_for_device(void);
void list_serial_devices(void);
void tty_input_thread_create(void);
void tty_input_thread_wait_ready(void);
void tty_line_set(int fd, const char *name, int mask, bool value);
void tty_line_toggle(int fd, const char *name, int mask);