pentoo-overlay/net-dialup/minimodem/files/minimodem-0.22.1-ttytdd.patch
2016-02-07 17:03:47 +08:00

68 lines
2.4 KiB
Diff

From f48257ac595afbc8f576d5ac4fcc180a608c6a25 Mon Sep 17 00:00:00 2001
From: Rodrigo Menezes <rodrigo@rapidlight.io>
Date: Tue, 19 Jan 2016 19:31:20 -0200
Subject: [PATCH] TTY/TDD support
---
src/minimodem.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/minimodem.c b/src/minimodem.c
index 7cc8c46..812bdfa 100644
--- a/src/minimodem.c
+++ b/src/minimodem.c
@@ -409,6 +409,7 @@ usage()
" 1200 Bell202 1200 bps --ascii\n"
" 300 Bell103 300 bps --ascii\n"
" rtty RTTY 45.45 bps --baudot --stopbits=1.5\n"
+ " tdd TTY/TDD 45.45 bps --baudot --stopbits=2.0\n"
" same NOAA SAME 520.83 bps --sync-byte=0xAB ...\n"
" callerid Bell202 CID 1200 bps\n"
" uic{-train,-ground} UIC-751-3 Train/Ground 600 bps\n"
@@ -781,6 +782,16 @@ main( int argc, char*argv[] )
bfsk_n_data_bits = 5;
if ( bfsk_nstopbits < 0 )
bfsk_nstopbits = 1.5;
+ } else if ( strncasecmp(modem_mode, "tdd",3)==0 ) {
+ bfsk_databits_decode = databits_decode_baudot;
+ bfsk_databits_encode = databits_encode_baudot;
+ bfsk_data_rate = 45.45;
+ if ( bfsk_n_data_bits == 0 )
+ bfsk_n_data_bits = 5;
+ if ( bfsk_nstopbits < 0 )
+ bfsk_nstopbits = 2.0;
+ bfsk_mark_f = 1400;
+ bfsk_space_f = 1800;
} else if ( strncasecmp(modem_mode, "same",5)==0 ) {
// http://www.nws.noaa.gov/nwr/nwrsame.htm
bfsk_data_rate = 520.0 + 5/6.0;
diff --git a/src/minimodem.1.in b/src/minimodem.1.in
index dc4f6b0..c95a0ee 100644
--- a/src/minimodem.1.in
+++ b/src/minimodem.1.in
@@ -31,7 +31,7 @@ is a command-line program which decodes (or generates) audio
modem tones at any specified baud rate, using various framing protocols.
It acts a general-purpose software FSK modem, and includes support for
various standard FSK protocols such as Bell103, Bell202, RTTY, NOAA SAME,
-and Caller-ID.
+TTY/TDD, and Caller-ID.
.PP
.B Minimodem
can play and capture audio modem tones in real-time via the system
@@ -67,6 +67,9 @@ default mark and space tone frequencies.
.B rtty
: RTTY 45.45 bps \-\-baudot \-\-stopbits 1.5
.TP
+.B tdd
+: TTY/TDD 45.45 bps \-\-baudot \-\-stopbits 2.0
+.TP
.B same
: SAME 520.83 bps \-\-startbits 0 \-\-stopbits 0 \-\-sync-byte 0xAB
.br
diff --git a/tests/81-tdd.test b/tests/81-tdd.test
new file mode 100755
index 0000000..a55a2ac
--- /dev/null
+++ b/tests/81-tdd.test
@@ -0,0 +1 @@
+exec ./self-test testdata-baudot.txt tdd