Compare commits
17 Commits
minimodem-
...
master
Author | SHA1 | Date |
---|---|---|
Sebastien Van Cauwenberghe | 9a1e8769ab | |
Kamal Mostafa | d4ce82136d | |
Kamal Mostafa | 17e17b784e | |
Kamal Mostafa | fc03264643 | |
Kamal Mostafa | ea3f837c90 | |
Kamal Mostafa | 78cff1778b | |
Kamal Mostafa | c2e4d9e1c4 | |
Chris Osborn | 513a11d454 | |
Kamal Mostafa | 84b2406b97 | |
Kamal Mostafa | ad83ef5df3 | |
Colin Ian King | 96a60f51b0 | |
Colin Ian King | 2d3bd487ca | |
Colin Ian King | 7397c3cd9b | |
Colin Ian King | d6a616fff8 | |
Colin Ian King | 632e92f1ae | |
Kamal Mostafa | 93b35cbd9d | |
Kamal Mostafa | 3a8d490074 |
|
@ -1,5 +1,5 @@
|
||||||
AC_PREREQ([2.64])
|
AC_PREREQ([2.64])
|
||||||
AC_INIT([minimodem], [0.23], [kamal@whence.com])
|
AC_INIT([minimodem], [0.24], [kamal@whence.com])
|
||||||
AC_CONFIG_HEADERS([config.h])
|
AC_CONFIG_HEADERS([config.h])
|
||||||
AC_CONFIG_SRCDIR([src/Makefile.in])
|
AC_CONFIG_SRCDIR([src/Makefile.in])
|
||||||
AM_INIT_AUTOMAKE
|
AM_INIT_AUTOMAKE
|
||||||
|
|
|
@ -1,3 +1,21 @@
|
||||||
|
minimodem (0.24-1) unstable; urgency=medium
|
||||||
|
|
||||||
|
[ Chris Osborn ]
|
||||||
|
|
||||||
|
* Limit carrier/idle generation for input with delays
|
||||||
|
|
||||||
|
[ Kamal Mostafa ]
|
||||||
|
|
||||||
|
* Fix --tx float consistency: disable .wav "PEAK chunk" header
|
||||||
|
* Do not emit 0.5 sec flush for audio file output
|
||||||
|
* debian: bump standards-version=3.9.7 and debhelper-compat-version=9
|
||||||
|
|
||||||
|
[ Colin Ian King ]
|
||||||
|
|
||||||
|
* multiple static analysis and warnings fixes
|
||||||
|
|
||||||
|
-- Kamal Mostafa <kamal@whence.com> Sat, 23 Apr 2016 10:35:44 -0700
|
||||||
|
|
||||||
minimodem (0.23-1) unstable; urgency=medium
|
minimodem (0.23-1) unstable; urgency=medium
|
||||||
|
|
||||||
[ Rodrigo Menezes ]
|
[ Rodrigo Menezes ]
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
7
|
9
|
||||||
|
|
|
@ -2,8 +2,8 @@ Source: minimodem
|
||||||
Section: comm
|
Section: comm
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Maintainer: Kamal Mostafa <kamal@whence.com>
|
Maintainer: Kamal Mostafa <kamal@whence.com>
|
||||||
Build-Depends: debhelper (>= 7.0.50~), libfftw3-dev, libpulse-dev, libasound2-dev [linux-any], libsndfile1-dev
|
Build-Depends: debhelper (>= 9), libfftw3-dev, libpulse-dev, libasound2-dev [linux-any], libsndfile1-dev
|
||||||
Standards-Version: 3.9.6
|
Standards-Version: 3.9.7
|
||||||
Homepage: http://www.whence.com/minimodem
|
Homepage: http://www.whence.com/minimodem
|
||||||
Vcs-Git: https://github.com/kamalmostafa/minimodem.git
|
Vcs-Git: https://github.com/kamalmostafa/minimodem.git
|
||||||
Vcs-Browser: https://github.com/kamalmostafa/minimodem
|
Vcs-Browser: https://github.com/kamalmostafa/minimodem
|
||||||
|
|
|
@ -194,7 +194,7 @@ baudot_encode_table[0x60][2] = {
|
||||||
* 1 LTRS state
|
* 1 LTRS state
|
||||||
* 2 FIGS state
|
* 2 FIGS state
|
||||||
*/
|
*/
|
||||||
static int baudot_charset = 0; // FIXME
|
static unsigned int baudot_charset = 0; // FIXME
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
16
src/fsk.c
16
src/fsk.c
|
@ -62,7 +62,7 @@ fsk_plan_new(
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
debug_log("### b_mark=%u b_space=%u fftsize=%u\n",
|
debug_log("### b_mark=%u b_space=%u fftsize=%d\n",
|
||||||
fskp->b_mark, fskp->b_space, fskp->fftsize);
|
fskp->b_mark, fskp->b_space, fskp->fftsize);
|
||||||
|
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit,
|
||||||
assert( expect_bits[bitnum] == '1' || expect_bits[bitnum] == '0' );
|
assert( expect_bits[bitnum] == '1' || expect_bits[bitnum] == '0' );
|
||||||
|
|
||||||
bit_begin_sample = (float)(samples_per_bit * bitnum + 0.5f);
|
bit_begin_sample = (float)(samples_per_bit * bitnum + 0.5f);
|
||||||
debug_log( " bit# %2u @ %7u: ", bitnum, bit_begin_sample);
|
debug_log( " bit# %2d @ %7u: ", bitnum, bit_begin_sample);
|
||||||
fsk_bit_analyze(fskp, samples+bit_begin_sample, bit_nsamples,
|
fsk_bit_analyze(fskp, samples+bit_begin_sample, bit_nsamples,
|
||||||
&bit_values[bitnum],
|
&bit_values[bitnum],
|
||||||
&bit_sig_mags[bitnum],
|
&bit_sig_mags[bitnum],
|
||||||
|
@ -247,7 +247,7 @@ fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit,
|
||||||
if ( expect_bits[bitnum] != 'd' )
|
if ( expect_bits[bitnum] != 'd' )
|
||||||
continue;
|
continue;
|
||||||
bit_begin_sample = (float)(samples_per_bit * bitnum + 0.5f);
|
bit_begin_sample = (float)(samples_per_bit * bitnum + 0.5f);
|
||||||
debug_log( " bit# %2u @ %7u: ", bitnum, bit_begin_sample);
|
debug_log( " bit# %2d @ %7u: ", bitnum, bit_begin_sample);
|
||||||
fsk_bit_analyze(fskp, samples+bit_begin_sample, bit_nsamples,
|
fsk_bit_analyze(fskp, samples+bit_begin_sample, bit_nsamples,
|
||||||
&bit_values[bitnum],
|
&bit_values[bitnum],
|
||||||
&bit_sig_mags[bitnum],
|
&bit_sig_mags[bitnum],
|
||||||
|
@ -440,7 +440,7 @@ fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit,
|
||||||
for ( bitnum=0; bitnum<n_bits; bitnum++ )
|
for ( bitnum=0; bitnum<n_bits; bitnum++ )
|
||||||
*bits_outp |= (unsigned long long) bit_values[bitnum] << bitnum;
|
*bits_outp |= (unsigned long long) bit_values[bitnum] << bitnum;
|
||||||
|
|
||||||
debug_log(" frame algo=%u confidence=%f ampl=%f\n",
|
debug_log(" frame algo=%d confidence=%f ampl=%f\n",
|
||||||
CONFIDENCE_ALGO, confidence, *ampl_outp);
|
CONFIDENCE_ALGO, confidence, *ampl_outp);
|
||||||
return confidence;
|
return confidence;
|
||||||
}
|
}
|
||||||
|
@ -474,14 +474,14 @@ fsk_find_frame( fsk_plan *fskp, float *samples, unsigned int frame_nsamples,
|
||||||
int j;
|
int j;
|
||||||
for ( j=0; ; j++ )
|
for ( j=0; ; j++ )
|
||||||
{
|
{
|
||||||
int up = j%2 ? 1 : -1;
|
int up = ( j % 2 ) ? 1 : -1;
|
||||||
int t = try_first_sample + up*((j+1)/2)*try_step_nsamples;
|
int t = try_first_sample + up*((j+1)/2)*try_step_nsamples;
|
||||||
if ( t >= (int)try_max_nsamples )
|
if ( t >= (int)try_max_nsamples )
|
||||||
break;
|
break;
|
||||||
if ( t < 0 )
|
if ( t < 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
float c, ampl_out;
|
float c, ampl_out = 0.0;
|
||||||
unsigned long long bits_out = 0;
|
unsigned long long bits_out = 0;
|
||||||
debug_log("try fsk_frame_analyze at t=%d\n", t);
|
debug_log("try fsk_frame_analyze at t=%d\n", t);
|
||||||
c = fsk_frame_analyze(fskp, samples+t, samples_per_bit,
|
c = fsk_frame_analyze(fskp, samples+t, samples_per_bit,
|
||||||
|
@ -525,8 +525,8 @@ fsk_find_frame( fsk_plan *fskp, float *samples, unsigned int frame_nsamples,
|
||||||
|
|
||||||
debug_log("FSK_FRAME bits='");
|
debug_log("FSK_FRAME bits='");
|
||||||
for ( j=0; j<expect_n_bits; j++ )
|
for ( j=0; j<expect_n_bits; j++ )
|
||||||
debug_log("%c", ( *bits_outp >> j ) & 1 ? '1' : '0' );
|
debug_log("%c", ( ( *bits_outp >> j ) & 1 ) ? '1' : '0' );
|
||||||
debug_log("' datum='%c' (0x%02x) c=%f a=%f t=%d\n",
|
debug_log("' datum='%c' (0x%02x) c=%f a=%f t=%u\n",
|
||||||
isprint(bitchar)||isspace(bitchar) ? bitchar : '.',
|
isprint(bitchar)||isspace(bitchar) ? bitchar : '.',
|
||||||
bitchar,
|
bitchar,
|
||||||
confidence, best_a, best_t);
|
confidence, best_a, best_t);
|
||||||
|
|
|
@ -190,6 +190,9 @@ Filter the received text output, replacing any "non-printable" bytes
|
||||||
with a '.' character.
|
with a '.' character.
|
||||||
(This option applies to \-\-rx mode only).
|
(This option applies to \-\-rx mode only).
|
||||||
.TP
|
.TP
|
||||||
|
.B \-\-print-eot
|
||||||
|
Print "### EOT" to stderr after each transmit completes.
|
||||||
|
.TP
|
||||||
.B \-\-tx-carrier
|
.B \-\-tx-carrier
|
||||||
When transmitting from a blocking source, keep a carrier going while waiting
|
When transmitting from a blocking source, keep a carrier going while waiting
|
||||||
for more data.
|
for more data.
|
||||||
|
|
|
@ -46,12 +46,14 @@
|
||||||
char *program_name = "";
|
char *program_name = "";
|
||||||
|
|
||||||
int tx_transmitting = 0;
|
int tx_transmitting = 0;
|
||||||
|
int tx_print_eot = 0;
|
||||||
int tx_leader_bits_len = 2;
|
int tx_leader_bits_len = 2;
|
||||||
int tx_trailer_bits_len = 2;
|
int tx_trailer_bits_len = 2;
|
||||||
|
|
||||||
simpleaudio *tx_sa_out;
|
simpleaudio *tx_sa_out;
|
||||||
float tx_bfsk_mark_f;
|
float tx_bfsk_mark_f;
|
||||||
unsigned int tx_bit_nsamples;
|
unsigned int tx_bit_nsamples;
|
||||||
|
unsigned int tx_flush_nsamples;
|
||||||
|
|
||||||
void
|
void
|
||||||
tx_stop_transmit_sighandler( int sig )
|
tx_stop_transmit_sighandler( int sig )
|
||||||
|
@ -62,11 +64,12 @@ tx_stop_transmit_sighandler( int sig )
|
||||||
for ( j=0; j<tx_trailer_bits_len; j++ )
|
for ( j=0; j<tx_trailer_bits_len; j++ )
|
||||||
simpleaudio_tone(tx_sa_out, tx_bfsk_mark_f, tx_bit_nsamples);
|
simpleaudio_tone(tx_sa_out, tx_bfsk_mark_f, tx_bit_nsamples);
|
||||||
|
|
||||||
// 0.5 sec of zero samples to flush - FIXME lame
|
if ( tx_flush_nsamples )
|
||||||
size_t sample_rate = simpleaudio_get_rate(tx_sa_out);
|
simpleaudio_tone(tx_sa_out, 0, tx_flush_nsamples);
|
||||||
simpleaudio_tone(tx_sa_out, 0, sample_rate/2);
|
|
||||||
|
|
||||||
tx_transmitting = 0;
|
tx_transmitting = 0;
|
||||||
|
if ( tx_print_eot )
|
||||||
|
fprintf(stderr, "### EOT\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -130,6 +133,10 @@ static void fsk_transmit_stdin(
|
||||||
tx_sa_out = sa_out;
|
tx_sa_out = sa_out;
|
||||||
tx_bfsk_mark_f = bfsk_mark_f;
|
tx_bfsk_mark_f = bfsk_mark_f;
|
||||||
tx_bit_nsamples = bit_nsamples;
|
tx_bit_nsamples = bit_nsamples;
|
||||||
|
if ( tx_interactive )
|
||||||
|
tx_flush_nsamples = sample_rate/2; // 0.5 sec of zero samples to flush
|
||||||
|
else
|
||||||
|
tx_flush_nsamples = 0;
|
||||||
|
|
||||||
// one-shot
|
// one-shot
|
||||||
struct itimerval itv = {
|
struct itimerval itv = {
|
||||||
|
@ -142,6 +149,9 @@ static void fsk_transmit_stdin(
|
||||||
{0, 0} // it_value
|
{0, 0} // it_value
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// arbitrary chosen timeout value: 1/25 of a second
|
||||||
|
unsigned int idle_carrier_usec = (1000000/25);
|
||||||
|
|
||||||
int block_input = tx_interactive && !txcarrier;
|
int block_input = tx_interactive && !txcarrier;
|
||||||
if ( block_input )
|
if ( block_input )
|
||||||
signal(SIGALRM, tx_stop_transmit_sighandler);
|
signal(SIGALRM, tx_stop_transmit_sighandler);
|
||||||
|
@ -159,8 +169,16 @@ static void fsk_transmit_stdin(
|
||||||
{
|
{
|
||||||
FD_ZERO(&fdset);
|
FD_ZERO(&fdset);
|
||||||
FD_SET(fd, &fdset);
|
FD_SET(fd, &fdset);
|
||||||
struct timeval tv_zero = { 0, 0 };
|
struct timeval tv_idletimeout = { 0, 0 };
|
||||||
if( block_input || select(fd+1, &fdset, NULL, NULL, &tv_zero) )
|
|
||||||
|
if ( !tx_interactive ) {
|
||||||
|
// When stdin blocks we "emit idle tone", for a duration of
|
||||||
|
// idle_carrier_usec. If !tx_interactive (i.e. writing to an
|
||||||
|
// audio file) make the select timeout the same duration.
|
||||||
|
tv_idletimeout.tv_usec = idle_carrier_usec;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( block_input || select(fd+1, &fdset, NULL, NULL, &tv_idletimeout) )
|
||||||
{
|
{
|
||||||
n_read = read(fd, &buf, sizeof(buf));
|
n_read = read(fd, &buf, sizeof(buf));
|
||||||
if( n_read <= 0 ) //Includes EOF (0) and errors (-1)
|
if( n_read <= 0 ) //Includes EOF (0) and errors (-1)
|
||||||
|
@ -211,10 +229,10 @@ static void fsk_transmit_stdin(
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tx_transmitting = 1;
|
tx_transmitting = 1;
|
||||||
unsigned int j;
|
|
||||||
/* emit idle tone (mark) */
|
/* emit idle tone (mark) */
|
||||||
for ( j=0; j<tx_leader_bits_len; j++ )
|
simpleaudio_tone(sa_out,
|
||||||
simpleaudio_tone(sa_out, invert_start_stop ? bfsk_space_f : bfsk_mark_f, sample_rate/50);
|
invert_start_stop ? bfsk_space_f : bfsk_mark_f,
|
||||||
|
idle_carrier_usec * sample_rate / 1000000);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( block_input )
|
if ( block_input )
|
||||||
|
@ -403,6 +421,7 @@ usage()
|
||||||
" --binary-output\n"
|
" --binary-output\n"
|
||||||
" --binary-raw {nbits}\n"
|
" --binary-raw {nbits}\n"
|
||||||
" --print-filter\n"
|
" --print-filter\n"
|
||||||
|
" --print-eot\n"
|
||||||
" --tx-carrier\n"
|
" --tx-carrier\n"
|
||||||
" {baudmode}\n"
|
" {baudmode}\n"
|
||||||
" any_number_N Bell-like N bps --ascii\n"
|
" any_number_N Bell-like N bps --ascii\n"
|
||||||
|
@ -562,6 +581,7 @@ main( int argc, char*argv[] )
|
||||||
MINIMODEM_OPT_BINARY_RAW,
|
MINIMODEM_OPT_BINARY_RAW,
|
||||||
MINIMODEM_OPT_PRINT_FILTER,
|
MINIMODEM_OPT_PRINT_FILTER,
|
||||||
MINIMODEM_OPT_XRXNOISE,
|
MINIMODEM_OPT_XRXNOISE,
|
||||||
|
MINIMODEM_OPT_PRINT_EOT,
|
||||||
MINIMODEM_OPT_TXCARRIER
|
MINIMODEM_OPT_TXCARRIER
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -601,6 +621,7 @@ main( int argc, char*argv[] )
|
||||||
{ "binary-output", 0, 0, MINIMODEM_OPT_BINARY_OUTPUT },
|
{ "binary-output", 0, 0, MINIMODEM_OPT_BINARY_OUTPUT },
|
||||||
{ "binary-raw", 1, 0, MINIMODEM_OPT_BINARY_RAW },
|
{ "binary-raw", 1, 0, MINIMODEM_OPT_BINARY_RAW },
|
||||||
{ "print-filter", 0, 0, MINIMODEM_OPT_PRINT_FILTER },
|
{ "print-filter", 0, 0, MINIMODEM_OPT_PRINT_FILTER },
|
||||||
|
{ "print-eot", 0, 0, MINIMODEM_OPT_PRINT_EOT },
|
||||||
{ "Xrxnoise", 1, 0, MINIMODEM_OPT_XRXNOISE },
|
{ "Xrxnoise", 1, 0, MINIMODEM_OPT_XRXNOISE },
|
||||||
{ "tx-carrier", 0, 0, MINIMODEM_OPT_TXCARRIER },
|
{ "tx-carrier", 0, 0, MINIMODEM_OPT_TXCARRIER },
|
||||||
{ 0 }
|
{ 0 }
|
||||||
|
@ -734,6 +755,9 @@ main( int argc, char*argv[] )
|
||||||
case MINIMODEM_OPT_TXCARRIER:
|
case MINIMODEM_OPT_TXCARRIER:
|
||||||
txcarrier = 1;
|
txcarrier = 1;
|
||||||
break;
|
break;
|
||||||
|
case MINIMODEM_OPT_PRINT_EOT:
|
||||||
|
tx_print_eot = 1;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
}
|
}
|
||||||
|
@ -782,7 +806,7 @@ main( int argc, char*argv[] )
|
||||||
bfsk_n_data_bits = 5;
|
bfsk_n_data_bits = 5;
|
||||||
if ( bfsk_nstopbits < 0 )
|
if ( bfsk_nstopbits < 0 )
|
||||||
bfsk_nstopbits = 1.5;
|
bfsk_nstopbits = 1.5;
|
||||||
} else if ( strncasecmp(modem_mode, "tdd",3)==0 ) {
|
} else if ( strncasecmp(modem_mode, "tdd",4)==0 ) {
|
||||||
bfsk_databits_decode = databits_decode_baudot;
|
bfsk_databits_decode = databits_decode_baudot;
|
||||||
bfsk_databits_encode = databits_encode_baudot;
|
bfsk_databits_encode = databits_encode_baudot;
|
||||||
bfsk_data_rate = 45.45;
|
bfsk_data_rate = 45.45;
|
||||||
|
@ -1111,7 +1135,7 @@ main( int argc, char*argv[] )
|
||||||
assert ( samples_nvalid + read_nsamples <= samplebuf_size );
|
assert ( samples_nvalid + read_nsamples <= samplebuf_size );
|
||||||
ssize_t r;
|
ssize_t r;
|
||||||
r = simpleaudio_read(sa, samples_readptr, read_nsamples);
|
r = simpleaudio_read(sa, samples_readptr, read_nsamples);
|
||||||
debug_log("simpleaudio_read(samplebuf+%zd, n=%zu) returns %zd\n",
|
debug_log("simpleaudio_read(samplebuf+%td, n=%zu) returns %zd\n",
|
||||||
samples_readptr - samplebuf, read_nsamples, r);
|
samples_readptr - samplebuf, read_nsamples, r);
|
||||||
if ( r < 0 ) {
|
if ( r < 0 ) {
|
||||||
fprintf(stderr, "simpleaudio_read: error\n");
|
fprintf(stderr, "simpleaudio_read: error\n");
|
||||||
|
@ -1374,7 +1398,7 @@ main( int argc, char*argv[] )
|
||||||
if (bfsk_msb_first) {
|
if (bfsk_msb_first) {
|
||||||
bits = bit_reverse(bits, bfsk_n_data_bits);
|
bits = bit_reverse(bits, bfsk_n_data_bits);
|
||||||
}
|
}
|
||||||
debug_log("Input: %08x%08x - Databits: %i - Shift: %i\n", (unsigned int)(bits >> 32), (unsigned int)bits, bfsk_n_data_bits, bfsk_nstartbits);
|
debug_log("Input: %08x%08x - Databits: %u - Shift: %i\n", (unsigned int)(bits >> 32), (unsigned int)bits, bfsk_n_data_bits, bfsk_nstartbits);
|
||||||
|
|
||||||
unsigned int dataout_size = 4096;
|
unsigned int dataout_size = 4096;
|
||||||
char dataoutbuf[4096];
|
char dataoutbuf[4096];
|
||||||
|
|
|
@ -200,6 +200,15 @@ sa_sndfile_open_stream(
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Disable the insertion of this questionable "PEAK chunk" header thing.
|
||||||
|
// Relates only to writing SF_FORMAT_FLOAT .wav and .aiff files
|
||||||
|
// (minimodem --tx --float-samples). When left enabled, this adds some
|
||||||
|
// wonky bytes to the header which change from run to run (different every
|
||||||
|
// wall-clock second. WTF?
|
||||||
|
// http://www.mega-nerd.com/libsndfile/command.html#SFC_SET_ADD_PEAK_CHUNK
|
||||||
|
/* Turn off the PEAK chunk. */
|
||||||
|
sf_command(s, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_FALSE);
|
||||||
|
|
||||||
/* good or bad to override these? */
|
/* good or bad to override these? */
|
||||||
sa->rate = sfinfo.samplerate;
|
sa->rate = sfinfo.samplerate;
|
||||||
sa->channels = sfinfo.channels;
|
sa->channels = sfinfo.channels;
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
MINIMODEM="${MINIMODEM-./minimodem}"
|
||||||
|
[ -f "$MINIMODEM" ] || {
|
||||||
|
MINIMODEM="../src/minimodem"
|
||||||
|
[ -f "$MINIMODEM" ] || {
|
||||||
|
echo "E: cannot find minimodem in ./ or ../src/" 1>&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
minimodem_tx_args="1200 $1"
|
||||||
|
|
||||||
|
textfile="testdata-ascii.txt"
|
||||||
|
|
||||||
|
TMPF="/tmp/minimodem-test-$$"
|
||||||
|
trap "rm -f $TMPF.*" 0
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
$MINIMODEM --tx --file $TMPF.1.wav $minimodem_tx_args < "$textfile"
|
||||||
|
sleep 1
|
||||||
|
$MINIMODEM --tx --file $TMPF.2.wav $minimodem_tx_args < "$textfile"
|
||||||
|
sleep 1
|
||||||
|
$MINIMODEM --tx --file $TMPF.3.wav $minimodem_tx_args < "$textfile"
|
||||||
|
|
||||||
|
cmp -s $TMPF.1.wav $TMPF.2.wav || {
|
||||||
|
echo -e "TX-NOT-CONSISTENT"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
cmp -s $TMPF.1.wav $TMPF.3.wav || {
|
||||||
|
echo -e "TX-NOT-CONSISTENT"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
stats="three runs of '--tx $minimodem_tx_args' created identical output"
|
||||||
|
|
||||||
|
result="OK "
|
||||||
|
exitcode=0
|
||||||
|
|
||||||
|
echo -e "$result $stats"
|
||||||
|
|
||||||
|
exit $exitcode
|
|
@ -0,0 +1 @@
|
||||||
|
exec ./16-verify-tx-consistent.test --float-samples
|
Loading…
Reference in New Issue