minimodem-mirror/src/self-test

23 lines
443 B
Plaintext
Raw Normal View History

2011-06-19 18:41:19 +02:00
#!/bin/bash
2011-07-08 17:53:06 +02:00
MINIMODEM="${MINIMODEM-./minimodem}"
2012-08-12 01:25:51 +02:00
[ $# -ge 2 ] || {
echo "usage: self-test textfile minimodem_args" 1>&2
2011-06-19 18:41:19 +02:00
exit 1
}
2012-08-12 01:25:51 +02:00
textfile="$1"
shift
minimodem_args="$*"
2011-06-19 18:41:19 +02:00
TMPF="/tmp/minimodem-test-$$.wav"
2011-06-19 18:41:19 +02:00
trap "rm -f $TMPF" 0
set -e
2012-08-14 06:17:38 +02:00
echo
echo "$MINIMODEM ... $minimodem_args < $textfile"
2012-08-12 01:25:51 +02:00
$MINIMODEM --tx -T 1 --file $TMPF $minimodem_args < "$textfile"
2011-06-22 01:06:11 +02:00
# ls -l $TMPF
2012-08-12 01:25:51 +02:00
$MINIMODEM --rx --file $TMPF $minimodem_args | diff "$textfile" -
2011-06-19 18:41:19 +02:00