minimodem-mirror/src/self-test

20 lines
362 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}"
2011-06-19 18:41:19 +02:00
[ $# -eq 2 ] || {
echo "usage: self-test baudmode textfile" 1>&2
exit 1
}
baudmode="$1"
textfile="$2"
TMPF="/tmp/minimodem-test-$$.wav"
2011-06-19 18:41:19 +02:00
trap "rm -f $TMPF" 0
set -e
$MINIMODEM --tx -T 1 --file $TMPF "$baudmode" < "$textfile"
2011-06-22 01:06:11 +02:00
# ls -l $TMPF
2011-07-08 17:53:06 +02:00
$MINIMODEM --rx --file $TMPF "$baudmode" | diff "$textfile" -
2011-06-19 18:41:19 +02:00