mirror of
https://github.com/tio/tio.git
synced 2026-05-01 23:07:58 +02:00
Add some socket examples of bidirectional command helpers and pexpect
bidir_cmd_herlper.sh: Bidirectional command helper by socat. bidir_cmd_helper.py: Bidirectional command helper by python and netcat. pexpect-ping.py, pexpect-pong.py: Scripts for throwing Ping-Pong between cross-connected tios.
This commit is contained in:
parent
a9f05a66f7
commit
c25a379fbb
4 changed files with 153 additions and 0 deletions
15
examples/socket/bidir_cmd_helper.sh
Executable file
15
examples/socket/bidir_cmd_helper.sh
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "Usage: $0 <socket-path> <bidirectional-command>"
|
||||
echo "Example: $0 /tmp/tio-socket0 \"sz -b -p sample.bin\""
|
||||
echo "Note: Please run \"tio -S <socket-path> <your-serial-device>\" beforehand."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SOCKET_PATH=$1
|
||||
BIDIR_CMD=$2
|
||||
|
||||
socat EXEC:"$BIDIR_CMD" $SOCKET_PATH
|
||||
|
||||
exit $?
|
||||
Loading…
Add table
Add a link
Reference in a new issue