]> git.sur5r.net Git - tio/commitdiff
New upstream version 1.43 upstream/1.43
authorJakob Haufe <sur5r@debian.org>
Sun, 10 Jul 2022 13:59:34 +0000 (13:59 +0000)
committerJakob Haufe <sur5r@debian.org>
Sun, 10 Jul 2022 13:59:34 +0000 (13:59 +0000)
15 files changed:
AUTHORS
ChangeLog [deleted file]
NEWS [new file with mode: 0644]
README.md
TODO
images/tio-demo.gif
man/tio.1.in
meson.build
src/bash-completion/tio.in
src/configfile.c
src/misc.c
src/options.c
src/options.h
src/tty.c
src/tty.h

diff --git a/AUTHORS b/AUTHORS
index 2d546868dbe1f9bbddb43c5aea1649952563c33f..525446a83c774bf7407d6fa5f3126c18392af7da 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -35,5 +35,6 @@ Liam Beguin <liambeguin@gmail.com>
 Peter Collingbourne <pcc@google.com>
 g0mb4 <gomba007@gmail.com>
 ZeroMemoryEx on GitHub
+George Joseph <g.devel@wxy78.net>
 
 Thanks to everyone who has contributed to this project.
diff --git a/ChangeLog b/ChangeLog
deleted file mode 100644 (file)
index 46d9e6a..0000000
--- a/ChangeLog
+++ /dev/null
@@ -1,1274 +0,0 @@
-=== tio v1.42 ===
-
-
-
-Changes since tio v1.41:
-
- * Update man page
-
-ZeroMemoryEx:
-
- * Handle malloc failure
-
-Sylvain LAFRASSE:
-
- * Add missing 'string.h' include.
-
-
-
-Changes since tio v1.40:
-
- * Rename --hex-mode to --hexadecimal
-
- * 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.
-
- * 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.
-
- * Refactoring
-
- * Cleanup stdout flushing
-
-   Flushing is not needed since we disabled buffering of stdout.
-
- * Simplify stdout_configure() code
-
- * Simplify stdin_configure() code
-
- * Update man page
-
- * Update README
-
-
-
-Changes since tio v1.39:
-
- * Add config support for log-strip
-
- * Add config support for hex-mode
-
- * Rename --hex to --hex-mode
-
- * Fix completion for -e, --local-echo
-
- * Ignore newlines in hex output
-
- * Fix newline in warning_printf()
-
- * Fix ansi_printf_raw() in no color mode
-
- * 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
-
- * Also strip backspace from log
-
-   To make log strip feature consistent so that we remove all unprintable
-   control characters and escape sequences.
-
- * Socket code cleanup
-
- * Cleanup man page
-
- * Rename --log-filename to --log-file
-
-Yin Fengwei:
-
- * Allow strip escape sequence characters from log file
-
-   The log without escape key stripped is like:
-
-    ^M[12:47:17] ACRN:\>
-    ^M[12:47:17] ACRN:\>lasdfjklsdjf
-    ^M
-    ^M[12:47:18] Error: Invalid command.
-    ^M[12:47:19] ACRN:\>
-    ^M[12:47:26] ACRN:\>
-    ^M[12:47:26] ACRN:\>sdafkljsdkaljfklsadjflksdjafjsda^H ^H^H...
-    ^M
-    ^M[12:47:31] Error: Invalid command.
-
-   After strip escape key, the log is like:
-
-    [12:49:18] ACRN:\>
-    [12:49:19] ACRN:\>
-    [12:49:19] ACRN:\>ls
-
-    [12:49:19] Error: Invalid command.
-    [12:49:19] ACRN:\>
-    [12:49:19] ACRN:\>dfaslhj
-
-    [12:49:24] Error: Invalid command.
-
-   Beside escape key, it also handle backspace key as well.
-
-
-
-Changes since tio v1.38:
-
- * Improve key command response for local echo and timestamp
-
- * Fix invalid hex character error message
-
- * Make sure only matched config section is parsed
-
- * Add support for "disable" keyword in config file
-
- * Unify error message formating
-
- * Cleanup list devices code
-
- * Fix command-line tty-device|config parsing
-
-   Allow user to add options on both sides of the provided config argument.
-
-   For example:
-
-    $ tio -b 9600 am64-evm -e
-
-   Before, tio only allowed adding arguments after the config argument.
-
-   Implemented as simple as possible by introducing two stage option parsing.
-
- * Update bash completion
-
- * 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.
-
- * Fix tio deleting unix socket file
-
-   If tio has a unix file socket open, a second tio instance of tio may
-   delete the socket file. This change fixes so that it will not be deleted
-   and tio will instead error and complain about conflicting socket file.
-
- * 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.
-
- * Remove print of hex mode status at startup
-
- * Remove newline option in hex mode
-
- * Fix configfile memory leaks
-
- * Remove command-line option inconsistencies
-
-   Optional arguments, as parsed by the getopt_long mechanism, are
-   inherently inconsistent with how you define required arguments.
-
-   To avoid confusion we decide to avoid this inconsistency by replacing
-   optional options with additional options with required argmuments.
-
- * Replace '1' with 'enable' in config files
-
- * Convert errors to warnings
-
-g0mb4:
-
- * 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.
-
-
-
-Changes since tio v1.37:
-
- * Redirect error messages to stderr
-
- * Improve help and man page
-
- * Mention config file in --help
-
- * Fix running without config file
-
- * Fix config file error messages
-
- * Redirect error messages to stderr
-
- * Add repology packaging status
-
- * Fix parsing of default settings
-
-   Default configuration file settings were not parsed in case a section
-   was matched. Now we make sure that the default (unnamed) settings are
-   always parsed.
-
- * Append to existing log file (no truncation)
-
- * Add socket info to show configuration
-
- * Print socket info at startup
-
- * Fix socket option parsing
-
-Peter Collingbourne:
-
- * Match user input against config section names if pattern matching was unsuccessful.
-
-   This allows for better config file ergonomics if the user has a diverse
-   set of serial devices as the name does not need to be specified in
-   the config file twice.
-
- * 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> "
-
-lexaone:
-
- * fix for using option 'log' without 'log-filename' in config file
-
-
-
-Changes since tio v1.36:
-
- * Make libinih a fallback dependency
-
-   This means that in case meson does not find libinih it will
-   automatically clone libinih and include it in the build.
-
-   The libinih library is reconfigured to be statically built so that no
-   shared object will be installed.
-
-Sylvain LAFRASSE:
-
- * Fix timestamp parsing in INI conf
-
- * Factorize timestamp parsing to be coherent with command line format in configuration file.
-
-
-
-Changes since tio v1.35:
-
- * Add support for defaults in config file
-
-   If no section name is specified the configuration will be considered the
-   default one.
-
-   This allows to set e.g. a default color code for sections which do not
-   configure a color code.
-
- * Handle SIGHUP
-
-   Handle SIGHUP so that the registered exit handlers are called to restore
-   the terminal back to its orignal state.
-
- * Add color configuration support
-
- * Bypass unused result warnings
-
- * Force dependency on libinih
-
-   Configuration file support is considered a mandatory feature.
-
- * Update headers
-
- * Update AUTHORS
-
- * Update man page
-
- * Move string_to_long() to misc.c
-
- * Update CircleCI config
-
- * Update tio gif
-
- * Update README
-
- * Update LICENSE date
-
- * Remove redundant COPYING file
-
-Liam Beguin:
-
- * Document configuration file options
-
- * Add support for a configuration file
-
- * misc: add _unused macro
-
-   Some parameters are expected to be unused.
-   Add a basic macro to mute these compiler warnings.
-
- * options: expose string_to_long()
-
-   Expose string_to_long() so that other source files can use it.
-
-
-
-Changes since tio v1.34:
-
- * Add support for automatically generated log filename
-
-   Automatically generate log filename if none is provided.
-
-   The auto generated file name is on the form:
-   "tio_DEVICE_YYYY-MM-DDTHH:MM:SS.log"
-
- * Add support for configurable timestamp format
-
-   Also changes default timestamp format from ISO8601 to classic 24-hour
-   format as this is assumed to be the format that most users would prefer.
-
-   And reintroduces strict but optional ISO8601 format.
-
-   This feature allows to easily add more timestamp formats in the future.
-
- * Reintroduce asm-generic/ioctls.h
-
-   It is needed for ppc builds.
-
- * Add macro hack to workaround older buggy glibc
-
-Robey Pointer:
-
- * Add support for high bps on OS X
-
-
-
-Changes since tio v1.33:
-
- * Fix setspeed2 compilation
-
- * Only apply color formatting when using color option
-
-   To help the color blind who may use custom terminal foreground /
-   background colors.
-
- * Update README
-
- * 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.
-
- * Fix setspeed2 check
-
- * Fix meson header check string
-
- * Reintroduce long timestamp format
-
-   But make the timestamp format RFC3339 compliant instead. The RFC states:
-
-   NOTE: ISO 8601 defines date and time separated by "T".
-         Applications using this syntax may choose, for the sake of
-         readability, to specify a full-date and full-time separated by
-         (say) a space character.
-
-   This way we keep the information specified by ISO 8601 but make it more
-   human readable which is better for the console output.
-
- * Update version year
-
-Sylvain LAFRASSE:
-
- * Fix TTY device listing on Darwin. (#136)
-
- * Fix TCGETS2 search on Darwin.
-
-
-
-Changes since tio v1.32:
-
- * Show auto connect status in show configuration
-
- * Use '#pragma once' in all headers
-
- * Improve printed output
-
-   Get rid of inconsistencies in the printed output (error printing,
-   colors, etc.).
-
-   Prepare for user configurable color.
-
- * Rename option -i to -L
-
- * Shorten timestamp
- * Shorten timestamp description
-
-   We do not need the date part of the timestamp. It simply takes up too
-   much precious line space. In case of logging to file, one can easily
-   conclude the date from the file date information.
-
- * Replace Travis with circleCI
-
- * Replace autotools with meson
-
-   To introduce much simpler build configuration which is also easier to
-   maintain.
-
- * Add list serial devices feature
-
-   For convenience, add a --list-devices option which lists the available
-   serial devices.
-
- * Cleanup: Use dot notation for default options struct
-
- * Update AUTHORS
-
- * Add command to show version
-
-   The key sequence ctrl-t v will now show the version of tio.
-
- * Align format of timestamps
- * Add Sylvain as official co-maintainer
-
-Sylvain LAFRASSE:
-
- * Add '-t' option description for time stamping.
-
- * Add description for time stamping.
-
- * Resolved tio/tio#84: Added timestamps in log file if enabled.
-
-attila-v:
-
- * 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.
-
-Yin Fengwei:
-
- * 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
-
-Jakob Haufe:
-
- * Make comparison POSIX compliant
-
-   String comparison with == is not POSIX compliant and can fail with e.g.
-   dash.
-
-Henrik Brix Andersen:
-
- * Add bash completion of tty devices.
-
- * Add -t/--timestamp to bash completion script.
-
-Henner Zeller:
-
- * Local echo: show character by character even if stdout buffered.
-
-Björn Stenberg:
-
- * Show error when failing to open a tty
-
-Alban Bedel:
-
- * Fix out of tree builds
-
-   Out of tree builds are currently broken because $(top_srcdir)src/include
-   is not in the search path. In tree builds are working because autconf add
-   $(top_builddir)/src/include to the search path for the generated config.h.
-   As $(top_builddir) and $(top_srcdir) are identical during in tree builds
-   the search path still end up beeing somehow correct.
-
-   To fix this add -I$(srcdir)/include to the CPPFLAGS in Makefile.am.
-
-Fabrice Fontaine:
-
- * src/setspeed2.c: fix redefinition of termio
-
-   Include ioctls.h and termbits.h from asm-generic instead of asm to avoid
-   build failures.
-
-Erik Moqvist
-
- * Exit if output speed cannot be set.
-
-Lars Kellogg-Stedman:
-
- * fflush() after putchar() for print_hex and print_normal
-
-   In order for local echo to work properly, we have to either call
-   fflush(stdout) after every character or just disable line buffering.
-   This change calls fflush() after putchar().
-
- * Disable line buffering in stdout
-
-   In order for local echo to work properly, we have to either call
-   fflush(stdout) after every character or just disable line buffering.
-   This change uses setbuf(stdout, NULL) to do the latter.
-
-George Stark:
-
- * dont show line state if ioctl failed
-
- * add serial lines manual control
-
-arichi:
-
- * Flush every local echo char
-
-   Flush stdout at every char in case it
-   happens to be buffered.
-
-Mariusz Midor:
-
- * Newline: handle booth NL and CR
-
-   Flag ONLCRNL expects code \n after press Enter, but on some systems \r is send instead.
-
-
-
-Changes since tio v1.31:
-
- * Update AUTHORS
-
- * Minor code style cleanups
-
- * Cleanup print macros
-
- * Flush output
-
-   Make sure output is transmitted immediately by flushing the output.
-
-Robey Pointer:
-
- * add optional timestamps
-
-   with "-t" or "C-t T", toggle a timestamp prefix to each line.
-
-Jakub Wilk:
-
- * Fix typos
-
-Sylvain Lafrasse:
-
- * Added macOS compatibility
-
- * Made O_NONBLOCK flag to open() call specific to macOS only.
-
- * Added macOS-related details.
-
- * Added O_NONBLOCK flag to open() call for macOS (10.13.6) compatibility.
-
-
-
-Changes since tio v1.30:
-
- * Update date
-
- * Update AUTHORS
-
-Henner Zeller:
-
- * Clarify the input/output variable names (No-op change)
-
- * Organize options the same sequence they are mentioned in cmdline help.
-
- * Update README.
-
- * Map CR->NL locally on output instead of using tio.c_oflag |= OCRNL.
-
-   This mostly is intended to have local echo output exactly what is sent
-   to the remote endpoint.
-   A nice side-effect is, that it also fixes tty-implementations, that can't
-   deal with the OCRNL flag on tio.c_oflag.
-
- * Provide local-echo option.
-
-   Can be switched on with -e on the command line.
-   Can be toggled with Ctrl t e while program is running.
-
- * Write to logfile as soon as we have the data, don't buffer.
-
-   Logfiles are important to see what happened, in particular if something
-   unexpected happened; so we want to make sure that the logfile is flushed
-   to disk.
-
-   Before this change, the logfile was typically written at the end in
-   a large chunk as the default (large) buffering applied. Now, characters are
-   written out ASAP, so it is possible to get a live-view with a
-   tail -f <logfile>
-
-
-
-Changes since tio v1.29:
-
- * Update README
-
- * Update man page and bash completion
-
- * Update AUTHORS
-
-qianfan Zhao:
-
- * ONLCRNL: change the method to map NL to CR-NL
-
-
-
-Changes since tio v1.28:
-
- * Add mapping flags INLCRNL and ODELBS
-
-   The following new mapping flags are added:
-
-   INLCRNL: Map NL to CR-NL on input.
-   ODELBS: Map DEL to BS on output.
-
-   Flags requested and tested by Jan Ciger (janoc).
-
-
-
-Changes since tio v1.27:
-
- * Update README
-
- * Update AUTHORS
-
- * Add snap status to README.md
-
- * Add README.md to prettify GitHub page
-
- * Add missing header
-
-Petr Vaněk:
-
- * Add missing header file under musl-libc
-
-   Musl's inclusion tree slightly differs from glibc, therefore TCGETS2 is
-   not reachable through sys/ioctl.h, so asm/ioctls.h needs to be included
-   too.
-
-Jakub Wilk:
-
- * Fix grammar and typos
-
-
-
-Changes since tio v1.26:
-
- * Update man page
-
- * Add support for setting non-standard baudrates
-
-   Support for non-standard baudrate settings will be automatically enabled
-   if the termios2 interface is detected available. However, to play it
-   safe, the old and widely supported termios interface will still be used
-   when setting standard baudrates.
-
- * Cleanup
-
- * Update AUTHORS
-
-
-
-Changes since tio v1.25:
-
- * Reconfigure stdin
-
-   Make stdin behave more raw'ish. In particular, don't
-   translate CR -> NL on input.
-
- * Add special character map feature
-
-   Add a --map option which allows mapping special characters, in particular CR and
-   NL characters which are used in various combinations on various platforms.
-
- * Cleanup
-
- * Update AUTHORS
-
- * Update README
-
- * Mention website
-
- * Update man page
-
-
-
-Changes since tio v1.24:
-
- * Fix error applying new stdout settings
-
-   On Fedora 26 tio will quit with the following error message:
-
-   "Error: Could not apply new stdout settings (Invalid argument)"
-
-   In case of Fedora, it turns out that the new stdout settings used are a
-   bit too aggressive because an empty termios structure is used. To remedy
-   this we reuse the existing stdout settings and only reconfigure the
-   specific options we need to make a "raw" stdout configuration.
-
- * Remove unused pkgconfig in configure
-
- * Code cleanup
-
-   Remove unused variable.
-
-
-
-Changes since tio v1.23:
-
- * Optimize clear screen command
-
-   Replaced system call with inline ANSI/VT100 clear screen code sequence
-
- * Fix bash completion installation
-
-   Fixed the configure script to avoid that the bash completion script gets
-   installed outside of the prefix location. The default install location
-   is now $prefix/share/bash-completion/completions.
-
-   Use the configure option '--with-bash-completion-dir=PATH' if you need
-   to install the bash completion script elsewhere.
-
-Jakub Wilk:
-
- * Add missing commas in conditional sentences
-
-
-
-Changes since tio v1.22:
-
- * Update copyright headers
-
-Jakub Wilk:
-
- * Fix typos
-
-
-
-Changes since tio v1.21:
-
- * Update man page date
-
- * Update copyright year
-
- * Code cleanup
-
- * Update README and man page
-
-
-
-Changes since tio v1.20:
-
- * Add support for hexadecimal mode
-
-   A new key command 'ctrl-t h' is introduced which toggles between
-   hexadecimal mode and normal mode. When in hexadecimal mode data received
-   will be printed in hexadecimal.
-
- * Do not distribute src/bash_completion/tio
-
-   Since the bash completion tio script is now autogenerated from tio.in it
-   should not be distributed in the tarball.
-
- * Add missing forward flag
-
- * Update AUTHORS file
-
-Adam Borowski:
-
- * 'ctrl-t b' to send serial break.
-
-Jakub Wilk:
-
- * Removed git commit references from ChangeLog
-
-   ChangeLog is primary useful for users who don't have the git repository
-   at hand.
-
-   Replace git commit references with version numbers; or if the change
-   only cleans up another change with no release in between, remove the
-   changelog item completely.
-
-
-
-Changes since tio v1.19:
-
- * Added more error handling of terminal calls
-
-   Also removed duplicate terminal flushing calls.
-
- * Revert "Added support for non-standard baud rates"
-
-   This reverts a change made in v1.18.
-
-   Reverting because supporting non-standard or arbitrary baud rates is
-   troublesome because the c library provides no means of doing so and even
-   if bare metal linux kernel interface is used it will not work on all
-   Linux kernels version.
-
-
-
-Changes since tio v1.18:
-
- * Rearranged key commands
-
-   Rearranged the key commands:
-
-   ctrl-t c (clear screen) is now
-   ctrl-t l which is similar to the well known shell ctrl-l
-
-   ctrl-t i (show settings information) is now
-   ctrl-t c (show configuration)
-
-   Updated man page accordingly.
-
- * Added "ctrl-t c" key command to clear screen
-
-
-
-Changes since tio v1.17:
-
- * Updated man page
-
- * Added support for non-standard baud rates
-
-   Only enabled when possible, that is, when the BOTHER definition is
-   available.
-
-   It is untested but it should work as described here:
-   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=683826
-
-   Some Cypress USB<->serial devices supposedly supports arbitrary speeds.
-
- * Generate baudrate switch cases based on detection
-
-   Support a single source of baud rate configuration as discussed in
-   https://github.com/tio/tio/issues/45 .
-
-   To do so, autogeneration of the switch cases which do the baud rate
-   option value check and configuration/conversion in tty_configure() is
-   introduced via a single macro.
-
-   Just to be safe, this change also enables configure detection of all
-   baud rates, including the ones previously assumed supported by most/all
-   systems (POSIX).
-
- * Minor cleanup
-
- * Exit when not a tty device in autoconnect mode
-
-Jakub Wilk:
-
- * Added non-standard baud rates that are defined on FreeBSD
-
- * Capitalized "GitHub" in README
-
-
-
-Changes since tio v1.16:
-
- * Compacted tty_configure() a bit
-
- * Fixed automatic baud rate enablement
-
- * Minor cleanups
-
- * Added autodetection of available baud rates
-
-   Various platforms support different baud rates.
-
-   To avoid adding platform specific handling generic baud rate detection
-   tests are introduced in the configure script. Successfully detected baud
-   rates are automatically enabled. This applies to both the C code and the
-   bash completion script.
-
-   Note:
-   Baud rates below 57600 are defined by POSIX-1 and supported by most
-   platforms so only baud rate 57600 and above are tested.
-
- * Updated bash-completion
-
- * Fixed printf() format type
-
- * Added Travis build configuration
-
-Jakub Wilk:
-
- * Generated bash completion at configure time
-
- * Reduce code duplication in baud rate detection
-
- * Add support for baud rates 200 and 1800
-
- * Fixed baudrate type
-
-
-
-Changes since tio v1.15:
-
- * Updated man page
-
- * Updated README
-
- * Removed obsolete packaging files
-
- * Removed use of deprecated bzero()
-
-
-
-Changes since tio v1.14:
-
- * Removed + to remove potential confusion
-
- * Added input digit checks
-
- * Fixed license string
-
- * Introduced tty_configure()
-
-   Moved tty configuration actions to tty_configure() in tty.c. This way
-   options.c is strictly about parsing options nothing else.
-
- * Function names cleanup
-
- * Updated AUTHORS file
-
-   Added Nick who created the new tio package for Arch Linux.
-
- * Fixed tx/rx counters type
-
-Jakob Haufe:
-
- * Include config.h before standard headers
-
-   Large file support was meant to be enabled in v1.11.
-   This change enables it for real.
-
-
-
-Changes since tio v1.13:
-
- * Fixed tio_printf macro
-
- * Fixed launch hints
-
-   Fixed launch hints not being printed in no autoconnect mode.
-
- * Added 'ctrl-t ?' to list available commands
-
- * Fixed log mechanism
-
-   To avoid echoing only log what is received from tty device.
-
- * Improved tio output
-
-   Added titles and indentation to commands output for clearer separation
-   when firing commands repeatedly.
-
-   Also added print of tio version and quit command hint at launch.
-
- * Cleaned up tio print mechanism
-
-Jakub Wilk:
-
- * Fixed grammar
-
-   "allow" is a transitive verb, which requires an object,
-   so "allow to <verb>" is ungrammatical.
-
- * Fixed typo
-
-
-
-Changes since tio v1.12:
-
- * Fixed some error prints
-
- * Fixed error printing for no autoconnect mode
-
-   Always print errors but only print silent errors when in no autoconnect
-   mode.
-
- * Added key command for showing session settings
-
-   A new key command "ctrl-t i" is added to allow the user to display the
-   various session settings information (baudrate, databits, log file, etc.).
-
-   This is useful in case you have a running session but have forgotten
-   what the settings are.
-
-
-
-Changes since tio v1.11:
-
- * Consolidated command key handling
-
- * Moved delay mechanism into separate function
-
- * Retired obsolete usleep()
-
-   Replaced with nanosleep()
-
- * Added simple tx/rx statistics command (ctrl-t s)
-
-   To display the total number of bytes transmitted/received simply perform the
-   'ctrl-t s' command sequence.
-
-   This feature can be useful when eg. trying to detect non-printable
-   characters.
-
- * Further simplification of key handling
-
-   Changed so that the "ctrl-t ctrl-t" sequence is now simply "ctrl-t t" to
-   send the ctrl-t key code. This is inspired by screen which does similar
-   to send its command key code (ctrl-a a).
-
-   This change also eases adding new key commands if needed.
-
-   Updated man page accordingly.
-
- * Cleaned up and simplified key handling
-
-Jakub Wilk:
-
- * Insert output delay only if something was output
-
-
-
-Changes since tio v1.10:
-
- * Enabled large file support (LFS)
-
-   Added autotools AC_SYS_LARGEFILE to support 64 bit file size handling.
-
- * Updated tio title
-
-
-
-Changes since tio v1.9:
-
- * Introduced lock on device file
-
-   Tio will now test for and obtain an advisory lock on the tty device file
-   to prevent starting multiple sessions on the same tty device.
-
- * Updated AUTHORS
-
-Jakub Wilk:
-
- * Treat EOF on stdin as error
-
-
-
-Changes since tio v1.8:
-
- * Cleanup of error handling
-
-   Introduced consistent way of handling errors and printing error messages.
-
-   Also upgraded some warnings to errors.
-
- * Updated localtime() error message
-
- * Cleanup
-
-Jakub Wilk:
-
- * Fix error handling for select()
-
-   Previously the error handling code for select() was unreachable.
-
- * Removed unneeded quotes from AM_CFLAGS
-
- * Expanded tabs
-
- * Fixed setting "tainted"
-
-   Set "tainted" if and only if any character was read from the device.
-
-   Ctrl-t is no longer sent to the device on exit, so the trick to avoid
-   its echo is not necessary.
-
-   Characters read from stdin don't directly affect output, so they
-   shouldn't enable "tainted".
-
- * Used \r in color_printf()
-
-   \033[300D is an unusual way to move the cursor back to column 1.
-   Use straightforward \r instead.
-
- * Added missing \r\n to warning messages
-
-   \n alone is not enough, because the terminal is in raw mode.
-
-
-
-Changes since tio v1.7:
-
- * Fixed enablement of compiler warnings
-
- * Fixed log_open() prototype
-
- * Fixed index error wrt ctrl-t detection
-
- * Fixed handling of ctrl-t
-
-   Before, when exercising the quit key sequence (ctrl-t + q) the ctrl-t code
-   (0x14) would be sent.
-
-   This is now fixed so that it is not sent.
-
-   However, in case it is needed to send ctrl-t to the device it is possible by
-   simply repeating the ctrl-t.
-
-   Meaning, ctrl-t + ctrl-t = ctrl-t sent to device.
-
- * Improved error handling
-
-   Fixes a memory leak and avoids aggressive busy looping when problems
-   accessing tty device.
-
- * Removed redundant log_close() call
-
- * Enabled compiler warnings
-
-Jakub Wilk:
-
- * Stopped copying arguments to fixed-size buffers
-
-   Don't needlessly copy command-line arguments into fixed-size buffers.
-
-   Previously the program crashed if an overlong pathname was provided on
-   the command line. Also, some systems (such as GNU Hurd) don't define
-   MAXPATHLEN at all.
-
- * Added const to log_open() prototype
-
- * Completed the ^g to ^t transition
-
-   In v1.7 the escape key was changed from ^g to ^t, but some
-   code and comments still referred to the old key.
-
- * Used HTTPS for tio.github.io
-
- * Man page beautification
-
- * Bumped date in man page
-
- * Improve man page formatting
-
-   Use regular font for metacharacters such as "[]", "," or "|";
-   use italic font for metavariables.
-
- * Fixed hyphen vs minus vs em-dash confusion in man page
-
-   - prints as hyphen;
-   \- prints as minus sign;
-   \em prints as em-dash.
-
-
-
-Changes since tio v1.6:
-
- * Changed escape key from ^g to ^t
-
-   After renaming to "tio" it makes sense to change the escape key
-   accordingly. Hence, the new escape key is ^t.
-
-   Meaning, in session, its now ctrl-t + q to quit.
-
-Jakub Wilk:
-
- * Fixed silly "tio or tio" in man page
-
- * Fixed typo
-
diff --git a/NEWS b/NEWS
new file mode 100644 (file)
index 0000000..11282e4
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,1311 @@
+
+=== tio v1.43 ===
+
+
+
+Changes since tio v1.42:
+
+ * 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.
+
+ * Improve description of socket option
+
+ * Rename ChangeLog to NEWS
+
+ * Update README
+
+ * Update man page
+
+George Joseph:
+
+ * 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.
+
+
+
+Changes since tio v1.41:
+
+ * Update man page
+
+ZeroMemoryEx:
+
+ * Handle malloc failure
+
+Sylvain LAFRASSE:
+
+ * Add missing 'string.h' include.
+
+
+
+Changes since tio v1.40:
+
+ * Rename --hex-mode to --hexadecimal
+
+ * 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.
+
+ * 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.
+
+ * Refactoring
+
+ * Cleanup stdout flushing
+
+   Flushing is not needed since we disabled buffering of stdout.
+
+ * Simplify stdout_configure() code
+
+ * Simplify stdin_configure() code
+
+ * Update man page
+
+ * Update README
+
+
+
+Changes since tio v1.39:
+
+ * Add config support for log-strip
+
+ * Add config support for hex-mode
+
+ * Rename --hex to --hex-mode
+
+ * Fix completion for -e, --local-echo
+
+ * Ignore newlines in hex output
+
+ * Fix newline in warning_printf()
+
+ * Fix ansi_printf_raw() in no color mode
+
+ * 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
+
+ * Also strip backspace from log
+
+   To make log strip feature consistent so that we remove all unprintable
+   control characters and escape sequences.
+
+ * Socket code cleanup
+
+ * Cleanup man page
+
+ * Rename --log-filename to --log-file
+
+Yin Fengwei:
+
+ * Allow strip escape sequence characters from log file
+
+   The log without escape key stripped is like:
+
+    ^M[12:47:17] ACRN:\>
+    ^M[12:47:17] ACRN:\>lasdfjklsdjf
+    ^M
+    ^M[12:47:18] Error: Invalid command.
+    ^M[12:47:19] ACRN:\>
+    ^M[12:47:26] ACRN:\>
+    ^M[12:47:26] ACRN:\>sdafkljsdkaljfklsadjflksdjafjsda^H ^H^H...
+    ^M
+    ^M[12:47:31] Error: Invalid command.
+
+   After strip escape key, the log is like:
+
+    [12:49:18] ACRN:\>
+    [12:49:19] ACRN:\>
+    [12:49:19] ACRN:\>ls
+
+    [12:49:19] Error: Invalid command.
+    [12:49:19] ACRN:\>
+    [12:49:19] ACRN:\>dfaslhj
+
+    [12:49:24] Error: Invalid command.
+
+   Beside escape key, it also handle backspace key as well.
+
+
+
+Changes since tio v1.38:
+
+ * Improve key command response for local echo and timestamp
+
+ * Fix invalid hex character error message
+
+ * Make sure only matched config section is parsed
+
+ * Add support for "disable" keyword in config file
+
+ * Unify error message formating
+
+ * Cleanup list devices code
+
+ * Fix command-line tty-device|config parsing
+
+   Allow user to add options on both sides of the provided config argument.
+
+   For example:
+
+    $ tio -b 9600 am64-evm -e
+
+   Before, tio only allowed adding arguments after the config argument.
+
+   Implemented as simple as possible by introducing two stage option parsing.
+
+ * Update bash completion
+
+ * 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.
+
+ * Fix tio deleting unix socket file
+
+   If tio has a unix file socket open, a second tio instance of tio may
+   delete the socket file. This change fixes so that it will not be deleted
+   and tio will instead error and complain about conflicting socket file.
+
+ * 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.
+
+ * Remove print of hex mode status at startup
+
+ * Remove newline option in hex mode
+
+ * Fix configfile memory leaks
+
+ * Remove command-line option inconsistencies
+
+   Optional arguments, as parsed by the getopt_long mechanism, are
+   inherently inconsistent with how you define required arguments.
+
+   To avoid confusion we decide to avoid this inconsistency by replacing
+   optional options with additional options with required argmuments.
+
+ * Replace '1' with 'enable' in config files
+
+ * Convert errors to warnings
+
+g0mb4:
+
+ * 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.
+
+
+
+Changes since tio v1.37:
+
+ * Redirect error messages to stderr
+
+ * Improve help and man page
+
+ * Mention config file in --help
+
+ * Fix running without config file
+
+ * Fix config file error messages
+
+ * Redirect error messages to stderr
+
+ * Add repology packaging status
+
+ * Fix parsing of default settings
+
+   Default configuration file settings were not parsed in case a section
+   was matched. Now we make sure that the default (unnamed) settings are
+   always parsed.
+
+ * Append to existing log file (no truncation)
+
+ * Add socket info to show configuration
+
+ * Print socket info at startup
+
+ * Fix socket option parsing
+
+Peter Collingbourne:
+
+ * Match user input against config section names if pattern matching was unsuccessful.
+
+   This allows for better config file ergonomics if the user has a diverse
+   set of serial devices as the name does not need to be specified in
+   the config file twice.
+
+ * 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> "
+
+lexaone:
+
+ * fix for using option 'log' without 'log-filename' in config file
+
+
+
+Changes since tio v1.36:
+
+ * Make libinih a fallback dependency
+
+   This means that in case meson does not find libinih it will
+   automatically clone libinih and include it in the build.
+
+   The libinih library is reconfigured to be statically built so that no
+   shared object will be installed.
+
+Sylvain LAFRASSE:
+
+ * Fix timestamp parsing in INI conf
+
+ * Factorize timestamp parsing to be coherent with command line format in configuration file.
+
+
+
+Changes since tio v1.35:
+
+ * Add support for defaults in config file
+
+   If no section name is specified the configuration will be considered the
+   default one.
+
+   This allows to set e.g. a default color code for sections which do not
+   configure a color code.
+
+ * Handle SIGHUP
+
+   Handle SIGHUP so that the registered exit handlers are called to restore
+   the terminal back to its orignal state.
+
+ * Add color configuration support
+
+ * Bypass unused result warnings
+
+ * Force dependency on libinih
+
+   Configuration file support is considered a mandatory feature.
+
+ * Update headers
+
+ * Update AUTHORS
+
+ * Update man page
+
+ * Move string_to_long() to misc.c
+
+ * Update CircleCI config
+
+ * Update tio gif
+
+ * Update README
+
+ * Update LICENSE date
+
+ * Remove redundant COPYING file
+
+Liam Beguin:
+
+ * Document configuration file options
+
+ * Add support for a configuration file
+
+ * misc: add _unused macro
+
+   Some parameters are expected to be unused.
+   Add a basic macro to mute these compiler warnings.
+
+ * options: expose string_to_long()
+
+   Expose string_to_long() so that other source files can use it.
+
+
+
+Changes since tio v1.34:
+
+ * Add support for automatically generated log filename
+
+   Automatically generate log filename if none is provided.
+
+   The auto generated file name is on the form:
+   "tio_DEVICE_YYYY-MM-DDTHH:MM:SS.log"
+
+ * Add support for configurable timestamp format
+
+   Also changes default timestamp format from ISO8601 to classic 24-hour
+   format as this is assumed to be the format that most users would prefer.
+
+   And reintroduces strict but optional ISO8601 format.
+
+   This feature allows to easily add more timestamp formats in the future.
+
+ * Reintroduce asm-generic/ioctls.h
+
+   It is needed for ppc builds.
+
+ * Add macro hack to workaround older buggy glibc
+
+Robey Pointer:
+
+ * Add support for high bps on OS X
+
+
+
+Changes since tio v1.33:
+
+ * Fix setspeed2 compilation
+
+ * Only apply color formatting when using color option
+
+   To help the color blind who may use custom terminal foreground /
+   background colors.
+
+ * Update README
+
+ * 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.
+
+ * Fix setspeed2 check
+
+ * Fix meson header check string
+
+ * Reintroduce long timestamp format
+
+   But make the timestamp format RFC3339 compliant instead. The RFC states:
+
+   NOTE: ISO 8601 defines date and time separated by "T".
+         Applications using this syntax may choose, for the sake of
+         readability, to specify a full-date and full-time separated by
+         (say) a space character.
+
+   This way we keep the information specified by ISO 8601 but make it more
+   human readable which is better for the console output.
+
+ * Update version year
+
+Sylvain LAFRASSE:
+
+ * Fix TTY device listing on Darwin. (#136)
+
+ * Fix TCGETS2 search on Darwin.
+
+
+
+Changes since tio v1.32:
+
+ * Show auto connect status in show configuration
+
+ * Use '#pragma once' in all headers
+
+ * Improve printed output
+
+   Get rid of inconsistencies in the printed output (error printing,
+   colors, etc.).
+
+   Prepare for user configurable color.
+
+ * Rename option -i to -L
+
+ * Shorten timestamp
+ * Shorten timestamp description
+
+   We do not need the date part of the timestamp. It simply takes up too
+   much precious line space. In case of logging to file, one can easily
+   conclude the date from the file date information.
+
+ * Replace Travis with circleCI
+
+ * Replace autotools with meson
+
+   To introduce much simpler build configuration which is also easier to
+   maintain.
+
+ * Add list serial devices feature
+
+   For convenience, add a --list-devices option which lists the available
+   serial devices.
+
+ * Cleanup: Use dot notation for default options struct
+
+ * Update AUTHORS
+
+ * Add command to show version
+
+   The key sequence ctrl-t v will now show the version of tio.
+
+ * Align format of timestamps
+ * Add Sylvain as official co-maintainer
+
+Sylvain LAFRASSE:
+
+ * Add '-t' option description for time stamping.
+
+ * Add description for time stamping.
+
+ * Resolved tio/tio#84: Added timestamps in log file if enabled.
+
+attila-v:
+
+ * 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.
+
+Yin Fengwei:
+
+ * 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
+
+Jakob Haufe:
+
+ * Make comparison POSIX compliant
+
+   String comparison with == is not POSIX compliant and can fail with e.g.
+   dash.
+
+Henrik Brix Andersen:
+
+ * Add bash completion of tty devices.
+
+ * Add -t/--timestamp to bash completion script.
+
+Henner Zeller:
+
+ * Local echo: show character by character even if stdout buffered.
+
+Björn Stenberg:
+
+ * Show error when failing to open a tty
+
+Alban Bedel:
+
+ * Fix out of tree builds
+
+   Out of tree builds are currently broken because $(top_srcdir)src/include
+   is not in the search path. In tree builds are working because autconf add
+   $(top_builddir)/src/include to the search path for the generated config.h.
+   As $(top_builddir) and $(top_srcdir) are identical during in tree builds
+   the search path still end up beeing somehow correct.
+
+   To fix this add -I$(srcdir)/include to the CPPFLAGS in Makefile.am.
+
+Fabrice Fontaine:
+
+ * src/setspeed2.c: fix redefinition of termio
+
+   Include ioctls.h and termbits.h from asm-generic instead of asm to avoid
+   build failures.
+
+Erik Moqvist
+
+ * Exit if output speed cannot be set.
+
+Lars Kellogg-Stedman:
+
+ * fflush() after putchar() for print_hex and print_normal
+
+   In order for local echo to work properly, we have to either call
+   fflush(stdout) after every character or just disable line buffering.
+   This change calls fflush() after putchar().
+
+ * Disable line buffering in stdout
+
+   In order for local echo to work properly, we have to either call
+   fflush(stdout) after every character or just disable line buffering.
+   This change uses setbuf(stdout, NULL) to do the latter.
+
+George Stark:
+
+ * dont show line state if ioctl failed
+
+ * add serial lines manual control
+
+arichi:
+
+ * Flush every local echo char
+
+   Flush stdout at every char in case it
+   happens to be buffered.
+
+Mariusz Midor:
+
+ * Newline: handle booth NL and CR
+
+   Flag ONLCRNL expects code \n after press Enter, but on some systems \r is send instead.
+
+
+
+Changes since tio v1.31:
+
+ * Update AUTHORS
+
+ * Minor code style cleanups
+
+ * Cleanup print macros
+
+ * Flush output
+
+   Make sure output is transmitted immediately by flushing the output.
+
+Robey Pointer:
+
+ * add optional timestamps
+
+   with "-t" or "C-t T", toggle a timestamp prefix to each line.
+
+Jakub Wilk:
+
+ * Fix typos
+
+Sylvain Lafrasse:
+
+ * Added macOS compatibility
+
+ * Made O_NONBLOCK flag to open() call specific to macOS only.
+
+ * Added macOS-related details.
+
+ * Added O_NONBLOCK flag to open() call for macOS (10.13.6) compatibility.
+
+
+
+Changes since tio v1.30:
+
+ * Update date
+
+ * Update AUTHORS
+
+Henner Zeller:
+
+ * Clarify the input/output variable names (No-op change)
+
+ * Organize options the same sequence they are mentioned in cmdline help.
+
+ * Update README.
+
+ * Map CR->NL locally on output instead of using tio.c_oflag |= OCRNL.
+
+   This mostly is intended to have local echo output exactly what is sent
+   to the remote endpoint.
+   A nice side-effect is, that it also fixes tty-implementations, that can't
+   deal with the OCRNL flag on tio.c_oflag.
+
+ * Provide local-echo option.
+
+   Can be switched on with -e on the command line.
+   Can be toggled with Ctrl t e while program is running.
+
+ * Write to logfile as soon as we have the data, don't buffer.
+
+   Logfiles are important to see what happened, in particular if something
+   unexpected happened; so we want to make sure that the logfile is flushed
+   to disk.
+
+   Before this change, the logfile was typically written at the end in
+   a large chunk as the default (large) buffering applied. Now, characters are
+   written out ASAP, so it is possible to get a live-view with a
+   tail -f <logfile>
+
+
+
+Changes since tio v1.29:
+
+ * Update README
+
+ * Update man page and bash completion
+
+ * Update AUTHORS
+
+qianfan Zhao:
+
+ * ONLCRNL: change the method to map NL to CR-NL
+
+
+
+Changes since tio v1.28:
+
+ * Add mapping flags INLCRNL and ODELBS
+
+   The following new mapping flags are added:
+
+   INLCRNL: Map NL to CR-NL on input.
+   ODELBS: Map DEL to BS on output.
+
+   Flags requested and tested by Jan Ciger (janoc).
+
+
+
+Changes since tio v1.27:
+
+ * Update README
+
+ * Update AUTHORS
+
+ * Add snap status to README.md
+
+ * Add README.md to prettify GitHub page
+
+ * Add missing header
+
+Petr Vaněk:
+
+ * Add missing header file under musl-libc
+
+   Musl's inclusion tree slightly differs from glibc, therefore TCGETS2 is
+   not reachable through sys/ioctl.h, so asm/ioctls.h needs to be included
+   too.
+
+Jakub Wilk:
+
+ * Fix grammar and typos
+
+
+
+Changes since tio v1.26:
+
+ * Update man page
+
+ * Add support for setting non-standard baudrates
+
+   Support for non-standard baudrate settings will be automatically enabled
+   if the termios2 interface is detected available. However, to play it
+   safe, the old and widely supported termios interface will still be used
+   when setting standard baudrates.
+
+ * Cleanup
+
+ * Update AUTHORS
+
+
+
+Changes since tio v1.25:
+
+ * Reconfigure stdin
+
+   Make stdin behave more raw'ish. In particular, don't
+   translate CR -> NL on input.
+
+ * Add special character map feature
+
+   Add a --map option which allows mapping special characters, in particular CR and
+   NL characters which are used in various combinations on various platforms.
+
+ * Cleanup
+
+ * Update AUTHORS
+
+ * Update README
+
+ * Mention website
+
+ * Update man page
+
+
+
+Changes since tio v1.24:
+
+ * Fix error applying new stdout settings
+
+   On Fedora 26 tio will quit with the following error message:
+
+   "Error: Could not apply new stdout settings (Invalid argument)"
+
+   In case of Fedora, it turns out that the new stdout settings used are a
+   bit too aggressive because an empty termios structure is used. To remedy
+   this we reuse the existing stdout settings and only reconfigure the
+   specific options we need to make a "raw" stdout configuration.
+
+ * Remove unused pkgconfig in configure
+
+ * Code cleanup
+
+   Remove unused variable.
+
+
+
+Changes since tio v1.23:
+
+ * Optimize clear screen command
+
+   Replaced system call with inline ANSI/VT100 clear screen code sequence
+
+ * Fix bash completion installation
+
+   Fixed the configure script to avoid that the bash completion script gets
+   installed outside of the prefix location. The default install location
+   is now $prefix/share/bash-completion/completions.
+
+   Use the configure option '--with-bash-completion-dir=PATH' if you need
+   to install the bash completion script elsewhere.
+
+Jakub Wilk:
+
+ * Add missing commas in conditional sentences
+
+
+
+Changes since tio v1.22:
+
+ * Update copyright headers
+
+Jakub Wilk:
+
+ * Fix typos
+
+
+
+Changes since tio v1.21:
+
+ * Update man page date
+
+ * Update copyright year
+
+ * Code cleanup
+
+ * Update README and man page
+
+
+
+Changes since tio v1.20:
+
+ * Add support for hexadecimal mode
+
+   A new key command 'ctrl-t h' is introduced which toggles between
+   hexadecimal mode and normal mode. When in hexadecimal mode data received
+   will be printed in hexadecimal.
+
+ * Do not distribute src/bash_completion/tio
+
+   Since the bash completion tio script is now autogenerated from tio.in it
+   should not be distributed in the tarball.
+
+ * Add missing forward flag
+
+ * Update AUTHORS file
+
+Adam Borowski:
+
+ * 'ctrl-t b' to send serial break.
+
+Jakub Wilk:
+
+ * Removed git commit references from ChangeLog
+
+   ChangeLog is primary useful for users who don't have the git repository
+   at hand.
+
+   Replace git commit references with version numbers; or if the change
+   only cleans up another change with no release in between, remove the
+   changelog item completely.
+
+
+
+Changes since tio v1.19:
+
+ * Added more error handling of terminal calls
+
+   Also removed duplicate terminal flushing calls.
+
+ * Revert "Added support for non-standard baud rates"
+
+   This reverts a change made in v1.18.
+
+   Reverting because supporting non-standard or arbitrary baud rates is
+   troublesome because the c library provides no means of doing so and even
+   if bare metal linux kernel interface is used it will not work on all
+   Linux kernels version.
+
+
+
+Changes since tio v1.18:
+
+ * Rearranged key commands
+
+   Rearranged the key commands:
+
+   ctrl-t c (clear screen) is now
+   ctrl-t l which is similar to the well known shell ctrl-l
+
+   ctrl-t i (show settings information) is now
+   ctrl-t c (show configuration)
+
+   Updated man page accordingly.
+
+ * Added "ctrl-t c" key command to clear screen
+
+
+
+Changes since tio v1.17:
+
+ * Updated man page
+
+ * Added support for non-standard baud rates
+
+   Only enabled when possible, that is, when the BOTHER definition is
+   available.
+
+   It is untested but it should work as described here:
+   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=683826
+
+   Some Cypress USB<->serial devices supposedly supports arbitrary speeds.
+
+ * Generate baudrate switch cases based on detection
+
+   Support a single source of baud rate configuration as discussed in
+   https://github.com/tio/tio/issues/45 .
+
+   To do so, autogeneration of the switch cases which do the baud rate
+   option value check and configuration/conversion in tty_configure() is
+   introduced via a single macro.
+
+   Just to be safe, this change also enables configure detection of all
+   baud rates, including the ones previously assumed supported by most/all
+   systems (POSIX).
+
+ * Minor cleanup
+
+ * Exit when not a tty device in autoconnect mode
+
+Jakub Wilk:
+
+ * Added non-standard baud rates that are defined on FreeBSD
+
+ * Capitalized "GitHub" in README
+
+
+
+Changes since tio v1.16:
+
+ * Compacted tty_configure() a bit
+
+ * Fixed automatic baud rate enablement
+
+ * Minor cleanups
+
+ * Added autodetection of available baud rates
+
+   Various platforms support different baud rates.
+
+   To avoid adding platform specific handling generic baud rate detection
+   tests are introduced in the configure script. Successfully detected baud
+   rates are automatically enabled. This applies to both the C code and the
+   bash completion script.
+
+   Note:
+   Baud rates below 57600 are defined by POSIX-1 and supported by most
+   platforms so only baud rate 57600 and above are tested.
+
+ * Updated bash-completion
+
+ * Fixed printf() format type
+
+ * Added Travis build configuration
+
+Jakub Wilk:
+
+ * Generated bash completion at configure time
+
+ * Reduce code duplication in baud rate detection
+
+ * Add support for baud rates 200 and 1800
+
+ * Fixed baudrate type
+
+
+
+Changes since tio v1.15:
+
+ * Updated man page
+
+ * Updated README
+
+ * Removed obsolete packaging files
+
+ * Removed use of deprecated bzero()
+
+
+
+Changes since tio v1.14:
+
+ * Removed + to remove potential confusion
+
+ * Added input digit checks
+
+ * Fixed license string
+
+ * Introduced tty_configure()
+
+   Moved tty configuration actions to tty_configure() in tty.c. This way
+   options.c is strictly about parsing options nothing else.
+
+ * Function names cleanup
+
+ * Updated AUTHORS file
+
+   Added Nick who created the new tio package for Arch Linux.
+
+ * Fixed tx/rx counters type
+
+Jakob Haufe:
+
+ * Include config.h before standard headers
+
+   Large file support was meant to be enabled in v1.11.
+   This change enables it for real.
+
+
+
+Changes since tio v1.13:
+
+ * Fixed tio_printf macro
+
+ * Fixed launch hints
+
+   Fixed launch hints not being printed in no autoconnect mode.
+
+ * Added 'ctrl-t ?' to list available commands
+
+ * Fixed log mechanism
+
+   To avoid echoing only log what is received from tty device.
+
+ * Improved tio output
+
+   Added titles and indentation to commands output for clearer separation
+   when firing commands repeatedly.
+
+   Also added print of tio version and quit command hint at launch.
+
+ * Cleaned up tio print mechanism
+
+Jakub Wilk:
+
+ * Fixed grammar
+
+   "allow" is a transitive verb, which requires an object,
+   so "allow to <verb>" is ungrammatical.
+
+ * Fixed typo
+
+
+
+Changes since tio v1.12:
+
+ * Fixed some error prints
+
+ * Fixed error printing for no autoconnect mode
+
+   Always print errors but only print silent errors when in no autoconnect
+   mode.
+
+ * Added key command for showing session settings
+
+   A new key command "ctrl-t i" is added to allow the user to display the
+   various session settings information (baudrate, databits, log file, etc.).
+
+   This is useful in case you have a running session but have forgotten
+   what the settings are.
+
+
+
+Changes since tio v1.11:
+
+ * Consolidated command key handling
+
+ * Moved delay mechanism into separate function
+
+ * Retired obsolete usleep()
+
+   Replaced with nanosleep()
+
+ * Added simple tx/rx statistics command (ctrl-t s)
+
+   To display the total number of bytes transmitted/received simply perform the
+   'ctrl-t s' command sequence.
+
+   This feature can be useful when eg. trying to detect non-printable
+   characters.
+
+ * Further simplification of key handling
+
+   Changed so that the "ctrl-t ctrl-t" sequence is now simply "ctrl-t t" to
+   send the ctrl-t key code. This is inspired by screen which does similar
+   to send its command key code (ctrl-a a).
+
+   This change also eases adding new key commands if needed.
+
+   Updated man page accordingly.
+
+ * Cleaned up and simplified key handling
+
+Jakub Wilk:
+
+ * Insert output delay only if something was output
+
+
+
+Changes since tio v1.10:
+
+ * Enabled large file support (LFS)
+
+   Added autotools AC_SYS_LARGEFILE to support 64 bit file size handling.
+
+ * Updated tio title
+
+
+
+Changes since tio v1.9:
+
+ * Introduced lock on device file
+
+   Tio will now test for and obtain an advisory lock on the tty device file
+   to prevent starting multiple sessions on the same tty device.
+
+ * Updated AUTHORS
+
+Jakub Wilk:
+
+ * Treat EOF on stdin as error
+
+
+
+Changes since tio v1.8:
+
+ * Cleanup of error handling
+
+   Introduced consistent way of handling errors and printing error messages.
+
+   Also upgraded some warnings to errors.
+
+ * Updated localtime() error message
+
+ * Cleanup
+
+Jakub Wilk:
+
+ * Fix error handling for select()
+
+   Previously the error handling code for select() was unreachable.
+
+ * Removed unneeded quotes from AM_CFLAGS
+
+ * Expanded tabs
+
+ * Fixed setting "tainted"
+
+   Set "tainted" if and only if any character was read from the device.
+
+   Ctrl-t is no longer sent to the device on exit, so the trick to avoid
+   its echo is not necessary.
+
+   Characters read from stdin don't directly affect output, so they
+   shouldn't enable "tainted".
+
+ * Used \r in color_printf()
+
+   \033[300D is an unusual way to move the cursor back to column 1.
+   Use straightforward \r instead.
+
+ * Added missing \r\n to warning messages
+
+   \n alone is not enough, because the terminal is in raw mode.
+
+
+
+Changes since tio v1.7:
+
+ * Fixed enablement of compiler warnings
+
+ * Fixed log_open() prototype
+
+ * Fixed index error wrt ctrl-t detection
+
+ * Fixed handling of ctrl-t
+
+   Before, when exercising the quit key sequence (ctrl-t + q) the ctrl-t code
+   (0x14) would be sent.
+
+   This is now fixed so that it is not sent.
+
+   However, in case it is needed to send ctrl-t to the device it is possible by
+   simply repeating the ctrl-t.
+
+   Meaning, ctrl-t + ctrl-t = ctrl-t sent to device.
+
+ * Improved error handling
+
+   Fixes a memory leak and avoids aggressive busy looping when problems
+   accessing tty device.
+
+ * Removed redundant log_close() call
+
+ * Enabled compiler warnings
+
+Jakub Wilk:
+
+ * Stopped copying arguments to fixed-size buffers
+
+   Don't needlessly copy command-line arguments into fixed-size buffers.
+
+   Previously the program crashed if an overlong pathname was provided on
+   the command line. Also, some systems (such as GNU Hurd) don't define
+   MAXPATHLEN at all.
+
+ * Added const to log_open() prototype
+
+ * Completed the ^g to ^t transition
+
+   In v1.7 the escape key was changed from ^g to ^t, but some
+   code and comments still referred to the old key.
+
+ * Used HTTPS for tio.github.io
+
+ * Man page beautification
+
+ * Bumped date in man page
+
+ * Improve man page formatting
+
+   Use regular font for metacharacters such as "[]", "," or "|";
+   use italic font for metavariables.
+
+ * Fixed hyphen vs minus vs em-dash confusion in man page
+
+   - prints as hyphen;
+   \- prints as minus sign;
+   \em prints as em-dash.
+
+
+
+Changes since tio v1.6:
+
+ * Changed escape key from ^g to ^t
+
+   After renaming to "tio" it makes sense to change the escape key
+   accordingly. Hence, the new escape key is ^t.
+
+   Meaning, in session, its now ctrl-t + q to quit.
+
+Jakub Wilk:
+
+ * Fixed silly "tio or tio" in man page
+
+ * Fixed typo
+
index b7d2455a58e984a23bd3cfa703864f534f040f17..93d747ed11f41c14269f11b864c62c471c4ca25d 100644 (file)
--- a/README.md
+++ b/README.md
@@ -32,6 +32,7 @@ when used in combination with [tmux](https://tmux.github.io).
  * List available serial devices
  * Show RX/TX statistics
  * Toggle serial lines
+ * Pulse the DTR line
  * Local echo support
  * Remap special characters (nl, cr-nl, bs, etc.)
  * Line timestamps
@@ -41,7 +42,7 @@ when used in combination with [tmux](https://tmux.github.io).
  * Autogeneration of log filename
  * Configuration file support
  * Activate sub-configurations by name or pattern
- * Redirect I/O to socket for scripting or TTY sharing
+ * Redirect I/O to file or network socket for scripting or TTY sharing
  * Pipe input and/or output
  * Bash completion
  * Color support
@@ -56,7 +57,7 @@ The command-line interface is straightforward as reflected in the output from
 ```
     Usage: tio [<options>] <tty-device|sub-config>
 
-    Connect to tty-device directly or via sub-configuration.
+    Connect to tty device directly or via sub-configuration.
 
     Options:
       -b, --baudrate <bps>             Baud rate (default: 115200)
@@ -65,6 +66,7 @@ The command-line interface is straightforward as reflected in the output from
       -s, --stopbits 1|2               Stop bits (default: 1)
       -p, --parity odd|even|none       Parity (default: none)
       -o, --output-delay <ms>          Character output delay (default: 0)
+          --dtr-pulse-duration <ms>    DTR pulse duration (default: 100)
       -n, --no-autoconnect             Disable automatic connect
       -e, --local-echo                 Enable local echo
       -t, --timestamp                  Enable line timestamp
@@ -75,7 +77,7 @@ The command-line interface is straightforward as reflected in the output from
           --log-strip                  Strip control characters and escape sequences
       -m, --map <flags>                Map special characters
       -c, --color 0..255|none|list     Colorize tio text (default: 15)
-      -S, --socket <socket>            Redirect I/O to socket
+      -S, --socket <socket>            Redirect I/O to file or network socket
       -x, --hexadecimal                Enable hexadecimal mode
       -v, --version                    Display version
       -h, --help                       Display help
@@ -96,6 +98,24 @@ established connection is lost.
 
 tio features full bash autocompletion.
 
+
+Typical use is without options:
+```
+$ tio /dev/ttyUSB0
+```
+
+Which corresponds to the commonly used default options:
+```
+$ tio -b 115200 -d 8 -f none -s 1 -p none /dev/ttyUSB0
+```
+
+It is recommended to connect serial tty devices by ID:
+```
+$ tio /dev/serial/by-id/usb-FTDI_TTL232R-3V3_FTGQVXBL-if00-port0
+```
+Using serial devices by ID ensures that tio automatically reconnects to the
+correct serial device if it is disconnected and then reconnected.
+
 ### 3.2 Key commands
 
 Various in session key commands are supported. When tio is started, press
@@ -107,6 +127,7 @@ ctrl-t ? to list the available key commands.
 [20:19:12.040]  ctrl-t b   Send break
 [20:19:12.040]  ctrl-t c   Show configuration
 [20:19:12.040]  ctrl-t d   Toggle DTR line
+[20:19:12.040]  ctrl-t D   Pulse DTR line
 [20:19:12.040]  ctrl-t e   Toggle local echo mode
 [20:19:12.040]  ctrl-t h   Toggle hexadecimal mode
 [20:19:12.040]  ctrl-t l   Clear screen
@@ -128,24 +149,26 @@ following locations in the order listed:
  - $HOME/.tiorc
 
 The configuration file supports sub-configurations using named sections which can
-be activated via the command-line by name or pattern.
+be activated via the command-line by name or pattern. A sub-configuration
+specifies which tty to connect to and other options.
 
 Example configuration file:
 
 ```
 # Defaults
-baudrate = 115200
+baudrate = 9600
 databits = 8
 parity = none
 stopbits = 1
 color = 10
+dtr-pulse-duration = 50
 
-[ftdi]
+[rpi3]
 tty = /dev/serial/by-id/usb-FTDI_TTL232R-3V3_FTGQVXBL-if00-port0
-baudrate = 9600
+baudrate = 115200
 no-autoconnect = enable
 log = enable
-log-file = ftdi.log
+log-file = rpi3.log
 color = 12
 
 [usb devices]
@@ -156,7 +179,7 @@ color = 13
 
 To use a specific sub-configuration by name simply start tio like so:
 ```
-$ tio ftdi
+$ tio rpi3
 ```
 Or by pattern match:
 ```
diff --git a/TODO b/TODO
index 563ceea3fad636355f64fa921fcf27063598f518..dda518087eb909280688a93ed64d29374ebb1670 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,3 +1,24 @@
 
  * Improve error/warning messaging when parsing configuration file
 
+ * Refactor and consolidate arbitrary set speed function into one file for all platforms
+
+ * Consider reworking line toggle and line pulse featueres in case requests are made to apply them to more lines:
+
+     ctrl-t g Toggle serial line
+     
+     Which would then make tio ask which line to toggle:
+     
+     [20:50:11.691] Please enter which line number to toggle?
+     [20:50:11.691] DTR(0) RTS(1) CTS(2) DSR(3) DCD(4) RI(5)
+     
+     ctrl-t p Pulse serial line
+     
+     [20:50:11.691] Please enter which line number to pulse?
+     [20:50:11.691] DTR(0) RTS(1) CTS(2) DSR(3) DCD(4) RI(5)
+     
+     command-line:
+     --line-pulse-duration="DTR=60,RTS=50,CTS=40,DSR=30,DCD=20,RI=10"
+     
+     config file:
+     line-pulse-duration="DTR=60,RTS=50,CTS=40,DSR=30,DCD=20,RI=10"
index 5106a281e32d6ffa0640272a7bf02e241f4f543b..3e468bd235a154a8c4c36336c9ee9bbbbe66899d 100644 (file)
Binary files a/images/tio-demo.gif and b/images/tio-demo.gif differ
index 304f3c33f152dc64820bc117de271b0014ba7bf4..7132e6484aeb3e624709e75442fd759bd303a5e5 100644 (file)
@@ -41,6 +41,12 @@ Set parity (default: none).
 .BR \-o ", " "\-\-output\-delay " \fI<ms>
 
 Set output delay [ms] inserted between each sent character (default: 0).
+
+.TP
+.BR "    \-\-dtr\-pulse\-duration " \fI<ms>
+
+Set the duration [ms] of the DTR pulse (default: 100).
+
 .TP
 .BR \-n ", " \-\-no\-autoconnect
 
@@ -68,13 +74,16 @@ Enable line timestamp.
 Set timestamp format to any of the following timestamp formats:
 .RS
 .TP 16n
+
 .IP "\fB24hour"
 24-hour format ("hh:mm:ss.sss")
 .IP "\fB24hour-start"
 24-hour format relative to start time
+.IP "\fB24hour-delta"
+24-hour format relative to previous timestamp
 .IP "\fBiso8601"
 ISO8601 format ("YYYY-MM-DDThh:mm:ss.sss")
-.P
+.PP
 Default format is
 .B 24hour
 .RE
@@ -196,6 +205,8 @@ Send ctrl-t key code
 Show line states (DTR, RTS, CTS, DSR, DCD, RI)
 .IP "\fBctrl-t d"
 Toggle DTR
+.IP "\fBctrl-t D"
+Pulse DTR
 .IP "\fBctrl-t r"
 Toggle RTS
 .IP "\fBctrl-t v"
@@ -229,7 +240,7 @@ tio will try to match the user input to a sub-configuration by name or by patter
 Options without any label change the default options.
 
 .TP
-Any options set via command-line will override options set in the configuraqtion file.
+Any options set via command-line will override options set in the configuration file.
 
 .TP
 The following configuration file options are available:
@@ -251,6 +262,8 @@ Set stop bits
 Set parity
 .IP "\fBoutput-delay"
 Set output delay
+.IP "\fBdtr-pulse-duration"
+Set DTR pulse duration
 .IP "\fBno-autoconnect"
 Disable automatic connect
 .IP "\fBlog"
@@ -283,11 +296,12 @@ To change the default configuration simply set options like so:
 .nf
 .eo
 # Defaults
-baudrate = 115200
+baudrate = 9600
 databits = 8
 parity = none
 stopbits = 1
 color = 10
+dtr-pulse-duration = 50
 .ec
 .fi
 .RE
@@ -298,9 +312,9 @@ Named sub-configurations can be added via labels:
 .RS
 .nf
 .eo
-[ftdi]
-baudrate = 115200
+[rpi3]
 tty = /dev/serial/by-id/usb-FTDI_TTL232R-3V3_FTGQVXBL-if00-port0
+baudrate = 115200
 color = 11
 .ec
 .fi
@@ -309,7 +323,7 @@ color = 11
 .TP
 Activate the sub-configuration by name:
 
-$ tio ftdi
+$ tio rpi3
 
 .TP
 Which is equivalent to:
@@ -324,8 +338,8 @@ A sub-configuration can also be activated by its pattern which supports regular
 .eo
 [usb device]
 pattern = usb([0-9]*)
-baudrate = 115200
 tty = /dev/ttyUSB%s
+baudrate = 115200
 .ec
 .fi
 .RE
@@ -351,7 +365,7 @@ Typical use is without options:
 
 $ tio /dev/ttyUSB0
 .TP
-Which corresponds to the commonly used options:
+Which corresponds to the commonly used default options:
 
 $ tio \-b 115200 \-d 8 \-f none \-s 1 \-p none /dev/ttyUSB0
 .TP
@@ -360,7 +374,7 @@ It is recommended to connect serial tty devices by ID:
 $ tio /dev/serial/by\-id/usb\-FTDI_TTL232R-3V3_FTGQVXBL\-if00\-port0
 .PP
 Using serial devices by ID ensures that tio automatically reconnects to the
-correct serial device if the device is disconnected and then reconnected.
+correct serial device if it is disconnected and then reconnected.
 .TP
 Redirect serial device I/O to Unix file socket for scripting:
 
index f3d63f01fc4b88219a001ec3618dfc23289eca80..60d139a92a6218c11df9369a931c7547fc9f9db2 100644 (file)
@@ -1,12 +1,12 @@
 project('tio', 'c',
-    version : '1.42',
+    version : '1.43',
     license : [ 'GPL-2'],
     meson_version : '>= 0.53.2',
     default_options : [ 'warning_level=2', 'buildtype=release', 'c_std=gnu99' ]
 )
 
 # The tag date of the project_version(), update when the version bumps.
-version_date = '2022-07-04'
+version_date = '2022-07-09'
 
 # Test for dynamic baudrate configuration interface
 compiler = meson.get_compiler('c')
index 1710ecce6ee69365ec0a74ab8610ef1d22c99033..320601c9d9acde6ce1c2412d2ec2d3fb638a87fb 100644 (file)
@@ -16,6 +16,7 @@ _tio()
           -s --stopbits \
           -p --parity \
           -o --output-delay \
+             --dtr-pulse-duration \
           -n --no-autoconnect \
           -e --local-echo \
           -l --log \
@@ -58,6 +59,10 @@ _tio()
             COMPREPLY=( $(compgen -W "0 1 10 100" -- ${cur}) )
             return 0
             ;;
+        --dtr-pulse-duration)
+            COMPREPLY=( $(compgen -W "10 50 100 500" -- ${cur}) )
+            return 0
+            ;;
         -n | --no-autoconnect)
             COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
             return 0
@@ -87,7 +92,7 @@ _tio()
             return 0
             ;;
         --timestamp-format)
-            COMPREPLY=( $(compgen -W "24hour 24hour-start iso8601" -- ${cur}) )
+            COMPREPLY=( $(compgen -W "24hour 24hour-start 24hour-delta iso8601" -- ${cur}) )
             return 0
             ;;
         -L | --list-devices)
index 352169d0e710111c992a287f78c4e09720f14b3b..84c76d2168358cf1392b277b436fac1301e704c4 100644 (file)
@@ -124,6 +124,10 @@ static int data_handler(void *user, const char *section, const char *name,
         {
             option.output_delay = atoi(value);
         }
+        else if (!strcmp(name, "dtr-pulse-duration"))
+        {
+            option.dtr_pulse_duration = atoi(value);
+        }
         else if (!strcmp(name, "no-autoconnect"))
         {
             if (!strcmp(value, "enable"))
index b4555ea5ccd11adcd7d139c8a0416ecc0d1c21b4..7e8ffbddba16a6ff258a2e4c7394651e708abadb 100644 (file)
 char *current_time(void)
 {
     static char time_string[TIME_STRING_SIZE_MAX];
-    static struct timeval tv_start;
+    static struct timeval tv, tv_now, tv_start, tv_previous;
     static bool first = true;
     struct tm *tm;
-    struct timeval tv;
     size_t len;
 
-    gettimeofday(&tv, NULL);
+    // Get current time value
+    gettimeofday(&tv_now, NULL);
 
     if (first)
     {
-        tv_start = tv;
+        tv_start = tv_now;
         first = false;
     }
 
@@ -55,18 +55,27 @@ char *current_time(void)
         case TIMESTAMP_NONE:
         case TIMESTAMP_24HOUR:
             // "hh:mm:ss.sss" (24 hour format)
+            tv = tv_now;
             tm = localtime(&tv.tv_sec);
             len = strftime(time_string, sizeof(time_string), "%H:%M:%S", tm);
             break;
         case TIMESTAMP_24HOUR_START:
             // "hh:mm:ss.sss" (24 hour format relative to start time)
-            timersub(&tv, &tv_start, &tv);
+            timersub(&tv_now, &tv_start, &tv);
+            tv.tv_sec -= 3600; // Why is this needed??
+            tm = localtime(&tv.tv_sec);
+            len = strftime(time_string, sizeof(time_string), "%H:%M:%S", tm);
+            break;
+        case TIMESTAMP_24HOUR_DELTA:
+            // "hh:mm:ss.sss" (24 hour format relative to previous time stamp)
+            timersub(&tv_now, &tv_previous, &tv);
             tv.tv_sec -= 3600; // Why is this needed??
             tm = localtime(&tv.tv_sec);
             len = strftime(time_string, sizeof(time_string), "%H:%M:%S", tm);
             break;
         case TIMESTAMP_ISO8601:
             // "YYYY-MM-DDThh:mm:ss.sss" (ISO-8601)
+            tv = tv_now;
             tm = localtime(&tv.tv_sec);
             len = strftime(time_string, sizeof(time_string), "%Y-%m-%dT%H:%M:%S", tm);
             break;
@@ -80,6 +89,9 @@ char *current_time(void)
         len = snprintf(time_string + len, TIME_STRING_SIZE_MAX - len, ".%03ld", (long)tv.tv_usec / 1000);
     }
 
+    // Save previous time value for next run
+    tv_previous = tv_now;
+
     return (len < TIME_STRING_SIZE_MAX) ? time_string : NULL;
 }
 
index 85782c9cf469aa288a0a494ac8051958699fd297..00a21c478bc422a6c0c166746eb74f56b2aa4480 100644 (file)
@@ -42,6 +42,7 @@ enum opt_t
     OPT_TIMESTAMP_FORMAT,
     OPT_LOG_FILE,
     OPT_LOG_STRIP,
+    OPT_DTR_PULSE_DURATION,
 };
 
 /* Default options */
@@ -54,6 +55,7 @@ struct option_t option =
     .stopbits = 1,
     .parity = "none",
     .output_delay = 0,
+    .dtr_pulse_duration = 100,
     .no_autoconnect = false,
     .log = false,
     .log_filename = NULL,
@@ -70,7 +72,7 @@ void print_help(char *argv[])
 {
     printf("Usage: %s [<options>] <tty-device|sub-config>\n", argv[0]);
     printf("\n");
-    printf("Connect to tty-device directly or via sub-configuration.\n");
+    printf("Connect to tty device directly or via sub-configuration.\n");
     printf("\n");
     printf("Options:\n");
     printf("  -b, --baudrate <bps>             Baud rate (default: 115200)\n");
@@ -79,6 +81,7 @@ void print_help(char *argv[])
     printf("  -s, --stopbits 1|2               Stop bits (default: 1)\n");
     printf("  -p, --parity odd|even|none       Parity (default: none)\n");
     printf("  -o, --output-delay <ms>          Output delay (default: 0)\n");
+    printf("      --dtr-pulse-duration <ms>    DTR pulse duration (default: 100)\n");
     printf("  -n, --no-autoconnect             Disable automatic connect\n");
     printf("  -e, --local-echo                 Enable local echo\n");
     printf("  -t, --timestamp                  Enable line timestamp\n");
@@ -89,7 +92,7 @@ void print_help(char *argv[])
     printf("      --log-strip                  Strip control characters and escape sequences\n");
     printf("  -m, --map <flags>                Map special characters\n");
     printf("  -c, --color 0..255|none|list     Colorize tio text (default: 15)\n");
-    printf("  -S, --socket <socket>            Redirect I/O to socket\n");
+    printf("  -S, --socket <socket>            Redirect I/O to file or network socket\n");
     printf("  -x, --hexadecimal                Enable hexadecimal mode\n");
     printf("  -v, --version                    Display version\n");
     printf("  -h, --help                       Display help\n");
@@ -101,12 +104,12 @@ void print_help(char *argv[])
     printf("See the man page for more details.\n");
 }
 
-const char* timestamp_token(enum timestamp_t timestamp)
+const char* timestamp_state_to_string(enum timestamp_t timestamp)
 {
     switch (timestamp)
     {
         case TIMESTAMP_NONE:
-            return "none";
+            return "disabled";
             break;
 
         case TIMESTAMP_24HOUR:
@@ -117,6 +120,10 @@ const char* timestamp_token(enum timestamp_t timestamp)
             return "24hour-start";
             break;
 
+        case TIMESTAMP_24HOUR_DELTA:
+            return "24hour-delta";
+            break;
+
         case TIMESTAMP_ISO8601:
             return "iso8601";
             break;
@@ -133,17 +140,21 @@ enum timestamp_t timestamp_option_parse(const char *arg)
     
     if (arg != NULL)
     {
-        if (strcmp(arg, "24hour-start") == 0)
+        if (strcmp(arg, "24hour") == 0)
+        {
+            return TIMESTAMP_24HOUR;
+        }
+        else if (strcmp(arg, "24hour-start") == 0)
         {
             return TIMESTAMP_24HOUR_START;
         }
-        else if (strcmp(arg, "iso8601") == 0)
+        else if (strcmp(arg, "24hour-delta") == 0)
         {
-            return TIMESTAMP_ISO8601;
+            return TIMESTAMP_24HOUR_DELTA;
         }
-        else
+        else if (strcmp(arg, "iso8601") == 0)
         {
-            warning_printf("Unknown timestamp type, falling back to '24hour' default format");
+            return TIMESTAMP_ISO8601;
         }
     }
 
@@ -159,8 +170,9 @@ void options_print()
     tio_printf(" Stopbits: %d", option.stopbits);
     tio_printf(" Parity: %s", option.parity);
     tio_printf(" Local echo: %s", option.local_echo ? "enabled" : "disabled");
-    tio_printf(" Timestamps: %s", timestamp_token(option.timestamp));
+    tio_printf(" Timestamp: %s", timestamp_state_to_string(option.timestamp));
     tio_printf(" Output delay: %d", option.output_delay);
+    tio_printf(" DTR pulse duration: %d", option.dtr_pulse_duration);
     tio_printf(" Auto connect: %s", option.no_autoconnect ? "disabled" : "enabled");
     if (option.map[0] != 0)
         tio_printf(" Map flags: %s", option.map);
@@ -190,6 +202,7 @@ void options_parse(int argc, char *argv[])
             {"stopbits",         required_argument, 0, 's'                  },
             {"parity",           required_argument, 0, 'p'                  },
             {"output-delay",     required_argument, 0, 'o'                  },
+            {"dtr-pulse-duration",   required_argument, 0, OPT_DTR_PULSE_DURATION   },
             {"no-autoconnect",   no_argument,       0, 'n'                  },
             {"local-echo",       no_argument,       0, 'e'                  },
             {"timestamp",        no_argument,       0, 't'                  },
@@ -253,6 +266,10 @@ void options_parse(int argc, char *argv[])
                 option.output_delay = string_to_long(optarg);
                 break;
 
+            case OPT_DTR_PULSE_DURATION:
+                option.dtr_pulse_duration = string_to_long(optarg);
+                break;
+
             case 'n':
                 option.no_autoconnect = true;
                 break;
@@ -357,7 +374,7 @@ void options_parse(int argc, char *argv[])
 
     if (strlen(option.tty_device) == 0)
     {
-        printf("Error: Missing device or config name\n");
+        printf("Error: Missing tty device or sub-configuration name\n");
         exit(EXIT_FAILURE);
     }
 
index cc905bf656f48d5c57071d2caf61e26dcbbd5e5e..b005a1ae91fce3ee3e5208fbcea0c5aa81cd44f0 100644 (file)
@@ -31,11 +31,11 @@ enum timestamp_t
     TIMESTAMP_NONE,
     TIMESTAMP_24HOUR,
     TIMESTAMP_24HOUR_START,
+    TIMESTAMP_24HOUR_DELTA,
     TIMESTAMP_ISO8601,
     TIMESTAMP_END,
 };
 
-const char* timestamp_token(enum timestamp_t timestamp);
 enum timestamp_t timestamp_option_parse(const char *arg);
 
 /* Options */
@@ -48,6 +48,7 @@ struct option_t
     int stopbits;
     char *parity;
     int output_delay;
+    int dtr_pulse_duration;
     bool no_autoconnect;
     bool log;
     bool log_strip;
index f1efa691cf475f520d3ecc00293df180af7f1752..4c0998860672639895cc66302a4a603f3b3316bc 100644 (file)
--- a/src/tty.c
+++ b/src/tty.c
@@ -256,6 +256,7 @@ void handle_command_sequence(char input_char, char previous_char, char *output_c
                 tio_printf(" ctrl-t b   Send break");
                 tio_printf(" ctrl-t c   Show configuration");
                 tio_printf(" ctrl-t d   Toggle DTR line");
+                tio_printf(" ctrl-t D   Pulse DTR line");
                 tio_printf(" ctrl-t e   Toggle local echo mode");
                 tio_printf(" ctrl-t h   Toggle hexadecimal mode");
                 tio_printf(" ctrl-t l   Clear screen");
@@ -286,6 +287,12 @@ void handle_command_sequence(char input_char, char previous_char, char *output_c
                 toggle_line("DTR", TIOCM_DTR);
                 break;
 
+            case KEY_SHIFT_D:
+                toggle_line("DTR", TIOCM_DTR);
+                delay(option.dtr_pulse_duration);
+                toggle_line("DTR", TIOCM_DTR);
+                break;
+
             case KEY_R:
                 toggle_line("RTS", TIOCM_RTS);
                 break;
@@ -355,6 +362,9 @@ void handle_command_sequence(char input_char, char previous_char, char *output_c
                     case TIMESTAMP_24HOUR_START:
                         tio_printf("Switched to 24hour-start timestamp mode");
                         break;
+                    case TIMESTAMP_24HOUR_DELTA:
+                        tio_printf("Switched to 24hour-delta timestamp mode");
+                        break;
                     case TIMESTAMP_ISO8601:
                         tio_printf("Switched to iso8601 timestamp mode");
                         break;
index 339dce95f5d989d2bdf3bdd7418a6437beb0cc90..a47c8b9fd2562c6010659c4f0356e7fc30c818f8 100644 (file)
--- a/src/tty.h
+++ b/src/tty.h
@@ -36,6 +36,7 @@
 #define KEY_CTRL_T 0x14
 #define KEY_V 0x76
 #define KEY_D 0x64
+#define KEY_SHIFT_D 0x44
 #define KEY_R 0x72
 #define KEY_SHIFT_L 0x4C