Replaces -x, --hexadecimal option with --intput-mode and --output-mode
so it is possible to select hex or normal mode for both input and output
independently.
To obtain same behaviour as -x, --hexadecimal use the following
configuration:
input-mode = hex
output-mode = hex
On some platforms calling high()/low() to switch line states result in
costly system calls whick makes it impossible to swith two or more tty
lines simultaneously.
To help solve this timing issue we introduce a tty line state
configuration API which can be used instead of using
high()/low().
Using config_low(line) and config_high(line) one can set up a new line
state configuration for multiple lines and then use config_apply() to
finally apply the configuration. This will result in only one system
call to instruct the serial port drive to switch all the configured line
states which should help ensure that the lines are switched
simultaneously.
Example:
script = config_high(DTR); config_low(RTS); config_apply()
Add ONULBRK mapping to map nul (zero) to send break signal on output.
This is useful if one needs to e.g. send the break signal to the tty
device when connected via socket.
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.
Add --log-append option which makes tio append to any existing log file.
This also changes the default behaviour of tio from appending to
overwriting any existing log file. Now you have to use this new option
to make tio append.
The response wait feature waited for a line response, a string
terminated with either CR or NL. However, some devices may send a CR and
then their line content and then NL. This means tio will quit before
receiving and printing the line response. To solve this we simply ignore
the CR character and only consider lines terminated with a NL character.
This should work for all devices as lines are AFAIK always terminated
with either CRNL or a NL.
Accept "true", "enable", "on", "yes", "1" as true values, their
counterparts as false ones. Check integer values for errors and range.
Warn about ignored (e.g. misspelled) options.
Check getenv() return value for NULL.
Rename "tiorc" to "config", as it's a static INI file, not an executable
"run commands".
Add key command 'ctrl-t f' which will toggle log on/off.
If no log filename has been specified via the 'log-filename' option then
tio will automatically generate a new log filename every time the log
feature is toggled on. Meaning, when toggled multiple times, multiple
log files will be generated.
However, if a log filename has been specified, tio will only write and
append to that same file.
The feature is detailed via the following option:
--alert none|bell|blink
Set alert action on connect/disconnect.
It will sound the bell once or blink once on successful connect.
Likewise it will sound the bell twice or blink twice on disconnect.
Default value is "none" for no alert.
Many modern RS-485 serial devices such as the ones from FTDI already
operate in RS-485 mode by default and will work with tio out of the box.
However, there are some RS-232/485 devices which need to be switched
from e.g. RS-232 to RS-485 mode to operate accordingly on the physical
level.
This commit implements the switching mechanism and interface required to
enable RS-485 mode. It only works on Linux and with serial devices which
use device drivers that support the Linux RS-485 control interface.
The RS-485 feature is detailed via the following options:
--rs-485 Enable RS-485 mode
--rs-485-config <config> Set RS-485 configuration
Set the RS-485 configuration using the following key or key value pair
format in the configuration field:
RTS_ON_SEND=value Set logical level (0 or 1) for RTS pin when sending
RTS_AFTER_SEND=value Set logical level (0 or 1) for RTS pin after sending
RTS_DELAY_BEFORE_SEND=value Set RTS delay (ms) before sending
RTS_DELAY_AFTER_SEND=value Set RTS delay (ms) after sending
RX_DURING_TX Receive data even while sending data
If defining more than one key or key value pair, they must be comma
separated.
Example use:
$ tio /dev/ttyUSB0 --rs-485 --rs-r485-config=RTS_DELAY_AFTER_SEND=50,RX_DURING_TX
Add a simple line response feature to make it possible to send e.g. a
command string to your serial device and easily receive and parse a line
response.
This is a convenience feature for simple request/response interaction
based on lines. For more advanced interaction the socket feature should
be used instead.
The line response feature is detailed via the following options:
-r, --response-wait
Wait for line response then quit. A line is considered any string ending
with either CR or NL character. If no line is received tio will quit
after response timeout.
Any tio text is automatically muted when piping a string to tio while in
response mode to make it easy to parse the response.
--response-timeout <ms>
Set timeout [ms] of line response (default: 100).
Example:
Sending a string (SCPI command) to a test instrument (Korad PSU) and
print line response:
$ echo "*IDN?" | tio /dev/ttyACM0 --response-wait
KORAD KD3305P V4.2 SN:32477045
Replace existing toggle and pulse key commands with the following
generalized key commands which allows to toggle or pulse all serial port
lines:
ctrl-t g Toggle serial port line
ctrl-t p Pulse serial port line
When used, user will be asked which serial line to toggle or pulse.
Also introduce --line-pulse-duration option for setting specific pulse
duration in milliseconds for each serial line using a key value pair
format. Each key represents a serial line. The following keys are
available: DTR, RTS, CTS, DSR, DCD, RI.
Example:
$ tio /dev/ttyUSB0 --line-pulse-duration DTR=200,RTS=300,RI=50
Likewise, the pulse duration can also be set via configuration file
using the line-pulse-duration variable:
line-pulse-duration = DTR=200,RTS=300,RI=50
Introduce "bold" color option which only apply bold color formatting to
existing system color.
Also make "bold" the default color option.
Fixes all white issue with black on white tio text.
Make it possible to remap the prefix key (default: ctrl-t) by setting
the prefix-ctrl-key variable in the configuration file.
Allowed values are in the range a..z.
Example, to set the prefix key to ctrl-a simply do:
prefix-ctrl-key = a
Added command line options:
-O, --eol-delay to have a separate delay for end of line
-U, --upper to enable translation of lower case alpha to upper case
Added ability to set mark parity.
Added ctrl-t U key sequence to allow enable/disable lower case alpha to
upper case during a session.
Updated Man page with command line options, ctrl-t sequences and
configuration file options.
Updated README.md, with above information.