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

@ -26,6 +26,7 @@
#include <limits.h>
#include <termios.h>
#include <sys/param.h>
#include "script.h"
#include "timestamp.h"
#include "alert.h"
@ -69,6 +70,9 @@ struct option_t
int32_t rs485_delay_rts_after_send;
enum alert_t alert;
bool complete_sub_configs;
const char *script;
const char *script_filename;
enum script_run_t script_run;
};
extern struct option_t option;
@ -78,3 +82,4 @@ void options_parse(int argc, char *argv[]);
void options_parse_final(int argc, char *argv[]);
void line_pulse_duration_option_parse(const char *arg);
enum script_run_t script_run_option_parse(const char *arg);