showtty - easy serial port settings
Archiver
Posts: 46,084
When fiddling around with serial port settings on linux I used the
script below. It is just an interface to stty, but it provides an
easyly readable display of all the settings - overview and in detail -
and allows quick changes with just a few keystrokes.
#!/bin/bash
device=$1
option=""
if test "$device" = ""; then
device="/dev/ttyS0"
fi
if test "$2" != "noterm"; then
xterm +sb -bg black -fg white -e $0 $device noterm &
exit
fi
green="\033[noparse][[/noparse]32m"
white="\033[noparse][[/noparse]37m"
cyan="\033[noparse][[/noparse]36m"
yellow="\033[noparse][[/noparse]33m"
red="\033[noparse][[/noparse]31m"
while test 1; do
clear
echo -ne $yellow
echo $device
echo -ne $white
echo '
'
if test "$option" != ""; then
echo -ne $red
stty -F $device $option
fi
echo -ne $cyan
stty -F $device
echo -ne $white
echo '
'
echo -ne $green
stty -F $device -a
echo -e $white
echo -n '>>' && read option
done
script below. It is just an interface to stty, but it provides an
easyly readable display of all the settings - overview and in detail -
and allows quick changes with just a few keystrokes.
#!/bin/bash
device=$1
option=""
if test "$device" = ""; then
device="/dev/ttyS0"
fi
if test "$2" != "noterm"; then
xterm +sb -bg black -fg white -e $0 $device noterm &
exit
fi
green="\033[noparse][[/noparse]32m"
white="\033[noparse][[/noparse]37m"
cyan="\033[noparse][[/noparse]36m"
yellow="\033[noparse][[/noparse]33m"
red="\033[noparse][[/noparse]31m"
while test 1; do
clear
echo -ne $yellow
echo $device
echo -ne $white
echo '
'
if test "$option" != ""; then
echo -ne $red
stty -F $device $option
fi
echo -ne $cyan
stty -F $device
echo -ne $white
echo '
'
echo -ne $green
stty -F $device -a
echo -e $white
echo -n '>>' && read option
done