diff --git a/src/minimodem.c b/src/minimodem.c index 192c230..e1cb167 100644 --- a/src/minimodem.c +++ b/src/minimodem.c @@ -107,6 +107,8 @@ static void fsk_transmit_stdin( int n_data_bits, float bfsk_nstartbits, float bfsk_nstopbits, + unsigned int bfsk_do_tx_sync_bytes, + unsigned int bfsk_sync_byte, databits_encoder encode ) { @@ -141,16 +143,23 @@ static void fsk_transmit_stdin( // fprintf(stderr, "", c); unsigned int nwords; unsigned int bits[2]; + unsigned int j; nwords = encode(bits, c); if ( !tx_transmitting ) { tx_transmitting = 1; - int j; + /* emit leader tone (mark) */ for ( j=0; j&2 - exit 1 - } -} - - -teststring="Testing 0 1 2 3 4. This is only a test. Testing 5 6 7 8 9. This is only a test." -[ "$1" != "" ] && teststring="$1" - - -TMPF="/tmp/minimodem-test-$$" -trap "rm -f $TMPF.*" 0 - -set -e - -minimodem_tx_args="SAME" -minimodem_rx_args="SAME" - - -# insert the 0xAB SAME sync byte to simulate the start of a SAME -# protocol bytestream. -printf "JUNK\\xAB${teststring}" \ -| $MINIMODEM --tx --file $TMPF.wav $minimodem_tx_args - -# cp $TMPF.wav /tmp/x.wav - -$MINIMODEM --rx --file $TMPF.wav $minimodem_rx_args \ - > $TMPF.out 2> $TMPF.err || { - cat $TMPF.err - exit 1 -} - -# printf "$teststring" | cmp - $TMPF.out -printf "$teststring" | diff - $TMPF.out - -{ - read xlitcarrier - read xlitblankline - read xlithashes xlitnocarrier stats - stats="${stats% ###}" -} < $TMPF.err - - -result="OK " -exitcode=0 - -echo -e "$result $stats" - -exit $exitcode