From 9a1e8769ab15623fc27850fa41452201e8e40566 Mon Sep 17 00:00:00 2001 From: Sebastien Van Cauwenberghe Date: Sun, 4 Dec 2016 20:18:52 +0100 Subject: [PATCH] Add EOT message When program keeps running, the ### EOT message allows the user to know that the stdin has been fully transmitted. --- src/minimodem.1.in | 3 +++ src/minimodem.c | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/src/minimodem.1.in b/src/minimodem.1.in index 90a42db..0347b03 100644 --- a/src/minimodem.1.in +++ b/src/minimodem.1.in @@ -190,6 +190,9 @@ Filter the received text output, replacing any "non-printable" bytes with a '.' character. (This option applies to \-\-rx mode only). .TP +.B \-\-print-eot +Print "### EOT" to stderr after each transmit completes. +.TP .B \-\-tx-carrier When transmitting from a blocking source, keep a carrier going while waiting for more data. diff --git a/src/minimodem.c b/src/minimodem.c index d8e1ac6..838b1d0 100644 --- a/src/minimodem.c +++ b/src/minimodem.c @@ -46,6 +46,7 @@ char *program_name = ""; int tx_transmitting = 0; +int tx_print_eot = 0; int tx_leader_bits_len = 2; int tx_trailer_bits_len = 2; @@ -67,6 +68,8 @@ tx_stop_transmit_sighandler( int sig ) simpleaudio_tone(tx_sa_out, 0, tx_flush_nsamples); tx_transmitting = 0; + if ( tx_print_eot ) + fprintf(stderr, "### EOT\n"); } @@ -418,6 +421,7 @@ usage() " --binary-output\n" " --binary-raw {nbits}\n" " --print-filter\n" + " --print-eot\n" " --tx-carrier\n" " {baudmode}\n" " any_number_N Bell-like N bps --ascii\n" @@ -577,6 +581,7 @@ main( int argc, char*argv[] ) MINIMODEM_OPT_BINARY_RAW, MINIMODEM_OPT_PRINT_FILTER, MINIMODEM_OPT_XRXNOISE, + MINIMODEM_OPT_PRINT_EOT, MINIMODEM_OPT_TXCARRIER }; @@ -616,6 +621,7 @@ main( int argc, char*argv[] ) { "binary-output", 0, 0, MINIMODEM_OPT_BINARY_OUTPUT }, { "binary-raw", 1, 0, MINIMODEM_OPT_BINARY_RAW }, { "print-filter", 0, 0, MINIMODEM_OPT_PRINT_FILTER }, + { "print-eot", 0, 0, MINIMODEM_OPT_PRINT_EOT }, { "Xrxnoise", 1, 0, MINIMODEM_OPT_XRXNOISE }, { "tx-carrier", 0, 0, MINIMODEM_OPT_TXCARRIER }, { 0 } @@ -749,6 +755,9 @@ main( int argc, char*argv[] ) case MINIMODEM_OPT_TXCARRIER: txcarrier = 1; break; + case MINIMODEM_OPT_PRINT_EOT: + tx_print_eot = 1; + break; default: usage(); }