minimodem: -7 implements 7-bit ASCII

This commit is contained in:
Kamal Mostafa 2013-09-17 07:56:20 -07:00
parent a524e38222
commit 151e360720
2 changed files with 8 additions and 2 deletions

View File

@ -328,6 +328,7 @@ usage()
" -c, --confidence {min-confidence-threshold}\n"
" -l, --limit {max-confidence-search-limit}\n"
" -8, --ascii ASCII 8-N-1\n"
" -7, ASCII 7-N-1\n"
" -5, --baudot Baudot 5-N-1\n"
" -f, --file {filename.flac}\n"
" -b, --bandwidth {rx_bandwidth}\n"
@ -461,6 +462,7 @@ main( int argc, char*argv[] )
{ "auto-carrier", 0, 0, 'a' },
{ "inverted", 0, 0, 'i' },
{ "ascii", 0, 0, '8' },
{ "", 0, 0, '7' },
{ "baudot", 0, 0, '5' },
{ "file", 1, 0, 'f' },
{ "bandwidth", 1, 0, 'b' },
@ -482,7 +484,7 @@ main( int argc, char*argv[] )
{ "Xrxnoise", 1, 0, MINIMODEM_OPT_XRXNOISE },
{ 0 }
};
c = getopt_long(argc, argv, "Vtrc:l:ai85f:b:v:M:S:T:qA::R:",
c = getopt_long(argc, argv, "Vtrc:l:ai875f:b:v:M:S:T:qA::R:",
long_options, &option_index);
if ( c == -1 )
break;
@ -518,6 +520,9 @@ main( int argc, char*argv[] )
case '8':
bfsk_n_data_bits = 8;
break;
case '7':
bfsk_n_data_bits = 7;
break;
case '5':
bfsk_n_data_bits = 5;
bfsk_databits_decode = databits_decode_baudot;
@ -827,7 +832,7 @@ main( int argc, char*argv[] )
unsigned int nbits = 0;
nbits += 1; // prev stop bit (last whole stop bit)
nbits += bfsk_nstartbits; // start bits
nbits += 8; // (n_data_bits)
nbits += bfsk_n_data_bits;
nbits += 1; // stop bit (first whole stop bit)
// FIXME EXPLAIN +1 goes with extra bit when scanning

1
tests/test-81-ascii7 Executable file
View File

@ -0,0 +1 @@
exec ./self-test testdata-ascii.txt -7 1200