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:
yabu76 2025-12-07 11:21:55 +09:00
parent a9f05a66f7
commit c25a379fbb
4 changed files with 153 additions and 0 deletions

View 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 $?