Enter non-interactive mode when piping to tio

Add support for a non interactive mode which allows other application to
pipe data to tio which then forwards the data to the connected serial
device.

Non ineractive means that tio does not react to interactive key commands
in the incoming stream. This allows users to pipe binary data directly
to the connected serial device.

Example use:

$ cat commands.txt | tio /dev/ttyUSB0
This commit is contained in:
Martin Lund 2022-06-16 21:03:33 +02:00
parent a37ad26a88
commit dba77eb912
3 changed files with 27 additions and 9 deletions

View file

@ -21,6 +21,8 @@
#pragma once
#include <stdbool.h>
#define KEY_QUESTION 0x3f
#define KEY_B 0x62
#define KEY_C 0x63
@ -48,3 +50,5 @@ void tty_configure(void);
int tty_connect(void);
void tty_wait_for_device(void);
void list_serial_devices(void);
extern bool interactive_mode;