Commit graph

119 commits

Author SHA1 Message Date
Martin Lund
e646c50019 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.
2017-11-13 13:40:15 +01:00
Martin Lund
39ef771e10 Cleanup 2017-11-09 14:38:50 +01:00
Martin Lund
342a247efb Reconfigure stdin
Make stdin behave more raw'ish. In particular, don't
translate CR -> NL on input.
2017-11-06 14:43:56 +01:00
Martin Lund
b2aafd696b Add special character map feature
Add a --map option which allows to map special characters, in particular CR and
NL characters which are used in various combinations on varios platforms.
2017-11-05 23:10:12 +01:00
Martin Lund
078bb6213d Cleanup 2017-11-02 16:22:24 +01:00
Martin Lund
288a88aa15 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 agressive 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.
2017-10-15 23:15:49 +02:00
Martin Lund
29289c8585 Code cleanup
Remove unused variable.
2017-10-01 18:32:34 +02:00
Martin Lund
07255c94b9 Optimize clear screen command
Replaced system call with inline ANSI/VT100 clear screen code sequence
2017-10-01 09:51:29 +02:00
Martin Lund
9c7e4ba06e 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.
2017-10-01 00:11:31 +02:00
Martin Lund
f5e6c99721 Update copyright headers 2017-09-28 18:15:07 +02:00
Jakub Wilk
45bab702f4 Fix typos 2017-09-28 17:13:15 +02:00
Martin Lund
ab512c8f68 Update copyright year 2017-09-24 22:16:19 +02:00
Martin Lund
c257126a33 Code cleanup 2017-09-24 22:09:46 +02:00
Martin Lund
3457446a04 Add support for hexidecimal mode
A new key command 'ctrl-t h' is introduced which toggles between
hexidecial mode and normal mode. When in hexidecimal mode data received
will be printed in hexidecimal.
2017-09-19 12:19:17 +02:00
Martin Lund
7ae62d6030 Add missing forward flag 2017-05-25 17:05:20 +02:00
Adam Borowski
74a543b263 'ctrl-t b' to send serial break. 2017-04-10 01:05:40 +02:00
Martin Lund
8f7c32e2e9 Do no distribute src/bash_completion/tio
Since bash completion tio script is now autogenerated from tio.in it
should not be distributed in the tarball.
2016-06-13 08:23:32 +02:00
Martin Lund
80cd28bbb6 Added more error handling of terminal calls
Also removed duplicate terminal flushing calls.
2016-06-10 18:09:15 +02:00
Martin Lund
61655faaa8 Revert "Added support for non-standard baud rates"
This reverts commit deec83a4ee.

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.
2016-06-10 16:51:12 +02:00
Martin Lund
a64d1a493b Rearranged key commands
Rearranged the key commands:

ctrl-c (clear screen) is now
ctrl-l which is similar to the well known shell ctrl-l

ctrl-i (show settings information) is now
ctrl-c (show configuration)

Updated man page accordingly.
2016-06-04 21:56:53 +02:00
Martin Lund
b9a2f4a1be Added "ctrl-t c" key command to clear screen 2016-06-02 00:35:19 +02:00
Martin Lund
deec83a4ee 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.
2016-05-28 16:02:21 +02:00
Martin Lund
c8a677e3d9 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).
2016-05-28 09:54:45 +02:00
Martin Lund
86eec26b5b Minor cleanup 2016-05-27 09:30:23 +02:00
Martin Lund
bf1f712e5e Exit when not a tty device in autoconnect mode 2016-05-26 17:15:08 +02:00
Martin Lund
72b200a19b Compacted tty_configure() a bit 2016-05-26 16:05:57 +02:00
Jakub Wilk
0f02e6e551 Generated bash completion at configure time 2016-05-26 15:23:19 +02:00
Martin Lund
933792d73f Fixed automatic baud rate enablement 2016-05-26 09:58:48 +02:00
Martin Lund
5406da5ddb Minor cleanups 2016-05-26 09:22:45 +02:00
Martin Lund
8eb0e6d874 Added autodetection of available baud rates
Various platforms supports 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.
2016-05-26 08:59:18 +02:00
Martin Lund
f4cba8ebfb Updated bash-completion 2016-05-26 00:11:27 +02:00
Jakub Wilk
7af9cc93d4 Add support for baud rates 200 and 1800 2016-05-25 22:28:23 +02:00
Jakub Wilk
329e70a501 Fixed baudrate type 2016-05-25 20:45:41 +02:00
Martin Lund
3be7137c29 Fixed printf() format type 2016-05-25 18:35:33 +02:00
Martin Lund
399598fd31 Removed use of deprecated bzero() 2016-05-23 20:07:49 +02:00
Martin Lund
efef2fa254 Removed + to remove potential confusion 2016-05-23 19:20:11 +02:00
Martin Lund
81be02fc03 Added input digit checks 2016-05-23 19:01:40 +02:00
Martin Lund
aecc829829 Fixed license string 2016-05-23 18:11:08 +02:00
Martin Lund
e920cc9b32 Introduced tty_configure()
Moved tty configuration actions to tty_configure() in tty.c. This way
options.c is strictly about parsing options nothing else.
2016-05-23 18:03:13 +02:00
Martin Lund
1f45b8d91d Function names cleanup 2016-05-23 08:50:47 +02:00
Jakob Haufe
82063b73fb
Include config.h before standard headers
This makes use of 8d6d202 (Enable large file support) for real.
2016-05-21 21:15:33 +02:00
Jakub Wilk
f2fe52b600 Fixed printf directives for tx/rx counters
In 9a66de0aff, types of tx/rx counters were changed from "long" to
"unsigned long", but their printf directives remained "%ld".
Change them to "%lu" to match the actual types.
2016-05-21 16:42:49 +02:00
Martin Lund
9a66de0aff Fixed tx/rx counters type 2016-05-21 10:31:41 +02:00
Martin Lund
fa079c6852 Fixed tio_printf macro 2016-05-20 20:49:16 +02:00
Martin Lund
065ee51291 Fixed launch hints
Fixed launch hints not being printed in no autoconnect mode.
2016-05-20 20:19:42 +02:00
Martin Lund
59a537f7dd Added 'ctrl-t ?' to list available commands 2016-05-20 20:10:12 +02:00
Martin Lund
66d5cf5456 Fixed log mechanism
To avoid echoing only log what is received from tty device.
2016-05-20 19:51:12 +02:00
Martin Lund
8ddabb1908 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.
2016-05-20 19:36:23 +02:00
Martin Lund
dc455eb0c2 Merge branch 'master' of github.com:tio/tio 2016-05-20 15:19:46 +02:00
Martin Lund
7eb64748da Cleaned up tio print mechanism 2016-05-20 15:18:48 +02:00