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"
|
|
|
|
|
2011-06-24 08:47:46 +02:00
|
|
|
TMPF="/tmp/minimodem-test-$$.wav"
|
2011-06-19 18:41:19 +02:00
|
|
|
trap "rm -f $TMPF" 0
|
|
|
|
|
|
|
|
set -e
|
2011-07-08 20:53:50 +02:00
|
|
|
$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
|
|
|
|