Commit graph

163 commits

Author SHA1 Message Date
Robert Snell
f459a462c5 Fixed indentation in configfile.c, tty.c, options.c 2022-07-10 18:14:29 -04: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
732c0c3f89 Add '24hour-delta' timestamp option
When enabled this option will timestamp new lines with the time elapsed
since the line before.

This is a very useful feature to identify which events takes the most
time.
2022-07-05 16:05:38 +02:00
Martin Lund
a3f5f6414b Cleanup 2022-07-04 12:00:24 +02:00
Martin Lund
98c96dba52 Enable buffered writing
Read block of bytes from input and process same block for output.  This
will speed things up by reducing I/O overhead.
2022-06-24 17:21:17 +02:00
Martin Lund
d522527c49 Enable buffered reading
Read block of bytes from input and process byte by byte for output. This
will speed things up by reducing I/O overhead.
2022-06-24 17:18:08 +02:00
Martin Lund
4e08c68533 Refactoring 2022-06-24 00:17:45 +02:00
Martin Lund
941e8d5b04 Cleanup 2022-06-23 20:47:07 +02:00
Martin Lund
a947985651 Optimization 2022-06-22 21:27:11 +02:00
Martin Lund
ac25e7434c Cleanup 2022-06-22 11:23:57 +02:00
Martin Lund
a0f3f9d9b7 Cleanup stdout flushing
Flushing is not needed since we disabled buffering of stdout.
2022-06-22 01:03:59 +02:00
Martin Lund
4c611e6767 Cleanup log code 2022-06-22 00:22:18 +02:00
Martin Lund
c82b7e2ecc Cleanup 2022-06-21 22:32:24 +02:00
Martin Lund
3d65e62e52 Simplify stdout_configure() code 2022-06-21 19:28:04 +02:00
Martin Lund
f62e2f972b Simplify stdin_configure() code 2022-06-21 19:19:05 +02:00
Martin Lund
dba77eb912 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
2022-06-16 21:03:53 +02:00
Martin Lund
1e8c950e9d Update text 2022-06-16 11:15:32 +02:00
Martin Lund
63d3232b32 Improve key command response for local echo and timestamp 2022-06-12 04:07:17 +02:00
Martin Lund
c66017f287 Fix invalid hex character error message 2022-06-12 02:31:48 +02:00
Martin Lund
0a892006ea Unify error message formating 2022-06-11 23:36:51 +02:00
Martin Lund
77ff1e5269 Remove debug 2022-06-07 10:01:26 +02:00
Martin Lund
0a22142957 Update README 2022-06-07 07:27:11 +02:00
Martin Lund
989efeae88 Remove print of hex mode status at startup 2022-06-06 20:08:05 +02:00
Martin Lund
6d007d39d7 Remove newline option in hex mode 2022-06-06 19:38:31 +02:00
g0mb4
0b55981e52 Extended hexadecimal mode.
While in hex mode (ctrl-t h) you can output hexadecimal values.
E.g.: to send 0x0A you have to type 0A (always 2 characters).

Added option -x, --hex to start in hexadecimal mode.

Added option --newline-in-hex to interpret newline characters in hex mode.
This is disabled by default, because, in my opinion, hex stream is
fundamentally different from text, so a "new line" is meaningless in this
context.
2022-06-06 19:10:00 +02:00
Martin Lund
be2c682da6 Convert errors to warnings 2022-06-02 20:51:23 +02:00
Martin Lund
8da06ebf2c Fix typo 2022-05-15 20:21:58 +02:00
Peter Collingbourne
fb453160ef Add support for external control via a Unix domain socket.
This feature allows an external program to inject output into and
listen to input from a serial port via a Unix domain socket (path
specified via the -S/--socket command line flag, or the socket
config file option) while tio is running. This is useful for ad-hoc
scripting of serial port interactions while still permitting manual
control. Since many serial devices (at least on Linux) get confused
when opened by multiple processes, and most commands do not know
how to correctly open a serial device, this allows a more convenient
usage model than directly writing to the device node from an external
program.

Any input from clients connected to the socket is sent on the serial
port as if entered at the terminal where tio is running (except that
ctrl-t sequences are not recognized), and any input from the serial
port is multiplexed to the terminal and all connected clients.

Sockets remain open while the serial port is disconnected, and writes
will block.

Example usage 1 (issue a command):

  echo command | nc -UN /path/to/socket > /dev/null

Example usage 2 (use the expect command to script an interaction):

  #!/usr/bin/expect -f

  set timeout -1
  log_user 0

  spawn nc -UN /path/to/socket
  set uart $spawn_id

  send -i $uart "command1\n"
  expect -i $uart "prompt> "
  send -i $uart "command2\n"
  expect -i $uart "prompt> "
2022-04-18 14:06:33 -07:00
Martin Lund
28c880cdab Remove verbose option
Remove the command-line verbose option but let the ctrl-t c feature
print some of the verbose information (active config path/section).
2022-04-13 16:28:30 +02:00
Sylvain LAFRASSE
a543fbd7ef Factorize timestamp parsing to be coherent with command line format in configuration file. 2022-03-30 17:11:50 +02:00
Martin Lund
8965b7b42c Update headers 2022-03-11 15:15:39 +01:00
Martin Lund
b23397caa0 Fix text 2022-02-25 07:16:14 +01:00
Martin Lund
166d36d7d4 Correct text 2022-02-23 15:35:46 +01:00
Martin Lund
7ffeeccdf5 Merge branch 'osx-baudrate' of https://github.com/robey/tio into robey-osx-baudrate 2022-02-16 05:24:35 +01:00
Sylvain LAFRASSE
2d1e0f1233
Fix TTY device listing on Darwin. (#136) 2022-02-15 11:15:39 +01:00
Martin Lund
0e62995e6e Only apply color formatting when using color option
To help the color blind who may use custom terminal foreground /
background colors.
2022-02-15 00:48:10 +01:00
Martin Lund
274cb63197 Add '-c, --color' option
Allow user to select which ANSI color code to use to colorize the tio
text. To successfully set the color the color code must be in the range
0..255.

If color code is negative tio will print all available ANSI colors.

The default color is changed to bold white to make tio defaults usable
for most users, including color blind users.
2022-02-14 22:25:29 +01:00
Martin Lund
137b2823af Update headers 2022-02-13 06:35:03 +01:00
Martin Lund
2375bc0c7b Show auto connect status in show configuration 2022-02-13 05:46:31 +01:00
Martin Lund
5d031a51f9 Cleanup 2022-02-13 02:13:43 +01:00
Martin Lund
b6eac3f001 Improve printed output
Get rid of inconsistencies in the printed output (error printing,
colors, etc.).

Prepare for user configurable color.

Cleanup.
2022-02-12 22:47:42 +01:00
Martin Lund
16836de0e5 Update text 2022-02-12 04:27:09 +01:00
Martin Lund
e9208d693e Replace autotools with meson
To introduce much simpler build configuration which is also easier to
maintain.
2022-02-10 05:09:32 +01:00
Martin Lund
7a2a18232d Add list serial devices feature
For convenience, add a --list-devices option which lists the available
serial devices.
2022-02-08 23:13:34 +01:00
attila-v
65153c0d03
Refine timestamps with milliseconds and ISO-8601 format (#129).
* Show milliseconds too in the timestamp (#114) and log file (#124)
* Change timestamp format to ISO-8601.
Co-authored-by: Attila Veghelyi <aveghelyi@dension.com>
Co-authored-by: Sylvain LAFRASSE <sly74fr@users.noreply.github.com>
2022-02-07 17:18:36 +01:00
Sylvain LAFRASSE
febefa638f
Merge pull request #80 from marmidr/crlf
Newline: handle booth NL and CR
2022-02-02 17:36:01 +01:00
Robey Pointer
aa9f121a12 add support for high bps on OS X 2021-04-06 15:50:59 -07:00
Yin Fengwei
0f0279bd3f Output newline on stdout with hex print mode
This is to fix the issue #104. The timestamp will always be
printed at the beginning of line:

[10:25:56] Switched to hexadecimal mode
0d 0a 0d [10:25:57] 41 43 52 4e 3a 5c 3e 0d 0a 0d [10:25:58] 41

is changed to:

[12:34:56] 45 72 72 6f 72 3a 20 49 6e 76 61 6c 69 64 20
[12:34:56] 41 43 52 4e 3a 5c 3e
[12:34:56] 41 43 52 4e 3a 5c 3e
[12:34:57] 41 43 52 4e 3a 5c 3e 6c 73
2021-01-21 12:39:51 +08:00
Martin Lund
a4da50dbd8
Merge pull request #105 from zagor/show-error
Show error when failing to open a tty
2021-01-18 01:16:41 +01:00