minimodem: --binary-output

This commit is contained in:
Kamal Mostafa 2012-09-01 00:09:32 -07:00
parent a172268117
commit 7b0e47ac4e
2 changed files with 17 additions and 0 deletions

View File

@ -122,6 +122,12 @@ default 16-bit signed integer format (applies to \-\-tx mode only;
.B \-\-rx-one
Quit after the first carrier/no-carrier event (applies to \-\-rx mode only).
.TP
.B \-\-binary-output
Print received data bits as raw binary output using characters '0' and '1'.
The bits are printed in the order they are received. Framing bits (start
and stop bits) are omitted from the output.
(This option applies to \-\-rx mode only).
.TP
.B \-\-benchmarks
Run and report internal performance tests (all other flags are ignored).
.TP

View File

@ -300,6 +300,7 @@ usage()
" --float-samples\n"
" --rx-one\n"
" --benchmarks\n"
" --binary-output\n"
" {baudmode}\n"
" 1200 Bell202 1200 bps --ascii\n"
" 300 Bell103 300 bps --ascii\n"
@ -354,6 +355,8 @@ main( int argc, char*argv[] )
unsigned int rx_one = 0;
float rxnoise_factor = 0.0;
int output_mode_binary = 0;
/* validate the default system audio mechanism */
#if !(USE_PULSEAUDIO || USE_ALSA)
# define _MINIMODEM_NO_SYSTEM_AUDIO
@ -380,6 +383,7 @@ main( int argc, char*argv[] )
MINIMODEM_OPT_FLOAT_SAMPLES,
MINIMODEM_OPT_RX_ONE,
MINIMODEM_OPT_BENCHMARKS,
MINIMODEM_OPT_BINARY_OUTPUT,
MINIMODEM_OPT_XRXNOISE,
};
@ -412,6 +416,7 @@ main( int argc, char*argv[] )
{ "float-samples", 0, 0, MINIMODEM_OPT_FLOAT_SAMPLES },
{ "rx-one", 0, 0, MINIMODEM_OPT_RX_ONE },
{ "benchmarks", 0, 0, MINIMODEM_OPT_BENCHMARKS },
{ "binary-output", 0, 0, MINIMODEM_OPT_BINARY_OUTPUT },
{ "Xrxnoise", 1, 0, MINIMODEM_OPT_XRXNOISE },
{ 0 }
};
@ -510,6 +515,9 @@ main( int argc, char*argv[] )
benchmarks();
exit(0);
break;
case MINIMODEM_OPT_BINARY_OUTPUT:
output_mode_binary = 1;
break;
case MINIMODEM_OPT_XRXNOISE:
rxnoise_factor = atof(optarg);
break;
@ -592,6 +600,9 @@ main( int argc, char*argv[] )
assert( 0 && bfsk_n_data_bits );
}
if ( output_mode_binary )
bfsk_databits_decode = databits_decode_binary;
if ( bfsk_data_rate >= 400 ) {
/*
* Bell 202: baud=1200 mark=1200 space=2200