minimodem: --binary-raw {nbits} output mode

This commit is contained in:
Kamal Mostafa 2015-04-21 10:39:00 -07:00
parent 1439efa68d
commit 49bfa06f8e
2 changed files with 23 additions and 1 deletions

View File

@ -173,6 +173,15 @@ 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 \-\-binary-raw {nbits}
Print all received bits (data bits and any framing bits) as raw binary output
using characters '0' and '1'. Framing bits are not interpreted, but simply
passed through to the output. The bits are printed in the order they are
received, in lines {nbits} wide. So in order to display a standard 8-N-1
bitstream (8 databits + 1 start bit + 1 stop bit), use "--binary-raw 10"
or a multiple of 10.
(This option applies to \-\-rx mode only).
.TP
.B \-\-print-filter
Filter the received text output, replacing any "non-printable" bytes
with a '.' character.

View File

@ -358,6 +358,7 @@ usage()
" --rx-one\n"
" --benchmarks\n"
" --binary-output\n"
" --binary-raw {nbits}\n"
" --print-filter\n"
" {baudmode}\n"
" any_number_N Bell-like N bps --ascii\n"
@ -473,6 +474,7 @@ main( int argc, char*argv[] )
float rxnoise_factor = 0.0;
int output_mode_binary = 0;
int output_mode_raw_nbits = 0;
float bfsk_data_rate = 0.0;
databits_encoder *bfsk_databits_encode;
@ -510,6 +512,7 @@ main( int argc, char*argv[] )
MINIMODEM_OPT_RX_ONE,
MINIMODEM_OPT_BENCHMARKS,
MINIMODEM_OPT_BINARY_OUTPUT,
MINIMODEM_OPT_BINARY_RAW,
MINIMODEM_OPT_PRINT_FILTER,
MINIMODEM_OPT_XRXNOISE,
};
@ -548,6 +551,7 @@ main( int argc, char*argv[] )
{ "rx-one", 0, 0, MINIMODEM_OPT_RX_ONE },
{ "benchmarks", 0, 0, MINIMODEM_OPT_BENCHMARKS },
{ "binary-output", 0, 0, MINIMODEM_OPT_BINARY_OUTPUT },
{ "binary-raw", 1, 0, MINIMODEM_OPT_BINARY_RAW },
{ "print-filter", 0, 0, MINIMODEM_OPT_PRINT_FILTER },
{ "Xrxnoise", 1, 0, MINIMODEM_OPT_XRXNOISE },
{ 0 }
@ -669,6 +673,9 @@ main( int argc, char*argv[] )
case MINIMODEM_OPT_BINARY_OUTPUT:
output_mode_binary = 1;
break;
case MINIMODEM_OPT_BINARY_RAW:
output_mode_raw_nbits = atoi(optarg);
break;
case MINIMODEM_OPT_PRINT_FILTER:
output_print_filter = 1;
break;
@ -772,9 +779,15 @@ main( int argc, char*argv[] )
usage();
if ( output_mode_binary )
if ( output_mode_binary || output_mode_raw_nbits )
bfsk_databits_decode = databits_decode_binary;
if ( output_mode_raw_nbits ) {
bfsk_nstartbits = 0;
bfsk_nstopbits = 0;
bfsk_n_data_bits = output_mode_raw_nbits;
}
if ( bfsk_data_rate >= 400 ) {
/*
* Bell 202: baud=1200 mark=1200 space=2200