Commit graph

77 commits

Author SHA1 Message Date
Martin Lund
16479c8d86 Cleanup 2022-09-11 11:55:19 +02:00
Martin Lund
989874ffb8 Cleanup 2022-09-10 22:39:36 +02:00
Martin Lund
dbc9a8e82d Add visual or audible alert support on connect/disconnect
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.
2022-09-10 22:33:42 +02:00
Martin Lund
ee46686fb6 Add experimental RS-485 support
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
2022-09-10 17:52:54 +02:00
Martin Lund
a58d406a3c Update list description 2022-09-08 09:32:51 +02:00
Martin Lund
fe6827bc7e Clean up man page 2022-08-30 01:11:27 +02:00
Martin Lund
e837fd0303 Add line response feature
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
2022-08-15 19:58:28 +02:00
Martin Lund
a75e04b883 Update man page 2022-08-15 11:00:47 +02:00
Martin Lund
3903880106 Rework toggle and pulse feature to support all lines
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
2022-07-19 12:54:40 +02:00
Martin Lund
5fd3bf60ba Update man page 2022-07-17 13:14:59 +02:00
Martin Lund
9733bdf19c Introduce bold color option
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.
2022-07-15 18:42:03 +02:00
Martin Lund
d510c101b4 Change 'ctrl-t T' to 'ctrl-t t' for timestamp toggle 2022-07-15 12:26:36 +02:00
Martin Lund
02729c10b1 Add support for remapping prefix key
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
2022-07-15 12:18:40 +02:00
Martin Lund
3792e10484 Update man page 2022-07-13 15:52:05 +02:00
Martin Lund
0af6c00764 Clean up man page 2022-07-11 15:16:07 +02:00
Martin Lund
360deb3c72 Add support for space parity 2022-07-11 14:55:54 +02:00
Martin Lund
bf972bd2f9 Cleanup 2022-07-11 14:15:54 +02:00
Martin Lund
39af74f263 Rename EOL delay to Output line delay 2022-07-11 14:08:12 +02:00
Martin Lund
dad6de7ee7 Update man page 2022-07-11 10:19:56 +02:00
Martin Lund
11762b2300 Replace -U,--upcase with mapping flag OLTU 2022-07-11 10:15:12 +02:00
Robert Snell
944ee9173b Additional commands: EOL delay, lower to upper translation, added mark parity
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.
2022-07-09 21:22:43 -04:00
George Joseph
f24cee61e7 Add Pulse DTR command
MCUs like the ESP32 can be reset if the serial port DTR line is
pulsed for a short time.  You could just type CTRL-t d CTRL-t d
but that's a little awkward since you have to lift your finger
off the CTRL key to type the Ds.  Now you can just type CTRL-T D.

* Added new command "D" to pulse the DTR line.  I.E.  Toggle its
  state twice with a configurable duration between toggles.

* Added new config/command line option "--dtr-pulse-duration"
  to set the duration between the DTR state toggles.  The default
  is 100ms.
2022-07-07 12:45:29 -06:00
Martin Lund
e53b69afbd Update doc 2022-07-06 16:25:15 +02:00
Martin Lund
167a19fcdd Update README 2022-07-06 15:08:35 +02:00
Martin Lund
736c1ed003 Update README 2022-07-06 14:51:25 +02:00
Martin Lund
4cb7eaf48d Update man page 2022-07-05 16:16:31 +02:00
Martin Lund
d1733fc090 Update man page 2022-07-05 16:11:57 +02:00
Martin Lund
3243dfa55c Update man page 2022-07-04 21:44:54 +02:00
Martin Lund
bd9ea4a295 Update man page 2022-07-04 20:50:10 +02:00
Martin Lund
58568ed630 Update man page 2022-07-04 15:45:28 +02:00
Martin Lund
1a9b983dcd Update man page 2022-07-03 22:29:26 +02:00
Martin Lund
4ca7375cac Update doc 2022-07-03 13:18:52 +02:00
Martin Lund
1b91fd9f69 Rename --hex-mode to --hexadecimal 2022-07-01 13:16:14 +02:00
Martin Lund
3553fc765e Update text 2022-06-30 15:20:38 +02:00
Martin Lund
538e81cbe5 Update man page 2022-06-26 00:00:36 +02:00
Martin Lund
e72a2ede76 Update man page 2022-06-21 12:26:29 +02:00
Martin Lund
574d5620b2 Update general tio description 2022-06-17 11:36:23 +02:00
Martin Lund
1f4a50cc9f Update text 2022-06-17 11:27:47 +02:00
Martin Lund
18de31a4c3 Cleanup man page 2022-06-17 11:00:42 +02:00
Martin Lund
1dabf0fdf5 Add config support for log-strip 2022-06-17 10:59:59 +02:00
Martin Lund
f48402f7ed Add config support for hex-mode 2022-06-17 10:58:55 +02:00
Martin Lund
1b2f445ed9 Rename --hex to --hex-mode 2022-06-17 10:57:29 +02:00
Martin Lund
256d6b4fc2 Merge branch 'allow_strip_esc_key' of https://github.com/nh26223/tio into nh26223-allow_strip_esc_key 2022-06-15 22:49:22 +02:00
Martin Lund
db45326d98 Rename --log-filename to --log-file 2022-06-13 23:04:30 +02:00
Martin Lund
92fbe86c49 Update man page 2022-06-12 01:27:23 +02:00
Martin Lund
fcfeb9189c Update man page 2022-06-12 01:16:41 +02:00
Martin Lund
17e96d70bc Add support for IPv4 and IPv6 network sockets
Add support for IPv4 and IPv6 network sockets via socket syntax
"inet:<port>" and "inet6:<port>" respectively.

For example, to listen and redirect serial device I/O to a host bound
IPv4 socket simply do:

 $ tio /dev/ttyUSB0 --socket inet:4444

To connect do e.g.:

 $ nc 127.0.0.1 4444

Likewise, for IPv6 do:

 $ tio /dev/ttyUSB0 --socket inet6:4444

To connect do e.g.:

 $ nc ::1 4444

If port is 0 or no port is provided default port 3333 is used.
2022-06-11 14:19:29 +02:00
Martin Lund
373dca3d5b Update README 2022-06-08 20:33:13 +02:00
Martin Lund
46b5783789 Rework color option
Rework the color option to support setting ANSI color code values
ranging from 0..255 or "none" for no color or "list" to print a list of
available ANSI colors codes.

Also, disables color when piping.
2022-06-08 16:19:47 +02:00
Martin Lund
6d007d39d7 Remove newline option in hex mode 2022-06-06 19:38:31 +02:00