Remove options --response-wait, --response-timeout

Remove options and rework input handling so it is possible to do the
same thing but via script which is much more flexible.

These options were always a bit of a hardcoded solution. With the new
script expect feature we can wait for any type of response.

For example, pipe command to serial device and wait for line response within 1 second:

$ echo "*IDN?" | tio /dev/ttyACM0 --script "expect('\r\n', 1000)" --mute
This commit is contained in:
Martin Lund 2024-04-13 23:16:31 +02:00
parent e1e3e298bf
commit 97537853a8
9 changed files with 46 additions and 116 deletions

View file

@ -33,8 +33,6 @@ _tio()
-S --socket \
--input-mode \
--output-mode \
-r --response-wait \
--response-timeout \
--rs-485 \
--rs-485-config \
--alert \
@ -140,14 +138,6 @@ _tio()
COMPREPLY=( $(compgen -W "normal hex" -- ${cur}) )
return 0
;;
-r | --response-wait)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
--response-timeout)
COMPREPLY=( $(compgen -W "1 10 100" -- ${cur}) )
return 0
;;
--rs-485)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0