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

@ -29,6 +29,7 @@ color = bold
rs-485 = disable
response-wait = disable
alert = none
script-run = always
# Sub-configurations
@ -63,3 +64,10 @@ device = /dev/ttyUSB0
rs-485 = enable
rs-485-config = RTS_ON_SEND=1,RTS_AFTER_SEND=1,RTS_DELAY_BEFORE_SEND=60,RTS_DELAY_AFTER_SEND=80,RX_DURING_TX
color = 13
[esp32]
device = /dev/ttyUSB0
color = 14
script = high(DTR); low(RTS); msleep(100); low(DTR); high(RTS); msleep(100); low(RTS)
script-run = always