From 287678bc56b7ab51a242b9041021529e7aceda6a Mon Sep 17 00:00:00 2001 From: Steve Underwood Date: Sat, 14 Jul 2012 23:34:40 +0800 Subject: [PATCH] Tweaks to spandsp tests Addition of tones to modem connect tones Repeat function for V.18 TDD --- libs/spandsp/src/Makefile.am | 9 +- libs/spandsp/src/async.c | 35 +- libs/spandsp/src/cielab_luts.h | 4389 +++++++++++++++++ libs/spandsp/src/fax_modems.c | 1 + libs/spandsp/src/fsk.c | 60 +- libs/spandsp/src/modem_connect_tones.c | 75 +- libs/spandsp/src/spandsp/fsk.h | 6 +- .../spandsp/src/spandsp/modem_connect_tones.h | 4 +- libs/spandsp/src/spandsp/private/async.h | 4 +- libs/spandsp/src/spandsp/private/v18.h | 1 + libs/spandsp/src/v18.c | 145 +- .../spandsp/tests/modem_connect_tones_tests.c | 454 +- libs/spandsp/tests/t38_core_tests.c | 2 +- libs/spandsp/tests/t4_tests.c | 6 +- libs/spandsp/tests/tsb85_tests.c | 8 +- libs/spandsp/tests/v17_tests.c | 2 + libs/spandsp/tests/v18_tests.c | 1718 ++++++- libs/spandsp/tests/v22bis_tests.c | 2 + libs/spandsp/tests/v27ter_tests.c | 2 + libs/spandsp/tests/v29_tests.c | 2 + libs/spandsp/tests/v8_tests.c | 12 + 21 files changed, 6702 insertions(+), 235 deletions(-) create mode 100644 libs/spandsp/src/cielab_luts.h diff --git a/libs/spandsp/src/Makefile.am b/libs/spandsp/src/Makefile.am index ce4f5bad4c..a6846151eb 100644 --- a/libs/spandsp/src/Makefile.am +++ b/libs/spandsp/src/Makefile.am @@ -19,8 +19,6 @@ AM_CFLAGS = $(COMP_VENDOR_CFLAGS) AM_LDFLAGS = $(COMP_VENDOR_LDFLAGS) -MAINTAINERCLEANFILES = Makefile.in - DISTCLEANFILES = $(srcdir)/at_interpreter_dictionary.h \ $(srcdir)/math_fixed_tables.h \ $(srcdir)/v17_v32bis_rx_fixed_rrc.h \ @@ -46,6 +44,10 @@ DISTCLEANFILES = $(srcdir)/at_interpreter_dictionary.h \ $(srcdir)/v29tx_fixed_rrc.h \ $(srcdir)/v29tx_floating_rrc.h +CLEANFILES = ${DISTCLEANFILES} +MOSTLYCLEANFILES = ${DISTCLEANFILES} +MAINTAINERCLEANFILES = ${DISTCLEANFILES} + EXTRA_DIST = floating_fudge.h \ libspandsp.dsp \ libspandsp.2005.sln \ @@ -322,7 +324,8 @@ nobase_include_HEADERS = spandsp/ademco_contactid.h \ nodist_include_HEADERS = spandsp.h -noinst_HEADERS = faxfont.h \ +noinst_HEADERS = cielab_luts.h \ + faxfont.h \ filter_tools.h \ gsm0610_local.h \ lpc10_encdecs.h \ diff --git a/libs/spandsp/src/async.c b/libs/spandsp/src/async.c index 518642111e..3552d644ee 100644 --- a/libs/spandsp/src/async.c +++ b/libs/spandsp/src/async.c @@ -179,27 +179,30 @@ SPAN_DECLARE_NONSTD(void) async_rx_put_bit(void *user_data, int bit) { /* Align the received value */ if (s->data_bits < 8) - s->byte_in_progress >>= (8 - s->data_bits); + s->byte_in_progress = (s->byte_in_progress & 0xFF) >> (8 - s->data_bits); s->put_byte(s->user_data, s->byte_in_progress); s->bitpos = 0; } - else if (s->use_v14) - { - /* This is actually the start bit for the next character, and - the stop bit has been dropped from the stream. This is the - rate adaption specified in V.14 */ - /* Align the received value */ - if (s->data_bits < 8) - s->byte_in_progress >>= (8 - s->data_bits); - s->put_byte(s->user_data, s->byte_in_progress); - s->bitpos = 1; - s->parity_bit = 0; - s->byte_in_progress = 0; - } else { - s->framing_errors++; - s->bitpos = 0; + if (s->use_v14) + { + /* This is actually the start bit for the next character, and + the stop bit has been dropped from the stream. This is the + rate adaption specified in V.14 */ + /* Align the received value */ + if (s->data_bits < 8) + s->byte_in_progress = (s->byte_in_progress & 0xFF) >> (8 - s->data_bits); + s->put_byte(s->user_data, s->byte_in_progress); + s->bitpos = 1; + s->parity_bit = 0; + s->byte_in_progress = 0; + } + else + { + s->framing_errors++; + s->bitpos = 0; + } } } } diff --git a/libs/spandsp/src/cielab_luts.h b/libs/spandsp/src/cielab_luts.h new file mode 100644 index 0000000000..73e72ac824 --- /dev/null +++ b/libs/spandsp/src/cielab_luts.h @@ -0,0 +1,4389 @@ +/* + * SpanDSP - a series of DSP components for telephony + * + * cielab_luts.h + * + * Written by Steve Underwood + * + * Copyright (C) 2011 Steve Underwood + * + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 2.1, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/*! \file */ + +#if defined(T42_USE_LUTS) +static const float sRGB_to_linear[256] = +{ + 0.000000, + 0.000302, + 0.000605, + 0.000907, + 0.001209, + 0.001512, + 0.001814, + 0.002116, + 0.002419, + 0.002721, + 0.003023, + 0.003333, + 0.003661, + 0.004007, + 0.004371, + 0.004754, + 0.005156, + 0.005577, + 0.006017, + 0.006477, + 0.006957, + 0.007457, + 0.007977, + 0.008518, + 0.009080, + 0.009663, + 0.010267, + 0.010893, + 0.011540, + 0.012209, + 0.012900, + 0.013614, + 0.014350, + 0.015109, + 0.015890, + 0.016695, + 0.017523, + 0.018375, + 0.019250, + 0.020149, + 0.021072, + 0.022019, + 0.022991, + 0.023987, + 0.025008, + 0.026054, + 0.027125, + 0.028221, + 0.029343, + 0.030490, + 0.031663, + 0.032862, + 0.034087, + 0.035338, + 0.036616, + 0.037920, + 0.039250, + 0.040608, + 0.041993, + 0.043404, + 0.044844, + 0.046310, + 0.047804, + 0.049326, + 0.050876, + 0.052454, + 0.054060, + 0.055694, + 0.057357, + 0.059049, + 0.060769, + 0.062518, + 0.064296, + 0.066103, + 0.067940, + 0.069806, + 0.071701, + 0.073626, + 0.075581, + 0.077566, + 0.079581, + 0.081627, + 0.083702, + 0.085808, + 0.087945, + 0.090112, + 0.092311, + 0.094540, + 0.096800, + 0.099092, + 0.101414, + 0.103769, + 0.106155, + 0.108572, + 0.111021, + 0.113503, + 0.116016, + 0.118562, + 0.121139, + 0.123750, + 0.126392, + 0.129068, + 0.131776, + 0.134517, + 0.137291, + 0.140098, + 0.142938, + 0.145812, + 0.148719, + 0.151659, + 0.154633, + 0.157641, + 0.160683, + 0.163758, + 0.166868, + 0.170012, + 0.173190, + 0.176403, + 0.179650, + 0.182932, + 0.186248, + 0.189599, + 0.192985, + 0.196407, + 0.199863, + 0.203354, + 0.206881, + 0.210443, + 0.214041, + 0.217675, + 0.221344, + 0.225049, + 0.228789, + 0.232566, + 0.236379, + 0.240229, + 0.244114, + 0.248036, + 0.251995, + 0.255990, + 0.260021, + 0.264090, + 0.268196, + 0.272338, + 0.276518, + 0.280734, + 0.284988, + 0.289280, + 0.293609, + 0.297975, + 0.302379, + 0.306821, + 0.311301, + 0.315818, + 0.320374, + 0.324967, + 0.329599, + 0.334269, + 0.338978, + 0.343725, + 0.348510, + 0.353334, + 0.358197, + 0.363099, + 0.368040, + 0.373019, + 0.378038, + 0.383096, + 0.388193, + 0.393329, + 0.398505, + 0.403721, + 0.408976, + 0.414270, + 0.419605, + 0.424979, + 0.430393, + 0.435848, + 0.441342, + 0.446877, + 0.452452, + 0.458067, + 0.463722, + 0.469419, + 0.475156, + 0.480933, + 0.486751, + 0.492610, + 0.498510, + 0.504452, + 0.510434, + 0.516457, + 0.522522, + 0.528628, + 0.534775, + 0.540964, + 0.547194, + 0.553466, + 0.559780, + 0.566136, + 0.572533, + 0.578973, + 0.585455, + 0.591978, + 0.598544, + 0.605152, + 0.611803, + 0.618496, + 0.625232, + 0.632010, + 0.638831, + 0.645694, + 0.652600, + 0.659550, + 0.666542, + 0.673577, + 0.680656, + 0.687777, + 0.694942, + 0.702151, + 0.709402, + 0.716698, + 0.724036, + 0.731419, + 0.738845, + 0.746315, + 0.753829, + 0.761386, + 0.768988, + 0.776634, + 0.784324, + 0.792058, + 0.799837, + 0.807660, + 0.815527, + 0.823439, + 0.831396, + 0.839397, + 0.847443, + 0.855533, + 0.863669, + 0.871850, + 0.880075, + 0.888346, + 0.896662, + 0.905023, + 0.913429, + 0.921881, + 0.930378, + 0.938921, + 0.947509, + 0.956143, + 0.964823, + 0.973548, + 0.982319, + 0.991137 +}; + +static const uint8_t linear_to_sRGB[4096] = +{ + 0, + 0, + 1, + 2, + 3, + 4, + 4, + 5, + 6, + 7, + 8, + 8, + 9, + 10, + 11, + 12, + 12, + 13, + 14, + 14, + 15, + 15, + 16, + 17, + 17, + 18, + 18, + 19, + 19, + 20, + 20, + 21, + 21, + 22, + 22, + 23, + 23, + 23, + 24, + 24, + 25, + 25, + 25, + 26, + 26, + 27, + 27, + 27, + 28, + 28, + 28, + 29, + 29, + 30, + 30, + 30, + 31, + 31, + 31, + 32, + 32, + 32, + 33, + 33, + 33, + 33, + 34, + 34, + 34, + 35, + 35, + 35, + 36, + 36, + 36, + 36, + 37, + 37, + 37, + 38, + 38, + 38, + 38, + 39, + 39, + 39, + 39, + 40, + 40, + 40, + 40, + 41, + 41, + 41, + 41, + 42, + 42, + 42, + 42, + 43, + 43, + 43, + 43, + 44, + 44, + 44, + 44, + 45, + 45, + 45, + 45, + 45, + 46, + 46, + 46, + 46, + 47, + 47, + 47, + 47, + 47, + 48, + 48, + 48, + 48, + 49, + 49, + 49, + 49, + 49, + 50, + 50, + 50, + 50, + 50, + 51, + 51, + 51, + 51, + 51, + 52, + 52, + 52, + 52, + 52, + 53, + 53, + 53, + 53, + 53, + 54, + 54, + 54, + 54, + 54, + 54, + 55, + 55, + 55, + 55, + 55, + 56, + 56, + 56, + 56, + 56, + 56, + 57, + 57, + 57, + 57, + 57, + 57, + 58, + 58, + 58, + 58, + 58, + 59, + 59, + 59, + 59, + 59, + 59, + 60, + 60, + 60, + 60, + 60, + 60, + 61, + 61, + 61, + 61, + 61, + 61, + 62, + 62, + 62, + 62, + 62, + 62, + 62, + 63, + 63, + 63, + 63, + 63, + 63, + 64, + 64, + 64, + 64, + 64, + 64, + 65, + 65, + 65, + 65, + 65, + 65, + 65, + 66, + 66, + 66, + 66, + 66, + 66, + 66, + 67, + 67, + 67, + 67, + 67, + 67, + 68, + 68, + 68, + 68, + 68, + 68, + 68, + 69, + 69, + 69, + 69, + 69, + 69, + 69, + 70, + 70, + 70, + 70, + 70, + 70, + 70, + 70, + 71, + 71, + 71, + 71, + 71, + 71, + 71, + 72, + 72, + 72, + 72, + 72, + 72, + 72, + 73, + 73, + 73, + 73, + 73, + 73, + 73, + 73, + 74, + 74, + 74, + 74, + 74, + 74, + 74, + 75, + 75, + 75, + 75, + 75, + 75, + 75, + 75, + 76, + 76, + 76, + 76, + 76, + 76, + 76, + 76, + 77, + 77, + 77, + 77, + 77, + 77, + 77, + 77, + 78, + 78, + 78, + 78, + 78, + 78, + 78, + 78, + 79, + 79, + 79, + 79, + 79, + 79, + 79, + 79, + 80, + 80, + 80, + 80, + 80, + 80, + 80, + 80, + 80, + 81, + 81, + 81, + 81, + 81, + 81, + 81, + 81, + 82, + 82, + 82, + 82, + 82, + 82, + 82, + 82, + 82, + 83, + 83, + 83, + 83, + 83, + 83, + 83, + 83, + 83, + 84, + 84, + 84, + 84, + 84, + 84, + 84, + 84, + 84, + 85, + 85, + 85, + 85, + 85, + 85, + 85, + 85, + 85, + 86, + 86, + 86, + 86, + 86, + 86, + 86, + 86, + 86, + 87, + 87, + 87, + 87, + 87, + 87, + 87, + 87, + 87, + 88, + 88, + 88, + 88, + 88, + 88, + 88, + 88, + 88, + 89, + 89, + 89, + 89, + 89, + 89, + 89, + 89, + 89, + 89, + 90, + 90, + 90, + 90, + 90, + 90, + 90, + 90, + 90, + 90, + 91, + 91, + 91, + 91, + 91, + 91, + 91, + 91, + 91, + 92, + 92, + 92, + 92, + 92, + 92, + 92, + 92, + 92, + 92, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 93, + 94, + 94, + 94, + 94, + 94, + 94, + 94, + 94, + 94, + 94, + 95, + 95, + 95, + 95, + 95, + 95, + 95, + 95, + 95, + 95, + 95, + 96, + 96, + 96, + 96, + 96, + 96, + 96, + 96, + 96, + 96, + 97, + 97, + 97, + 97, + 97, + 97, + 97, + 97, + 97, + 97, + 97, + 98, + 98, + 98, + 98, + 98, + 98, + 98, + 98, + 98, + 98, + 99, + 99, + 99, + 99, + 99, + 99, + 99, + 99, + 99, + 99, + 99, + 100, + 100, + 100, + 100, + 100, + 100, + 100, + 100, + 100, + 100, + 100, + 101, + 101, + 101, + 101, + 101, + 101, + 101, + 101, + 101, + 101, + 101, + 102, + 102, + 102, + 102, + 102, + 102, + 102, + 102, + 102, + 102, + 102, + 103, + 103, + 103, + 103, + 103, + 103, + 103, + 103, + 103, + 103, + 103, + 103, + 104, + 104, + 104, + 104, + 104, + 104, + 104, + 104, + 104, + 104, + 104, + 105, + 105, + 105, + 105, + 105, + 105, + 105, + 105, + 105, + 105, + 105, + 105, + 106, + 106, + 106, + 106, + 106, + 106, + 106, + 106, + 106, + 106, + 106, + 106, + 107, + 107, + 107, + 107, + 107, + 107, + 107, + 107, + 107, + 107, + 107, + 107, + 108, + 108, + 108, + 108, + 108, + 108, + 108, + 108, + 108, + 108, + 108, + 108, + 109, + 109, + 109, + 109, + 109, + 109, + 109, + 109, + 109, + 109, + 109, + 109, + 110, + 110, + 110, + 110, + 110, + 110, + 110, + 110, + 110, + 110, + 110, + 110, + 111, + 111, + 111, + 111, + 111, + 111, + 111, + 111, + 111, + 111, + 111, + 111, + 111, + 112, + 112, + 112, + 112, + 112, + 112, + 112, + 112, + 112, + 112, + 112, + 112, + 113, + 113, + 113, + 113, + 113, + 113, + 113, + 113, + 113, + 113, + 113, + 113, + 113, + 114, + 114, + 114, + 114, + 114, + 114, + 114, + 114, + 114, + 114, + 114, + 114, + 114, + 115, + 115, + 115, + 115, + 115, + 115, + 115, + 115, + 115, + 115, + 115, + 115, + 115, + 116, + 116, + 116, + 116, + 116, + 116, + 116, + 116, + 116, + 116, + 116, + 116, + 116, + 117, + 117, + 117, + 117, + 117, + 117, + 117, + 117, + 117, + 117, + 117, + 117, + 117, + 118, + 118, + 118, + 118, + 118, + 118, + 118, + 118, + 118, + 118, + 118, + 118, + 118, + 118, + 119, + 119, + 119, + 119, + 119, + 119, + 119, + 119, + 119, + 119, + 119, + 119, + 119, + 120, + 120, + 120, + 120, + 120, + 120, + 120, + 120, + 120, + 120, + 120, + 120, + 120, + 120, + 121, + 121, + 121, + 121, + 121, + 121, + 121, + 121, + 121, + 121, + 121, + 121, + 121, + 121, + 122, + 122, + 122, + 122, + 122, + 122, + 122, + 122, + 122, + 122, + 122, + 122, + 122, + 122, + 123, + 123, + 123, + 123, + 123, + 123, + 123, + 123, + 123, + 123, + 123, + 123, + 123, + 123, + 124, + 124, + 124, + 124, + 124, + 124, + 124, + 124, + 124, + 124, + 124, + 124, + 124, + 124, + 125, + 125, + 125, + 125, + 125, + 125, + 125, + 125, + 125, + 125, + 125, + 125, + 125, + 125, + 125, + 126, + 126, + 126, + 126, + 126, + 126, + 126, + 126, + 126, + 126, + 126, + 126, + 126, + 126, + 127, + 127, + 127, + 127, + 127, + 127, + 127, + 127, + 127, + 127, + 127, + 127, + 127, + 127, + 127, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 128, + 129, + 129, + 129, + 129, + 129, + 129, + 129, + 129, + 129, + 129, + 129, + 129, + 129, + 129, + 129, + 130, + 130, + 130, + 130, + 130, + 130, + 130, + 130, + 130, + 130, + 130, + 130, + 130, + 130, + 130, + 131, + 131, + 131, + 131, + 131, + 131, + 131, + 131, + 131, + 131, + 131, + 131, + 131, + 131, + 131, + 131, + 132, + 132, + 132, + 132, + 132, + 132, + 132, + 132, + 132, + 132, + 132, + 132, + 132, + 132, + 132, + 133, + 133, + 133, + 133, + 133, + 133, + 133, + 133, + 133, + 133, + 133, + 133, + 133, + 133, + 133, + 133, + 134, + 134, + 134, + 134, + 134, + 134, + 134, + 134, + 134, + 134, + 134, + 134, + 134, + 134, + 134, + 135, + 135, + 135, + 135, + 135, + 135, + 135, + 135, + 135, + 135, + 135, + 135, + 135, + 135, + 135, + 135, + 136, + 136, + 136, + 136, + 136, + 136, + 136, + 136, + 136, + 136, + 136, + 136, + 136, + 136, + 136, + 136, + 137, + 137, + 137, + 137, + 137, + 137, + 137, + 137, + 137, + 137, + 137, + 137, + 137, + 137, + 137, + 137, + 137, + 138, + 138, + 138, + 138, + 138, + 138, + 138, + 138, + 138, + 138, + 138, + 138, + 138, + 138, + 138, + 138, + 139, + 139, + 139, + 139, + 139, + 139, + 139, + 139, + 139, + 139, + 139, + 139, + 139, + 139, + 139, + 139, + 139, + 140, + 140, + 140, + 140, + 140, + 140, + 140, + 140, + 140, + 140, + 140, + 140, + 140, + 140, + 140, + 140, + 141, + 141, + 141, + 141, + 141, + 141, + 141, + 141, + 141, + 141, + 141, + 141, + 141, + 141, + 141, + 141, + 141, + 142, + 142, + 142, + 142, + 142, + 142, + 142, + 142, + 142, + 142, + 142, + 142, + 142, + 142, + 142, + 142, + 142, + 143, + 143, + 143, + 143, + 143, + 143, + 143, + 143, + 143, + 143, + 143, + 143, + 143, + 143, + 143, + 143, + 143, + 144, + 144, + 144, + 144, + 144, + 144, + 144, + 144, + 144, + 144, + 144, + 144, + 144, + 144, + 144, + 144, + 144, + 145, + 145, + 145, + 145, + 145, + 145, + 145, + 145, + 145, + 145, + 145, + 145, + 145, + 145, + 145, + 145, + 145, + 145, + 146, + 146, + 146, + 146, + 146, + 146, + 146, + 146, + 146, + 146, + 146, + 146, + 146, + 146, + 146, + 146, + 146, + 147, + 147, + 147, + 147, + 147, + 147, + 147, + 147, + 147, + 147, + 147, + 147, + 147, + 147, + 147, + 147, + 147, + 147, + 148, + 148, + 148, + 148, + 148, + 148, + 148, + 148, + 148, + 148, + 148, + 148, + 148, + 148, + 148, + 148, + 148, + 148, + 149, + 149, + 149, + 149, + 149, + 149, + 149, + 149, + 149, + 149, + 149, + 149, + 149, + 149, + 149, + 149, + 149, + 149, + 150, + 150, + 150, + 150, + 150, + 150, + 150, + 150, + 150, + 150, + 150, + 150, + 150, + 150, + 150, + 150, + 150, + 150, + 151, + 151, + 151, + 151, + 151, + 151, + 151, + 151, + 151, + 151, + 151, + 151, + 151, + 151, + 151, + 151, + 151, + 151, + 151, + 152, + 152, + 152, + 152, + 152, + 152, + 152, + 152, + 152, + 152, + 152, + 152, + 152, + 152, + 152, + 152, + 152, + 152, + 153, + 153, + 153, + 153, + 153, + 153, + 153, + 153, + 153, + 153, + 153, + 153, + 153, + 153, + 153, + 153, + 153, + 153, + 153, + 154, + 154, + 154, + 154, + 154, + 154, + 154, + 154, + 154, + 154, + 154, + 154, + 154, + 154, + 154, + 154, + 154, + 154, + 154, + 155, + 155, + 155, + 155, + 155, + 155, + 155, + 155, + 155, + 155, + 155, + 155, + 155, + 155, + 155, + 155, + 155, + 155, + 155, + 156, + 156, + 156, + 156, + 156, + 156, + 156, + 156, + 156, + 156, + 156, + 156, + 156, + 156, + 156, + 156, + 156, + 156, + 156, + 157, + 157, + 157, + 157, + 157, + 157, + 157, + 157, + 157, + 157, + 157, + 157, + 157, + 157, + 157, + 157, + 157, + 157, + 157, + 158, + 158, + 158, + 158, + 158, + 158, + 158, + 158, + 158, + 158, + 158, + 158, + 158, + 158, + 158, + 158, + 158, + 158, + 158, + 159, + 159, + 159, + 159, + 159, + 159, + 159, + 159, + 159, + 159, + 159, + 159, + 159, + 159, + 159, + 159, + 159, + 159, + 159, + 159, + 160, + 160, + 160, + 160, + 160, + 160, + 160, + 160, + 160, + 160, + 160, + 160, + 160, + 160, + 160, + 160, + 160, + 160, + 160, + 160, + 161, + 161, + 161, + 161, + 161, + 161, + 161, + 161, + 161, + 161, + 161, + 161, + 161, + 161, + 161, + 161, + 161, + 161, + 161, + 161, + 162, + 162, + 162, + 162, + 162, + 162, + 162, + 162, + 162, + 162, + 162, + 162, + 162, + 162, + 162, + 162, + 162, + 162, + 162, + 162, + 163, + 163, + 163, + 163, + 163, + 163, + 163, + 163, + 163, + 163, + 163, + 163, + 163, + 163, + 163, + 163, + 163, + 163, + 163, + 163, + 164, + 164, + 164, + 164, + 164, + 164, + 164, + 164, + 164, + 164, + 164, + 164, + 164, + 164, + 164, + 164, + 164, + 164, + 164, + 164, + 165, + 165, + 165, + 165, + 165, + 165, + 165, + 165, + 165, + 165, + 165, + 165, + 165, + 165, + 165, + 165, + 165, + 165, + 165, + 165, + 165, + 166, + 166, + 166, + 166, + 166, + 166, + 166, + 166, + 166, + 166, + 166, + 166, + 166, + 166, + 166, + 166, + 166, + 166, + 166, + 166, + 166, + 167, + 167, + 167, + 167, + 167, + 167, + 167, + 167, + 167, + 167, + 167, + 167, + 167, + 167, + 167, + 167, + 167, + 167, + 167, + 167, + 167, + 168, + 168, + 168, + 168, + 168, + 168, + 168, + 168, + 168, + 168, + 168, + 168, + 168, + 168, + 168, + 168, + 168, + 168, + 168, + 168, + 168, + 169, + 169, + 169, + 169, + 169, + 169, + 169, + 169, + 169, + 169, + 169, + 169, + 169, + 169, + 169, + 169, + 169, + 169, + 169, + 169, + 169, + 170, + 170, + 170, + 170, + 170, + 170, + 170, + 170, + 170, + 170, + 170, + 170, + 170, + 170, + 170, + 170, + 170, + 170, + 170, + 170, + 170, + 171, + 171, + 171, + 171, + 171, + 171, + 171, + 171, + 171, + 171, + 171, + 171, + 171, + 171, + 171, + 171, + 171, + 171, + 171, + 171, + 171, + 171, + 172, + 172, + 172, + 172, + 172, + 172, + 172, + 172, + 172, + 172, + 172, + 172, + 172, + 172, + 172, + 172, + 172, + 172, + 172, + 172, + 172, + 173, + 173, + 173, + 173, + 173, + 173, + 173, + 173, + 173, + 173, + 173, + 173, + 173, + 173, + 173, + 173, + 173, + 173, + 173, + 173, + 173, + 173, + 174, + 174, + 174, + 174, + 174, + 174, + 174, + 174, + 174, + 174, + 174, + 174, + 174, + 174, + 174, + 174, + 174, + 174, + 174, + 174, + 174, + 174, + 175, + 175, + 175, + 175, + 175, + 175, + 175, + 175, + 175, + 175, + 175, + 175, + 175, + 175, + 175, + 175, + 175, + 175, + 175, + 175, + 175, + 175, + 176, + 176, + 176, + 176, + 176, + 176, + 176, + 176, + 176, + 176, + 176, + 176, + 176, + 176, + 176, + 176, + 176, + 176, + 176, + 176, + 176, + 176, + 176, + 177, + 177, + 177, + 177, + 177, + 177, + 177, + 177, + 177, + 177, + 177, + 177, + 177, + 177, + 177, + 177, + 177, + 177, + 177, + 177, + 177, + 177, + 178, + 178, + 178, + 178, + 178, + 178, + 178, + 178, + 178, + 178, + 178, + 178, + 178, + 178, + 178, + 178, + 178, + 178, + 178, + 178, + 178, + 178, + 178, + 179, + 179, + 179, + 179, + 179, + 179, + 179, + 179, + 179, + 179, + 179, + 179, + 179, + 179, + 179, + 179, + 179, + 179, + 179, + 179, + 179, + 179, + 179, + 180, + 180, + 180, + 180, + 180, + 180, + 180, + 180, + 180, + 180, + 180, + 180, + 180, + 180, + 180, + 180, + 180, + 180, + 180, + 180, + 180, + 180, + 180, + 181, + 181, + 181, + 181, + 181, + 181, + 181, + 181, + 181, + 181, + 181, + 181, + 181, + 181, + 181, + 181, + 181, + 181, + 181, + 181, + 181, + 181, + 181, + 182, + 182, + 182, + 182, + 182, + 182, + 182, + 182, + 182, + 182, + 182, + 182, + 182, + 182, + 182, + 182, + 182, + 182, + 182, + 182, + 182, + 182, + 182, + 183, + 183, + 183, + 183, + 183, + 183, + 183, + 183, + 183, + 183, + 183, + 183, + 183, + 183, + 183, + 183, + 183, + 183, + 183, + 183, + 183, + 183, + 183, + 183, + 184, + 184, + 184, + 184, + 184, + 184, + 184, + 184, + 184, + 184, + 184, + 184, + 184, + 184, + 184, + 184, + 184, + 184, + 184, + 184, + 184, + 184, + 184, + 185, + 185, + 185, + 185, + 185, + 185, + 185, + 185, + 185, + 185, + 185, + 185, + 185, + 185, + 185, + 185, + 185, + 185, + 185, + 185, + 185, + 185, + 185, + 185, + 186, + 186, + 186, + 186, + 186, + 186, + 186, + 186, + 186, + 186, + 186, + 186, + 186, + 186, + 186, + 186, + 186, + 186, + 186, + 186, + 186, + 186, + 186, + 186, + 187, + 187, + 187, + 187, + 187, + 187, + 187, + 187, + 187, + 187, + 187, + 187, + 187, + 187, + 187, + 187, + 187, + 187, + 187, + 187, + 187, + 187, + 187, + 187, + 188, + 188, + 188, + 188, + 188, + 188, + 188, + 188, + 188, + 188, + 188, + 188, + 188, + 188, + 188, + 188, + 188, + 188, + 188, + 188, + 188, + 188, + 188, + 188, + 188, + 189, + 189, + 189, + 189, + 189, + 189, + 189, + 189, + 189, + 189, + 189, + 189, + 189, + 189, + 189, + 189, + 189, + 189, + 189, + 189, + 189, + 189, + 189, + 189, + 190, + 190, + 190, + 190, + 190, + 190, + 190, + 190, + 190, + 190, + 190, + 190, + 190, + 190, + 190, + 190, + 190, + 190, + 190, + 190, + 190, + 190, + 190, + 190, + 190, + 191, + 191, + 191, + 191, + 191, + 191, + 191, + 191, + 191, + 191, + 191, + 191, + 191, + 191, + 191, + 191, + 191, + 191, + 191, + 191, + 191, + 191, + 191, + 191, + 191, + 192, + 192, + 192, + 192, + 192, + 192, + 192, + 192, + 192, + 192, + 192, + 192, + 192, + 192, + 192, + 192, + 192, + 192, + 192, + 192, + 192, + 192, + 192, + 192, + 192, + 193, + 193, + 193, + 193, + 193, + 193, + 193, + 193, + 193, + 193, + 193, + 193, + 193, + 193, + 193, + 193, + 193, + 193, + 193, + 193, + 193, + 193, + 193, + 193, + 193, + 194, + 194, + 194, + 194, + 194, + 194, + 194, + 194, + 194, + 194, + 194, + 194, + 194, + 194, + 194, + 194, + 194, + 194, + 194, + 194, + 194, + 194, + 194, + 194, + 194, + 195, + 195, + 195, + 195, + 195, + 195, + 195, + 195, + 195, + 195, + 195, + 195, + 195, + 195, + 195, + 195, + 195, + 195, + 195, + 195, + 195, + 195, + 195, + 195, + 195, + 195, + 196, + 196, + 196, + 196, + 196, + 196, + 196, + 196, + 196, + 196, + 196, + 196, + 196, + 196, + 196, + 196, + 196, + 196, + 196, + 196, + 196, + 196, + 196, + 196, + 196, + 197, + 197, + 197, + 197, + 197, + 197, + 197, + 197, + 197, + 197, + 197, + 197, + 197, + 197, + 197, + 197, + 197, + 197, + 197, + 197, + 197, + 197, + 197, + 197, + 197, + 197, + 198, + 198, + 198, + 198, + 198, + 198, + 198, + 198, + 198, + 198, + 198, + 198, + 198, + 198, + 198, + 198, + 198, + 198, + 198, + 198, + 198, + 198, + 198, + 198, + 198, + 198, + 199, + 199, + 199, + 199, + 199, + 199, + 199, + 199, + 199, + 199, + 199, + 199, + 199, + 199, + 199, + 199, + 199, + 199, + 199, + 199, + 199, + 199, + 199, + 199, + 199, + 199, + 199, + 200, + 200, + 200, + 200, + 200, + 200, + 200, + 200, + 200, + 200, + 200, + 200, + 200, + 200, + 200, + 200, + 200, + 200, + 200, + 200, + 200, + 200, + 200, + 200, + 200, + 200, + 201, + 201, + 201, + 201, + 201, + 201, + 201, + 201, + 201, + 201, + 201, + 201, + 201, + 201, + 201, + 201, + 201, + 201, + 201, + 201, + 201, + 201, + 201, + 201, + 201, + 201, + 201, + 202, + 202, + 202, + 202, + 202, + 202, + 202, + 202, + 202, + 202, + 202, + 202, + 202, + 202, + 202, + 202, + 202, + 202, + 202, + 202, + 202, + 202, + 202, + 202, + 202, + 202, + 203, + 203, + 203, + 203, + 203, + 203, + 203, + 203, + 203, + 203, + 203, + 203, + 203, + 203, + 203, + 203, + 203, + 203, + 203, + 203, + 203, + 203, + 203, + 203, + 203, + 203, + 203, + 204, + 204, + 204, + 204, + 204, + 204, + 204, + 204, + 204, + 204, + 204, + 204, + 204, + 204, + 204, + 204, + 204, + 204, + 204, + 204, + 204, + 204, + 204, + 204, + 204, + 204, + 204, + 205, + 205, + 205, + 205, + 205, + 205, + 205, + 205, + 205, + 205, + 205, + 205, + 205, + 205, + 205, + 205, + 205, + 205, + 205, + 205, + 205, + 205, + 205, + 205, + 205, + 205, + 205, + 206, + 206, + 206, + 206, + 206, + 206, + 206, + 206, + 206, + 206, + 206, + 206, + 206, + 206, + 206, + 206, + 206, + 206, + 206, + 206, + 206, + 206, + 206, + 206, + 206, + 206, + 206, + 206, + 207, + 207, + 207, + 207, + 207, + 207, + 207, + 207, + 207, + 207, + 207, + 207, + 207, + 207, + 207, + 207, + 207, + 207, + 207, + 207, + 207, + 207, + 207, + 207, + 207, + 207, + 207, + 208, + 208, + 208, + 208, + 208, + 208, + 208, + 208, + 208, + 208, + 208, + 208, + 208, + 208, + 208, + 208, + 208, + 208, + 208, + 208, + 208, + 208, + 208, + 208, + 208, + 208, + 208, + 208, + 209, + 209, + 209, + 209, + 209, + 209, + 209, + 209, + 209, + 209, + 209, + 209, + 209, + 209, + 209, + 209, + 209, + 209, + 209, + 209, + 209, + 209, + 209, + 209, + 209, + 209, + 209, + 209, + 210, + 210, + 210, + 210, + 210, + 210, + 210, + 210, + 210, + 210, + 210, + 210, + 210, + 210, + 210, + 210, + 210, + 210, + 210, + 210, + 210, + 210, + 210, + 210, + 210, + 210, + 210, + 210, + 211, + 211, + 211, + 211, + 211, + 211, + 211, + 211, + 211, + 211, + 211, + 211, + 211, + 211, + 211, + 211, + 211, + 211, + 211, + 211, + 211, + 211, + 211, + 211, + 211, + 211, + 211, + 211, + 211, + 212, + 212, + 212, + 212, + 212, + 212, + 212, + 212, + 212, + 212, + 212, + 212, + 212, + 212, + 212, + 212, + 212, + 212, + 212, + 212, + 212, + 212, + 212, + 212, + 212, + 212, + 212, + 212, + 213, + 213, + 213, + 213, + 213, + 213, + 213, + 213, + 213, + 213, + 213, + 213, + 213, + 213, + 213, + 213, + 213, + 213, + 213, + 213, + 213, + 213, + 213, + 213, + 213, + 213, + 213, + 213, + 213, + 214, + 214, + 214, + 214, + 214, + 214, + 214, + 214, + 214, + 214, + 214, + 214, + 214, + 214, + 214, + 214, + 214, + 214, + 214, + 214, + 214, + 214, + 214, + 214, + 214, + 214, + 214, + 214, + 215, + 215, + 215, + 215, + 215, + 215, + 215, + 215, + 215, + 215, + 215, + 215, + 215, + 215, + 215, + 215, + 215, + 215, + 215, + 215, + 215, + 215, + 215, + 215, + 215, + 215, + 215, + 215, + 215, + 216, + 216, + 216, + 216, + 216, + 216, + 216, + 216, + 216, + 216, + 216, + 216, + 216, + 216, + 216, + 216, + 216, + 216, + 216, + 216, + 216, + 216, + 216, + 216, + 216, + 216, + 216, + 216, + 216, + 216, + 217, + 217, + 217, + 217, + 217, + 217, + 217, + 217, + 217, + 217, + 217, + 217, + 217, + 217, + 217, + 217, + 217, + 217, + 217, + 217, + 217, + 217, + 217, + 217, + 217, + 217, + 217, + 217, + 217, + 218, + 218, + 218, + 218, + 218, + 218, + 218, + 218, + 218, + 218, + 218, + 218, + 218, + 218, + 218, + 218, + 218, + 218, + 218, + 218, + 218, + 218, + 218, + 218, + 218, + 218, + 218, + 218, + 218, + 218, + 219, + 219, + 219, + 219, + 219, + 219, + 219, + 219, + 219, + 219, + 219, + 219, + 219, + 219, + 219, + 219, + 219, + 219, + 219, + 219, + 219, + 219, + 219, + 219, + 219, + 219, + 219, + 219, + 219, + 220, + 220, + 220, + 220, + 220, + 220, + 220, + 220, + 220, + 220, + 220, + 220, + 220, + 220, + 220, + 220, + 220, + 220, + 220, + 220, + 220, + 220, + 220, + 220, + 220, + 220, + 220, + 220, + 220, + 220, + 221, + 221, + 221, + 221, + 221, + 221, + 221, + 221, + 221, + 221, + 221, + 221, + 221, + 221, + 221, + 221, + 221, + 221, + 221, + 221, + 221, + 221, + 221, + 221, + 221, + 221, + 221, + 221, + 221, + 221, + 222, + 222, + 222, + 222, + 222, + 222, + 222, + 222, + 222, + 222, + 222, + 222, + 222, + 222, + 222, + 222, + 222, + 222, + 222, + 222, + 222, + 222, + 222, + 222, + 222, + 222, + 222, + 222, + 222, + 222, + 223, + 223, + 223, + 223, + 223, + 223, + 223, + 223, + 223, + 223, + 223, + 223, + 223, + 223, + 223, + 223, + 223, + 223, + 223, + 223, + 223, + 223, + 223, + 223, + 223, + 223, + 223, + 223, + 223, + 223, + 223, + 224, + 224, + 224, + 224, + 224, + 224, + 224, + 224, + 224, + 224, + 224, + 224, + 224, + 224, + 224, + 224, + 224, + 224, + 224, + 224, + 224, + 224, + 224, + 224, + 224, + 224, + 224, + 224, + 224, + 224, + 225, + 225, + 225, + 225, + 225, + 225, + 225, + 225, + 225, + 225, + 225, + 225, + 225, + 225, + 225, + 225, + 225, + 225, + 225, + 225, + 225, + 225, + 225, + 225, + 225, + 225, + 225, + 225, + 225, + 225, + 225, + 226, + 226, + 226, + 226, + 226, + 226, + 226, + 226, + 226, + 226, + 226, + 226, + 226, + 226, + 226, + 226, + 226, + 226, + 226, + 226, + 226, + 226, + 226, + 226, + 226, + 226, + 226, + 226, + 226, + 226, + 226, + 227, + 227, + 227, + 227, + 227, + 227, + 227, + 227, + 227, + 227, + 227, + 227, + 227, + 227, + 227, + 227, + 227, + 227, + 227, + 227, + 227, + 227, + 227, + 227, + 227, + 227, + 227, + 227, + 227, + 227, + 227, + 228, + 228, + 228, + 228, + 228, + 228, + 228, + 228, + 228, + 228, + 228, + 228, + 228, + 228, + 228, + 228, + 228, + 228, + 228, + 228, + 228, + 228, + 228, + 228, + 228, + 228, + 228, + 228, + 228, + 228, + 228, + 228, + 229, + 229, + 229, + 229, + 229, + 229, + 229, + 229, + 229, + 229, + 229, + 229, + 229, + 229, + 229, + 229, + 229, + 229, + 229, + 229, + 229, + 229, + 229, + 229, + 229, + 229, + 229, + 229, + 229, + 229, + 229, + 230, + 230, + 230, + 230, + 230, + 230, + 230, + 230, + 230, + 230, + 230, + 230, + 230, + 230, + 230, + 230, + 230, + 230, + 230, + 230, + 230, + 230, + 230, + 230, + 230, + 230, + 230, + 230, + 230, + 230, + 230, + 230, + 231, + 231, + 231, + 231, + 231, + 231, + 231, + 231, + 231, + 231, + 231, + 231, + 231, + 231, + 231, + 231, + 231, + 231, + 231, + 231, + 231, + 231, + 231, + 231, + 231, + 231, + 231, + 231, + 231, + 231, + 231, + 231, + 232, + 232, + 232, + 232, + 232, + 232, + 232, + 232, + 232, + 232, + 232, + 232, + 232, + 232, + 232, + 232, + 232, + 232, + 232, + 232, + 232, + 232, + 232, + 232, + 232, + 232, + 232, + 232, + 232, + 232, + 232, + 232, + 233, + 233, + 233, + 233, + 233, + 233, + 233, + 233, + 233, + 233, + 233, + 233, + 233, + 233, + 233, + 233, + 233, + 233, + 233, + 233, + 233, + 233, + 233, + 233, + 233, + 233, + 233, + 233, + 233, + 233, + 233, + 233, + 234, + 234, + 234, + 234, + 234, + 234, + 234, + 234, + 234, + 234, + 234, + 234, + 234, + 234, + 234, + 234, + 234, + 234, + 234, + 234, + 234, + 234, + 234, + 234, + 234, + 234, + 234, + 234, + 234, + 234, + 234, + 234, + 235, + 235, + 235, + 235, + 235, + 235, + 235, + 235, + 235, + 235, + 235, + 235, + 235, + 235, + 235, + 235, + 235, + 235, + 235, + 235, + 235, + 235, + 235, + 235, + 235, + 235, + 235, + 235, + 235, + 235, + 235, + 235, + 235, + 236, + 236, + 236, + 236, + 236, + 236, + 236, + 236, + 236, + 236, + 236, + 236, + 236, + 236, + 236, + 236, + 236, + 236, + 236, + 236, + 236, + 236, + 236, + 236, + 236, + 236, + 236, + 236, + 236, + 236, + 236, + 236, + 236, + 237, + 237, + 237, + 237, + 237, + 237, + 237, + 237, + 237, + 237, + 237, + 237, + 237, + 237, + 237, + 237, + 237, + 237, + 237, + 237, + 237, + 237, + 237, + 237, + 237, + 237, + 237, + 237, + 237, + 237, + 237, + 237, + 237, + 238, + 238, + 238, + 238, + 238, + 238, + 238, + 238, + 238, + 238, + 238, + 238, + 238, + 238, + 238, + 238, + 238, + 238, + 238, + 238, + 238, + 238, + 238, + 238, + 238, + 238, + 238, + 238, + 238, + 238, + 238, + 238, + 238, + 239, + 239, + 239, + 239, + 239, + 239, + 239, + 239, + 239, + 239, + 239, + 239, + 239, + 239, + 239, + 239, + 239, + 239, + 239, + 239, + 239, + 239, + 239, + 239, + 239, + 239, + 239, + 239, + 239, + 239, + 239, + 239, + 239, + 240, + 240, + 240, + 240, + 240, + 240, + 240, + 240, + 240, + 240, + 240, + 240, + 240, + 240, + 240, + 240, + 240, + 240, + 240, + 240, + 240, + 240, + 240, + 240, + 240, + 240, + 240, + 240, + 240, + 240, + 240, + 240, + 240, + 240, + 241, + 241, + 241, + 241, + 241, + 241, + 241, + 241, + 241, + 241, + 241, + 241, + 241, + 241, + 241, + 241, + 241, + 241, + 241, + 241, + 241, + 241, + 241, + 241, + 241, + 241, + 241, + 241, + 241, + 241, + 241, + 241, + 241, + 242, + 242, + 242, + 242, + 242, + 242, + 242, + 242, + 242, + 242, + 242, + 242, + 242, + 242, + 242, + 242, + 242, + 242, + 242, + 242, + 242, + 242, + 242, + 242, + 242, + 242, + 242, + 242, + 242, + 242, + 242, + 242, + 242, + 242, + 243, + 243, + 243, + 243, + 243, + 243, + 243, + 243, + 243, + 243, + 243, + 243, + 243, + 243, + 243, + 243, + 243, + 243, + 243, + 243, + 243, + 243, + 243, + 243, + 243, + 243, + 243, + 243, + 243, + 243, + 243, + 243, + 243, + 243, + 244, + 244, + 244, + 244, + 244, + 244, + 244, + 244, + 244, + 244, + 244, + 244, + 244, + 244, + 244, + 244, + 244, + 244, + 244, + 244, + 244, + 244, + 244, + 244, + 244, + 244, + 244, + 244, + 244, + 244, + 244, + 244, + 244, + 244, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 245, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 246, + 247, + 247, + 247, + 247, + 247, + 247, + 247, + 247, + 247, + 247, + 247, + 247, + 247, + 247, + 247, + 247, + 247, + 247, + 247, + 247, + 247, + 247, + 247, + 247, + 247, + 247, + 247, + 247, + 247, + 247, + 247, + 247, + 247, + 247, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 248, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 249, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 250, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 251, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 252, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 253, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 254, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + 255 +}; +#endif +/*- End of file ------------------------------------------------------------*/ diff --git a/libs/spandsp/src/fax_modems.c b/libs/spandsp/src/fax_modems.c index d684f03d54..b3f9878b63 100644 --- a/libs/spandsp/src/fax_modems.c +++ b/libs/spandsp/src/fax_modems.c @@ -336,6 +336,7 @@ SPAN_DECLARE(int) fax_modems_free(fax_modems_state_t *s) { if (s) free(s); + /*endif*/ return 0; } /*- End of function --------------------------------------------------------*/ diff --git a/libs/spandsp/src/fsk.c b/libs/spandsp/src/fsk.c index 19941637c0..3f53aa7bc8 100644 --- a/libs/spandsp/src/fsk.c +++ b/libs/spandsp/src/fsk.c @@ -70,16 +70,16 @@ const fsk_spec_t preset_fsk_specs[] = }, { "V23 ch 1", - 2100, - 1300, + 1700 + 400, + 1700 - 400, -14, -30, 1200*100 }, { "V23 ch 2", - 450, - 390, + 420 + 30, + 420 - 30, -14, -30, 75*100 @@ -102,27 +102,35 @@ const fsk_spec_t preset_fsk_specs[] = }, { "Bell202", - 2200, - 1200, + 1700 + 500, + 1700 - 500, -14, -30, 1200*100 }, { - "Weitbrecht 45.45", /* Used for TDD (Telecoms Device for the Deaf) */ - 1800, - 1400, + "Weitbrecht 45.45", /* Used for US TDD (Telecoms Device for the Deaf) */ + 1600 + 200, + 1600 - 200, -14, -30, 4545 }, { - "Weitbrecht 50", /* Used for TDD (Telecoms Device for the Deaf) */ - 1800, - 1400, + "Weitbrecht 50", /* Used for Internatioal TDD (Telecoms Device for the Deaf) */ + 1600 + 200, + 1600 - 200, -14, -30, - 5000 + 50*100 + }, + { + "V21 (110bps) ch 1", + 1080 + 100, + 1080 - 100, + -14, + -30, + 110*100 } }; @@ -476,6 +484,10 @@ SPAN_DECLARE_NONSTD(int) fsk_rx(fsk_rx_state_t *s, const int16_t *amp, int len) s->put_bit(s->put_bit_user_data, baudstate); } break; + case FSK_FRAME_MODE_5N1_FRAMES: + case FSK_FRAME_MODE_7N1_FRAMES: + case FSK_FRAME_MODE_7E1_FRAMES: + case FSK_FRAME_MODE_7E2_FRAMES: default: /* Gather the specified number of bits, with robust checking to ensure reasonable voice immunity. The first bit should be a start bit (0), and the last bit should be a stop bit (1) */ @@ -527,24 +539,22 @@ SPAN_DECLARE_NONSTD(int) fsk_rx(fsk_rx_state_t *s, const int16_t *amp, int len) state as the next bit */ if (s->last_bit == baudstate) { - s->frame_bits |= (baudstate << s->framing_mode); - s->frame_bits >>= 1; - s->baud_phase -= (SAMPLE_RATE*100); if (++s->frame_state > s->framing_mode) { - /* Check we have a stop bit */ - if (baudstate == 1) + /* Check we have a stop bit and a start bit */ + if (baudstate == 1 && (s->frame_bits & 0x02) == 0) { - /* Check we have a start bit */ - if ((s->frame_bits & 1) == 0) - { - /* Drop the start bit, and pass the rest back */ - s->frame_bits >>= 1; - s->put_bit(s->put_bit_user_data, s->frame_bits); - } + /* Drop the start bit, and pass the rest back */ + s->put_bit(s->put_bit_user_data, s->frame_bits >> 2); } s->frame_state = 0; } + else + { + s->frame_bits |= (baudstate << s->framing_mode); + s->frame_bits >>= 1; + } + s->baud_phase -= (SAMPLE_RATE*100); } else { diff --git a/libs/spandsp/src/modem_connect_tones.c b/libs/spandsp/src/modem_connect_tones.c index 4162286db8..6bd7de8dac 100644 --- a/libs/spandsp/src/modem_connect_tones.c +++ b/libs/spandsp/src/modem_connect_tones.c @@ -94,6 +94,8 @@ SPAN_DECLARE(const char *) modem_connect_tone_to_str(int tone) return "FAX preamble"; case MODEM_CONNECT_TONES_FAX_CED_OR_PREAMBLE: return "FAX CED or preamble"; + case MODEM_CONNECT_TONES_BELL_ANS: + return "Bell ANS"; case MODEM_CONNECT_TONES_CALLING_TONE: return "Calling tone"; } @@ -206,6 +208,20 @@ SPAN_DECLARE_NONSTD(int) modem_connect_tones_tx(modem_connect_tones_tx_state_t * } s->duration_timer -= len; break; + case MODEM_CONNECT_TONES_BELL_ANS: + if (s->duration_timer < len) + len = s->duration_timer; + if (s->duration_timer > ms_to_samples(2600)) + { + /* There is some initial silence to be generated. */ + if ((i = s->duration_timer - ms_to_samples(2600)) > len) + i = len; + memset(amp, 0, sizeof(int16_t)*i); + } + for ( ; i < len; i++) + amp[i] = dds_mod(&s->tone_phase, s->tone_phase_rate, s->level, 0); + s->duration_timer -= len; + break; case MODEM_CONNECT_TONES_CALLING_TONE: for ( ; i < len; i++) { @@ -301,6 +317,17 @@ SPAN_DECLARE(modem_connect_tones_tx_state_t *) modem_connect_tones_tx_init(modem s->mod_phase = 0; s->hop_timer = ms_to_samples(450); break; + case MODEM_CONNECT_TONES_BELL_ANS: + /* 0.2s of silence, then 2.6s to 4s of 2225Hz+-15Hz tone, then 75ms of silence. */ + s->tone_phase_rate = dds_phase_rate(2225.0); + s->level = dds_scaling_dbm0(-11); + s->mod_phase_rate = 0; + s->mod_level = 0; + s->duration_timer = ms_to_samples(200 + 2600); + s->tone_phase = 0; + s->mod_phase = 0; + s->hop_timer = 0; + break; case MODEM_CONNECT_TONES_CALLING_TONE: /* 0.6s of 1300Hz+-15Hz + 2.0s of silence repeating. */ s->tone_phase_rate = dds_phase_rate(1300.0); @@ -441,7 +468,7 @@ SPAN_DECLARE_NONSTD(int) modem_connect_tones_rx(modem_connect_tones_rx_state_t * /* A Cauer notch at 1100Hz, spread just wide enough to meet our detection bandwidth criteria. */ /* Poles 0.736618498*exp(+-1047/4000 * PI * j) - Zeroes exp(+-1099.5 * PI * j) */ + Zeroes exp(+-1099.5/4000 * PI * j) */ v1 = 0.792928f*famp + 1.0018744927985f*s->znotch_1 - 0.54196833412465f*s->znotch_2; famp = v1 - 1.2994747954630f*s->znotch_1 + s->znotch_2; s->znotch_2 = s->znotch_1; @@ -487,7 +514,7 @@ SPAN_DECLARE_NONSTD(int) modem_connect_tones_rx(modem_connect_tones_rx_state_t * famp = amp[i]; /* A Cauer bandpass at 15Hz, with which we demodulate the AM signal. */ /* Poles 0.9983989*exp(+-15/4000 * PI * j) - Zeroes exp(0 * PI * j) */ + Zeroes exp(0/4000 * PI * j) */ v1 = fabs(famp) + 1.996667f*s->z15hz_1 - 0.9968004f*s->z15hz_2; filtered = 0.001599787f*(v1 - s->z15hz_2); s->z15hz_2 = s->z15hz_1; @@ -497,8 +524,8 @@ SPAN_DECLARE_NONSTD(int) modem_connect_tones_rx(modem_connect_tones_rx_state_t * /* A Cauer notch at 2100Hz, spread just wide enough to meet our detection bandwidth criteria. */ /* Poles 0.7144255*exp(+-2105.612/4000 * PI * j) - Zeroes exp(+-2099.9 * PI * j) */ - v1 = 0.76000f*famp - 0.1183852f*s->znotch_1 - 0.5104039f*s->znotch_2; + Zeroes exp(+-2099.9/4000 * PI * j) */ + v1 = 0.7552f*famp - 0.1183852f*s->znotch_1 - 0.5104039f*s->znotch_2; famp = v1 + 0.1567596f*s->znotch_1 + s->znotch_2; s->znotch_2 = s->znotch_1; s->znotch_1 = v1; @@ -585,6 +612,44 @@ SPAN_DECLARE_NONSTD(int) modem_connect_tones_rx(modem_connect_tones_rx_state_t * } } break; + case MODEM_CONNECT_TONES_BELL_ANS: + for (i = 0; i < len; i++) + { + famp = amp[i]; + /* A Cauer notch at 2225Hz, spread just wide enough to meet our detection bandwidth + criteria. */ + /* Poles 0.7144255*exp(+-2230.612/4000 * PI * j) + Zeroes exp(+-2224.9/4000 * PI * j) */ + v1 = 0.739651f*famp - 0.257384f*s->znotch_1 - 0.510404f*s->znotch_2; + famp = v1 + 0.351437f*s->znotch_1 + s->znotch_2; + s->znotch_2 = s->znotch_1; + s->znotch_1 = v1; + notched = (int16_t) lfastrintf(famp); + + /* Estimate the overall energy in the channel, and the energy in + the notch (i.e. overall channel energy - tone energy => noise). + Use abs instead of multiply for speed (is it really faster?). */ + s->channel_level += ((abs(amp[i]) - s->channel_level) >> 5); + s->notch_level += ((abs(notched) - s->notch_level) >> 5); + if (s->channel_level > 70 && s->notch_level*6 < s->channel_level) + { + /* There is adequate energy in the channel, and it is mostly at 2225Hz. */ + if (s->tone_present != MODEM_CONNECT_TONES_BELL_ANS) + { + if (++s->tone_cycle_duration >= ms_to_samples(415)) + report_tone_state(s, MODEM_CONNECT_TONES_BELL_ANS, lfastrintf(log10f(s->channel_level/32768.0f)*20.0f + DBM0_MAX_POWER + 0.8f)); + } + } + else + { + /* If the signal looks wrong, even for a moment, we consider this the + end of the tone. */ + if (s->tone_present == MODEM_CONNECT_TONES_BELL_ANS) + report_tone_state(s, MODEM_CONNECT_TONES_NONE, -99); + s->tone_cycle_duration = 0; + } + } + break; case MODEM_CONNECT_TONES_CALLING_TONE: for (i = 0; i < len; i++) { @@ -592,7 +657,7 @@ SPAN_DECLARE_NONSTD(int) modem_connect_tones_rx(modem_connect_tones_rx_state_t * /* A Cauer notch at 1300Hz, spread just wide enough to meet our detection bandwidth criteria. */ /* Poles 0.736618498*exp(+-1247/4000 * PI * j) - Zeroes exp(+-1299.5 * PI * j) */ + Zeroes exp(+-1299.5/4000 * PI * j) */ v1 = 0.755582f*famp + 0.820887174515f*s->znotch_1 - 0.541968324778f*s->znotch_2; famp = v1 - 1.0456667108f*s->znotch_1 + s->znotch_2; s->znotch_2 = s->znotch_1; diff --git a/libs/spandsp/src/spandsp/fsk.h b/libs/spandsp/src/spandsp/fsk.h index 03082ce3d0..9358b565cb 100644 --- a/libs/spandsp/src/spandsp/fsk.h +++ b/libs/spandsp/src/spandsp/fsk.h @@ -110,7 +110,8 @@ enum FSK_BELL103CH2, FSK_BELL202, FSK_WEITBRECHT, /* 45.45 baud version, used for TDD (Telecom Device for the Deaf) */ - FSK_WEITBRECHT50 /* 50 baud version, used for TDD (Telecom Device for the Deaf) */ + FSK_WEITBRECHT50, /* 50 baud version, used for TDD (Telecom Device for the Deaf) */ + FSK_V21CH1_110 /* 110 bps version of V.21 channel 1, as used by V.18 */ }; enum @@ -119,7 +120,8 @@ enum FSK_FRAME_MODE_SYNC = 1, FSK_FRAME_MODE_5N1_FRAMES = 7, /* 5 bits of data + start bit + stop bit */ FSK_FRAME_MODE_7N1_FRAMES = 9, /* 7 bits of data + start bit + stop bit */ - FSK_FRAME_MODE_8N1_FRAMES = 10 /* 8 bits of data + start bit + stop bit */ + FSK_FRAME_MODE_7E1_FRAMES = 10, /* 7 bits of data + even parity + start bit + stop bit */ + FSK_FRAME_MODE_7E2_FRAMES = 11 /* 7 bits of data + even parity + start bit + 2 stop bits */ }; SPAN_DECLARE_DATA extern const fsk_spec_t preset_fsk_specs[]; diff --git a/libs/spandsp/src/spandsp/modem_connect_tones.h b/libs/spandsp/src/spandsp/modem_connect_tones.h index f0c0aaeb2e..7c0219f8a9 100644 --- a/libs/spandsp/src/spandsp/modem_connect_tones.h +++ b/libs/spandsp/src/spandsp/modem_connect_tones.h @@ -76,9 +76,11 @@ enum This is only valid as a tone type to receive. It is never reported as a detected tone type. The report will either be for FAX preamble or CED/ANS tone. */ MODEM_CONNECT_TONES_FAX_CED_OR_PREAMBLE = 7, + /*! \brief Bell ANS tone is a pure continuous 2225Hz+-15Hz tone for 3.3s+-0.7s. */ + MODEM_CONNECT_TONES_BELL_ANS = 8, /*! \brief Calling tone is a pure 1300Hz tone, in 0.6s bursts, with 2s silences in between. The bursts repeat for as long as is required. */ - MODEM_CONNECT_TONES_CALLING_TONE = 8 + MODEM_CONNECT_TONES_CALLING_TONE = 9 }; /*! \brief FAX CED tone is the same as ANS tone. */ diff --git a/libs/spandsp/src/spandsp/private/async.h b/libs/spandsp/src/spandsp/private/async.h index c3837641df..715d659d9e 100644 --- a/libs/spandsp/src/spandsp/private/async.h +++ b/libs/spandsp/src/spandsp/private/async.h @@ -45,7 +45,7 @@ struct async_tx_state_s void *user_data; /*! \brief A current, partially transmitted, character. */ - int byte_in_progress; + unsigned int byte_in_progress; /*! \brief The current bit position within a partially transmitted character. */ int bitpos; /*! \brief Parity bit. */ @@ -73,7 +73,7 @@ struct async_rx_state_s void *user_data; /*! \brief A current, partially complete, character. */ - int byte_in_progress; + unsigned int byte_in_progress; /*! \brief The current bit position within a partially complete character. */ int bitpos; /*! \brief Parity bit. */ diff --git a/libs/spandsp/src/spandsp/private/v18.h b/libs/spandsp/src/spandsp/private/v18.h index 6f7d987bea..b51a899ec6 100644 --- a/libs/spandsp/src/spandsp/private/v18.h +++ b/libs/spandsp/src/spandsp/private/v18.h @@ -56,6 +56,7 @@ struct v18_state_s int rx_msg_len; int bit_pos; int in_progress; + int repeat_shifts; /*! \brief Error and flow logging control */ logging_state_t logging; diff --git a/libs/spandsp/src/v18.c b/libs/spandsp/src/v18.c index ee939b5cfd..639ae0770c 100644 --- a/libs/spandsp/src/v18.c +++ b/libs/spandsp/src/v18.c @@ -69,6 +69,55 @@ #include +/* + Ways in which a V.18 call may start + ----------------------------------- + + Originate: + ANS + Silence for 0.5s then send TXP + DTMF + Proceed as Annex B + 1650Hz (V21 ch 2 low) + Proceed as Annex F in call mode + 1300Hz (Calling tone) + Proceed as Annex E in call mode + 1400Hz/1800Hz (Weitbrecht) + Detect rate and proceed as Annex A + 980Hz/1180Hz (V21 ch 1) + Start timer Tr + 2225Hz (Bell ANS) + Proceed as Annex D call mode + 1270Hz (Bell103 ch 2 high) + Proceed as Annex D answer mode + 390Hz (V23 ch 2 low) + Proceed as Annex E answer mode + + Answer: + ANS + Monitor as caller for 980Hz or 1300Hz + CI/XCI + Respond with ANSam + 1300Hz + Probe + Timer Ta (3s) + Probe + 1400Hz/1800Hz (Weitbrecht) + Detect rate and proceed as Annex A + DTMF + Proceed as Annex B + 980Hz (V21 ch 1 low) + Start timer Te + 1270Hz (Bell103 ch 2 high) + Proceed as Annex D answer mode + 2225Hz (Bell ANS) + Proceed as Annex D call mode + 1650Hz (V21 ch 2 low) + Proceed as Annex F answer mode + ANSam + Proceed as V.8 caller Annex G +*/ + /*! The baudot code to shift from alpha to digits and symbols */ #define BAUDOT_FIGURE_SHIFT 0x1B /*! The baudot code to shift from digits and symbols to alpha */ @@ -310,6 +359,20 @@ static const char *ascii_to_dtmf[128] = "*0" /* DEL >> BACK SPACE */ }; +static const uint8_t txp[] = "1111111111000101011100001101110000010101"; + +/* XCI is: + 400 ms mark; + XCI marker; + 800 ms mark; + XCI marker; + 800 ms mark; + XCI marker; + 800 ms mark; + XCI marker; + 100 ms mark. */ +static const uint8_t xci[] = "01111111110111111111"; + static int cmp(const void *s, const void *t) { const char *ss; @@ -319,6 +382,7 @@ static int cmp(const void *s, const void *t) tt = (struct dtmf_to_ascii_s *) t; return strncmp(ss, tt->dtmf, strlen(tt->dtmf)); } +/*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v18_encode_dtmf(v18_state_t *s, char dtmf[], const char msg[]) { @@ -525,14 +589,14 @@ SPAN_DECLARE(uint16_t) v18_encode_baudot(v18_state_t *s, uint8_t ch) /* Need to allow for a possible character set change. */ if ((ch & 0x80)) { - if (s->baudot_tx_shift == 1) + if (!s->repeat_shifts && s->baudot_tx_shift == 1) return ch & 0x1F; s->baudot_tx_shift = 1; shift = BAUDOT_FIGURE_SHIFT; } else { - if (s->baudot_tx_shift == 0) + if (!s->repeat_shifts && s->baudot_tx_shift == 0) return ch & 0x1F; s->baudot_tx_shift = 0; shift = BAUDOT_LETTER_SHIFT; @@ -592,13 +656,18 @@ static int v18_tdd_get_async_byte(void *user_data) } /*- End of function --------------------------------------------------------*/ +static int v18_edt_get_async_byte(void *user_data) +{ + return 0; +} +/*- End of function --------------------------------------------------------*/ + static void v18_tdd_put_async_byte(void *user_data, int byte) { v18_state_t *s; uint8_t octet; s = (v18_state_t *) user_data; - //printf("Rx byte %x\n", byte); if (byte < 0) { /* Special conditions */ @@ -626,7 +695,8 @@ static void v18_tdd_put_async_byte(void *user_data, int byte) } return; } - if ((octet = v18_decode_baudot(s, (uint8_t) (byte & 0x1F)))) + span_log(&s->logging, SPAN_LOG_FLOW, "Rx byte %x\n", byte); + if ((octet = v18_decode_baudot(s, byte))) s->rx_msg[s->rx_msg_len++] = octet; if (s->rx_msg_len >= 256) { @@ -637,24 +707,44 @@ static void v18_tdd_put_async_byte(void *user_data, int byte) } /*- End of function --------------------------------------------------------*/ +static void v18_edt_put_async_byte(void *user_data, int byte) +{ +} +/*- End of function --------------------------------------------------------*/ + +static void v18_bell103_put_async_byte(void *user_data, int byte) +{ +} +/*- End of function --------------------------------------------------------*/ + +static void v18_videotex_put_async_byte(void *user_data, int byte) +{ +} +/*- End of function --------------------------------------------------------*/ + +static void v18_textphone_put_async_byte(void *user_data, int byte) +{ +} +/*- End of function --------------------------------------------------------*/ + SPAN_DECLARE_NONSTD(int) v18_tx(v18_state_t *s, int16_t *amp, int max_len) { int len; int lenx; - len = tone_gen(&(s->alert_tone_gen), amp, max_len); + len = tone_gen(&s->alert_tone_gen, amp, max_len); if (s->tx_signal_on) { switch (s->mode) { case V18_MODE_DTMF: if (len < max_len) - len += dtmf_tx(&(s->dtmftx), amp, max_len - len); + len += dtmf_tx(&s->dtmftx, amp, max_len - len); break; default: if (len < max_len) { - if ((lenx = fsk_tx(&(s->fsktx), amp + len, max_len - len)) <= 0) + if ((lenx = fsk_tx(&s->fsktx, amp + len, max_len - len)) <= 0) s->tx_signal_on = FALSE; len += lenx; } @@ -674,10 +764,10 @@ SPAN_DECLARE_NONSTD(int) v18_rx(v18_state_t *s, const int16_t amp[], int len) s->in_progress -= len; if (s->in_progress <= 0) s->rx_msg_len = 0; - dtmf_rx(&(s->dtmfrx), amp, len); + dtmf_rx(&s->dtmfrx, amp, len); break; default: - fsk_rx(&(s->fskrx), amp, len); + fsk_rx(&s->fskrx, amp, len); break; } return 0; @@ -744,45 +834,62 @@ SPAN_DECLARE(v18_state_t *) v18_init(v18_state_t *s, } memset(s, 0, sizeof(*s)); s->calling_party = calling_party; - s->mode = mode; + s->mode = mode & 0xFF; s->put_msg = put_msg; s->user_data = user_data; switch (s->mode) { case V18_MODE_5BIT_45: - fsk_tx_init(&(s->fsktx), &preset_fsk_specs[FSK_WEITBRECHT], async_tx_get_bit, &(s->asynctx)); - async_tx_init(&(s->asynctx), 5, ASYNC_PARITY_NONE, 2, FALSE, v18_tdd_get_async_byte, s); + fsk_tx_init(&s->fsktx, &preset_fsk_specs[FSK_WEITBRECHT], async_tx_get_bit, &s->asynctx); + async_tx_init(&s->asynctx, 5, ASYNC_PARITY_NONE, 2, FALSE, v18_tdd_get_async_byte, s); /* Schedule an explicit shift at the start of baudot transmission */ s->baudot_tx_shift = 2; /* TDD uses 5 bit data, no parity and 1.5 stop bits. We scan for the first stop bit, and ride over the fraction. */ - fsk_rx_init(&(s->fskrx), &preset_fsk_specs[FSK_WEITBRECHT], FSK_FRAME_MODE_5N1_FRAMES, v18_tdd_put_async_byte, s); + fsk_rx_init(&s->fskrx, &preset_fsk_specs[FSK_WEITBRECHT], FSK_FRAME_MODE_5N1_FRAMES, v18_tdd_put_async_byte, s); s->baudot_rx_shift = 0; + s->repeat_shifts = mode & 0x100; break; case V18_MODE_5BIT_50: - fsk_tx_init(&(s->fsktx), &preset_fsk_specs[FSK_WEITBRECHT50], async_tx_get_bit, &(s->asynctx)); - async_tx_init(&(s->asynctx), 5, ASYNC_PARITY_NONE, 2, FALSE, v18_tdd_get_async_byte, s); + fsk_tx_init(&s->fsktx, &preset_fsk_specs[FSK_WEITBRECHT50], async_tx_get_bit, &s->asynctx); + async_tx_init(&s->asynctx, 5, ASYNC_PARITY_NONE, 2, FALSE, v18_tdd_get_async_byte, s); /* Schedule an explicit shift at the start of baudot transmission */ s->baudot_tx_shift = 2; /* TDD uses 5 bit data, no parity and 1.5 stop bits. We scan for the first stop bit, and ride over the fraction. */ - fsk_rx_init(&(s->fskrx), &preset_fsk_specs[FSK_WEITBRECHT50], FSK_FRAME_MODE_5N1_FRAMES, v18_tdd_put_async_byte, s); + fsk_rx_init(&s->fskrx, &preset_fsk_specs[FSK_WEITBRECHT50], FSK_FRAME_MODE_5N1_FRAMES, v18_tdd_put_async_byte, s); s->baudot_rx_shift = 0; + s->repeat_shifts = mode & 0x100; break; case V18_MODE_DTMF: - dtmf_tx_init(&(s->dtmftx)); - dtmf_rx_init(&(s->dtmfrx), v18_rx_dtmf, s); + dtmf_tx_init(&s->dtmftx); + dtmf_rx_init(&s->dtmfrx, v18_rx_dtmf, s); break; case V18_MODE_EDT: + fsk_tx_init(&s->fsktx, &preset_fsk_specs[FSK_V21CH1_110], async_tx_get_bit, &s->asynctx); + async_tx_init(&s->asynctx, 7, ASYNC_PARITY_EVEN, 2, FALSE, v18_edt_get_async_byte, s); + fsk_rx_init(&s->fskrx, &preset_fsk_specs[FSK_V21CH1_110], FSK_FRAME_MODE_7E2_FRAMES, v18_edt_put_async_byte, s); break; case V18_MODE_BELL103: + fsk_tx_init(&s->fsktx, &preset_fsk_specs[FSK_BELL103CH1], async_tx_get_bit, &s->asynctx); + async_tx_init(&s->asynctx, 7, ASYNC_PARITY_EVEN, 1, FALSE, v18_edt_get_async_byte, s); + fsk_rx_init(&s->fskrx, &preset_fsk_specs[FSK_BELL103CH2], FSK_FRAME_MODE_7E1_FRAMES, v18_bell103_put_async_byte, s); break; case V18_MODE_V23VIDEOTEX: + fsk_tx_init(&s->fsktx, &preset_fsk_specs[FSK_V23CH1], async_tx_get_bit, &s->asynctx); + async_tx_init(&s->asynctx, 7, ASYNC_PARITY_EVEN, 1, FALSE, v18_edt_get_async_byte, s); + fsk_rx_init(&s->fskrx, &preset_fsk_specs[FSK_V23CH2], FSK_FRAME_MODE_7E1_FRAMES, v18_videotex_put_async_byte, s); break; case V18_MODE_V21TEXTPHONE: + fsk_tx_init(&s->fsktx, &preset_fsk_specs[FSK_V21CH1], async_tx_get_bit, &s->asynctx); + async_tx_init(&s->asynctx, 7, ASYNC_PARITY_EVEN, 1, FALSE, v18_edt_get_async_byte, s); + fsk_rx_init(&s->fskrx, &preset_fsk_specs[FSK_V21CH1], FSK_FRAME_MODE_7E1_FRAMES, v18_textphone_put_async_byte, s); break; case V18_MODE_V18TEXTPHONE: + fsk_tx_init(&s->fsktx, &preset_fsk_specs[FSK_V21CH1], async_tx_get_bit, &s->asynctx); + async_tx_init(&s->asynctx, 7, ASYNC_PARITY_EVEN, 1, FALSE, v18_edt_get_async_byte, s); + fsk_rx_init(&s->fskrx, &preset_fsk_specs[FSK_V21CH1], FSK_FRAME_MODE_7E1_FRAMES, v18_textphone_put_async_byte, s); break; } queue_init(&s->queue.queue, 128, QUEUE_READ_ATOMIC | QUEUE_WRITE_ATOMIC); @@ -805,7 +912,7 @@ SPAN_DECLARE(int) v18_free(v18_state_t *s) SPAN_DECLARE(const char *) v18_mode_to_str(int mode) { - switch (mode) + switch (mode & 0xFF) { case V18_MODE_NONE: return "None"; diff --git a/libs/spandsp/tests/modem_connect_tones_tests.c b/libs/spandsp/tests/modem_connect_tones_tests.c index fb063cbc54..dc5147a9a8 100644 --- a/libs/spandsp/tests/modem_connect_tones_tests.c +++ b/libs/spandsp/tests/modem_connect_tones_tests.c @@ -49,30 +49,38 @@ These tests... #include "spandsp.h" #include "spandsp-sim.h" -#define SAMPLES_PER_CHUNK 160 +#define SAMPLES_PER_CHUNK 160 -#define OUTPUT_FILE_NAME "modem_connect_tones.wav" +#define OUTPUT_FILE_NAME "modem_connect_tones.wav" -#define MITEL_DIR "../test-data/mitel/" -#define BELLCORE_DIR "../test-data/bellcore/" +#define MITEL_DIR "../test-data/mitel/" +#define BELLCORE_DIR "../test-data/bellcore/" #define FALSE 0 #define TRUE (!FALSE) -#define LEVEL_MAX -5 -#define LEVEL_MIN -48 -#define LEVEL_MIN_ACCEPT -43 -#define LEVEL_MIN_REJECT -44 +#define LEVEL_MAX -5 +#define LEVEL_MIN -48 +#define LEVEL_MIN_ACCEPT -43 +#define LEVEL_MIN_REJECT -44 /* The 1100Hz tone is supposed to be within 38Hz, according to T.30. Allow another 8Hz for FDM, even though you rarely see that used today. */ -#define CED_FREQ_TOLERANCE (38 + 8) -#define CED_FREQ_BLACKOUT (80) +#define CED_FREQ_TOLERANCE (38 + 8) +#define CED_FREQ_BLACKOUT (80) /* The 2100Hz tone is supposed to be within 15Hz, according to T.30. Allow another 8Hz for FDM, even though you rarely see that used today. */ -#define CNG_FREQ_TOLERANCE (15 + 8) -#define CNG_FREQ_BLACKOUT (80) -#define AM_FREQ_TOLERANCE (1) +#define CNG_FREQ_TOLERANCE (15 + 8) +#define CNG_FREQ_BLACKOUT (80) +#define AM_FREQ_TOLERANCE (1) +/* The 2225Hz tone is supposed to be within 15Hz. Allow another 8Hz for FDM, even though + you rarely see that used today. */ +#define BELL_ANS_FREQ_TOLERANCE (15 + 8) +#define BELL_ANS_FREQ_BLACKOUT (80) +/* The 1300Hz tone is supposed to be within 15Hz, according to V.25. Allow another 8Hz for FDM, even though + you rarely see that used today. */ +#define CALLING_TONE_FREQ_TOLERANCE (15 + 8) +#define CALLING_TONE_FREQ_BLACKOUT (80) const char *bellcore_files[] = { @@ -93,24 +101,30 @@ enum PERFORM_TEST_1C = (1 << 3), PERFORM_TEST_1D = (1 << 4), PERFORM_TEST_1E = (1 << 5), - PERFORM_TEST_2A = (1 << 6), - PERFORM_TEST_2B = (1 << 7), - PERFORM_TEST_2C = (1 << 8), - PERFORM_TEST_2D = (1 << 9), - PERFORM_TEST_2E = (1 << 10), - PERFORM_TEST_3A = (1 << 11), - PERFORM_TEST_3B = (1 << 12), - PERFORM_TEST_3C = (1 << 13), - PERFORM_TEST_3D = (1 << 14), - PERFORM_TEST_3E = (1 << 15), - PERFORM_TEST_4 = (1 << 16), - PERFORM_TEST_5A = (1 << 17), - PERFORM_TEST_5B = (1 << 18), - PERFORM_TEST_6A = (1 << 19), - PERFORM_TEST_6B = (1 << 20), - PERFORM_TEST_7A = (1 << 21), - PERFORM_TEST_7B = (1 << 22), - PERFORM_TEST_8 = (1 << 23) + PERFORM_TEST_1F = (1 << 6), + PERFORM_TEST_1G = (1 << 7), + PERFORM_TEST_2A = (1 << 8), + PERFORM_TEST_2B = (1 << 9), + PERFORM_TEST_2C = (1 << 10), + PERFORM_TEST_2D = (1 << 11), + PERFORM_TEST_2E = (1 << 12), + PERFORM_TEST_2F = (1 << 13), + PERFORM_TEST_2G = (1 << 14), + PERFORM_TEST_3A = (1 << 15), + PERFORM_TEST_3B = (1 << 16), + PERFORM_TEST_3C = (1 << 17), + PERFORM_TEST_3D = (1 << 18), + PERFORM_TEST_3E = (1 << 19), + PERFORM_TEST_3F = (1 << 20), + PERFORM_TEST_3G = (1 << 21), + PERFORM_TEST_4 = (1 << 22), + PERFORM_TEST_5A = (1 << 23), + PERFORM_TEST_5B = (1 << 24), + PERFORM_TEST_6A = (1 << 25), + PERFORM_TEST_6B = (1 << 26), + PERFORM_TEST_7A = (1 << 27), + PERFORM_TEST_7B = (1 << 28), + PERFORM_TEST_8 = (1 << 29) }; int preamble_count = 0; @@ -184,6 +198,22 @@ static void ans_pr_detected(void *user_data, int tone, int level, int delay) } /*- End of function --------------------------------------------------------*/ +static void bell_ans_detected(void *user_data, int tone, int level, int delay) +{ + printf("%s (%d) declared at %fs, delay %d (%ddBm0)\n", modem_connect_tone_to_str(tone), tone, (float) when/SAMPLE_RATE, delay, level); + if (tone == MODEM_CONNECT_TONES_BELL_ANS) + hits++; +} +/*- End of function --------------------------------------------------------*/ + +static void calling_tone_detected(void *user_data, int tone, int level, int delay) +{ + printf("%s (%d) declared at %fs, delay %d (%ddBm0)\n", modem_connect_tone_to_str(tone), tone, (float) when/SAMPLE_RATE, delay, level); + if (tone == MODEM_CONNECT_TONES_CALLING_TONE) + hits++; +} +/*- End of function --------------------------------------------------------*/ + int main(int argc, char *argv[]) { int i; @@ -198,6 +228,8 @@ int main(int argc, char *argv[]) modem_connect_tones_rx_state_t ced_rx; modem_connect_tones_rx_state_t ans_pr_rx; modem_connect_tones_tx_state_t modem_tone_tx; + modem_connect_tones_rx_state_t calling_tone_rx; + modem_connect_tones_rx_state_t bell_ans_rx; awgn_state_t chan_noise_source; SNDFILE *inhandle; SNDFILE *outhandle; @@ -207,9 +239,6 @@ int main(int argc, char *argv[]) int hit; int false_hit; int false_miss; - power_meter_t power_state; - int power; - int max_power; int level2; int max_level2; int tone_type; @@ -247,6 +276,10 @@ int main(int argc, char *argv[]) test_list |= PERFORM_TEST_1D; else if (strcasecmp(argv[i], "1e") == 0) test_list |= PERFORM_TEST_1E; + else if (strcasecmp(argv[i], "1f") == 0) + test_list |= PERFORM_TEST_1F; + else if (strcasecmp(argv[i], "1g") == 0) + test_list |= PERFORM_TEST_1G; else if (strcasecmp(argv[i], "2a") == 0) test_list |= PERFORM_TEST_2A; else if (strcasecmp(argv[i], "2b") == 0) @@ -257,6 +290,10 @@ int main(int argc, char *argv[]) test_list |= PERFORM_TEST_2D; else if (strcasecmp(argv[i], "2e") == 0) test_list |= PERFORM_TEST_2E; + else if (strcasecmp(argv[i], "2f") == 0) + test_list |= PERFORM_TEST_2F; + else if (strcasecmp(argv[i], "2g") == 0) + test_list |= PERFORM_TEST_2G; else if (strcasecmp(argv[i], "3a") == 0) test_list |= PERFORM_TEST_3A; else if (strcasecmp(argv[i], "3b") == 0) @@ -267,6 +304,10 @@ int main(int argc, char *argv[]) test_list |= PERFORM_TEST_3D; else if (strcasecmp(argv[i], "3e") == 0) test_list |= PERFORM_TEST_3E; + else if (strcasecmp(argv[i], "3f") == 0) + test_list |= PERFORM_TEST_3F; + else if (strcasecmp(argv[i], "3g") == 0) + test_list |= PERFORM_TEST_3G; else if (strcasecmp(argv[i], "4") == 0) test_list |= PERFORM_TEST_4; else if (strcasecmp(argv[i], "5a") == 0) @@ -316,7 +357,7 @@ int main(int argc, char *argv[]) /*endfor*/ } /*endif*/ - + if ((test_list & PERFORM_TEST_1B)) { printf("Test 1b: CED/ANS generation to a file\n"); @@ -375,7 +416,7 @@ int main(int argc, char *argv[]) /*endfor*/ } /*endif*/ - + if ((test_list & PERFORM_TEST_1E)) { printf("Test 1e: ANSam/ (Modulated EC-disable) generation to a file\n"); @@ -396,13 +437,51 @@ int main(int argc, char *argv[]) } /*endif*/ + if ((test_list & PERFORM_TEST_1F)) + { + printf("Test 1f: Bell answer tone generation to a file\n"); + modem_connect_tones_tx_init(&modem_tone_tx, MODEM_CONNECT_TONES_BELL_ANS); + for (i = 0; i < 20*SAMPLE_RATE; i += SAMPLES_PER_CHUNK) + { + samples = modem_connect_tones_tx(&modem_tone_tx, amp, SAMPLES_PER_CHUNK); + outframes = sf_writef_short(outhandle, amp, samples); + if (outframes != samples) + { + fprintf(stderr, " Error writing audio file\n"); + exit(2); + } + /*endif*/ + } + /*endfor*/ + } + /*endif*/ + + if ((test_list & PERFORM_TEST_1G)) + { + printf("Test 1g: Calling tone generation to a file\n"); + modem_connect_tones_tx_init(&modem_tone_tx, MODEM_CONNECT_TONES_CALLING_TONE); + for (i = 0; i < 20*SAMPLE_RATE; i += SAMPLES_PER_CHUNK) + { + samples = modem_connect_tones_tx(&modem_tone_tx, amp, SAMPLES_PER_CHUNK); + outframes = sf_writef_short(outhandle, amp, samples); + if (outframes != samples) + { + fprintf(stderr, " Error writing audio file\n"); + exit(2); + } + /*endif*/ + } + /*endfor*/ + } + /*endif*/ + if (sf_close_telephony(outhandle)) { printf(" Cannot close audio file '%s'\n", OUTPUT_FILE_NAME); exit(2); } /*endif*/ - + if ((test_list & PERFORM_TEST_2A)) { printf("Test 2a: CNG detection with frequency\n"); @@ -410,16 +489,13 @@ int main(int argc, char *argv[]) awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f); false_hit = FALSE; false_miss = FALSE; - for (pitch = 600; pitch <= 1600; pitch++) + for (pitch = 1100 - 500; pitch <= 1100 + 500; pitch++) { /* Use the transmitter to test the receiver */ modem_connect_tones_tx_init(&modem_tone_tx, tone_type); /* Fudge things for the test */ modem_tone_tx.tone_phase_rate = dds_phase_rate(pitch); modem_connect_tones_rx_init(&cng_rx, tone_type, NULL, NULL); - power_meter_init(&power_state, 5); - power = 0; - max_power = 0; level2 = 0; max_level2 = 0; for (i = 0; i < 10*SAMPLE_RATE; i += SAMPLES_PER_CHUNK) @@ -428,10 +504,6 @@ int main(int argc, char *argv[]) for (j = 0; j < samples; j++) { amp[j] += awgn(&chan_noise_source); - power = power_meter_update(&power_state, amp[j]); - if (power > max_power) - max_power = power; - /*endif*/ level2 += ((abs(amp[j]) - level2) >> 5); if (level2 > max_level2) max_level2 = level2; @@ -455,7 +527,7 @@ int main(int argc, char *argv[]) } /*endif*/ if (hit != MODEM_CONNECT_TONES_NONE) - printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %d\n", pitch, cng_rx.channel_level, cng_rx.notch_level, hit); + printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %s (%d)\n", pitch, cng_rx.channel_level, cng_rx.notch_level, modem_connect_tone_to_str(hit), hit); /*endif*/ } /*endfor*/ @@ -475,7 +547,7 @@ int main(int argc, char *argv[]) awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f); false_hit = FALSE; false_miss = FALSE; - for (pitch = 1600; pitch < 2600; pitch++) + for (pitch = 2100 - 500; pitch < 2100 + 500; pitch++) { /* Use the transmitter to test the receiver */ modem_connect_tones_tx_init(&modem_tone_tx, MODEM_CONNECT_TONES_ANS); @@ -506,7 +578,7 @@ int main(int argc, char *argv[]) } /*endif*/ if (hit != MODEM_CONNECT_TONES_NONE) - printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %d\n", pitch, ced_rx.channel_level, ced_rx.notch_level, hit); + printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %s (%d)\n", pitch, ced_rx.channel_level, ced_rx.notch_level, modem_connect_tone_to_str(hit), hit); /*endif*/ } if (false_hit || false_miss) @@ -526,7 +598,7 @@ int main(int argc, char *argv[]) awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f); false_hit = FALSE; false_miss = FALSE; - for (pitch = 2000; pitch <= 2200; pitch++) + for (pitch = 2100 - 100; pitch <= 2100 + 100; pitch++) { /* Use the transmitter to test the receiver */ modem_connect_tones_tx_init(&modem_tone_tx, tone_type); @@ -557,7 +629,7 @@ int main(int argc, char *argv[]) } /*endif*/ if (hit != MODEM_CONNECT_TONES_NONE) - printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %d\n", pitch, ans_pr_rx.channel_level, ans_pr_rx.notch_level, hit); + printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %s (%d)\n", pitch, ans_pr_rx.channel_level, ans_pr_rx.notch_level, modem_connect_tone_to_str(hit), hit); /*endif*/ } /*endfor*/ @@ -578,7 +650,7 @@ int main(int argc, char *argv[]) awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f); false_hit = FALSE; false_miss = FALSE; - for (pitch = 2000; pitch <= 2200; pitch++) + for (pitch = 2100 - 100; pitch <= 2100 + 100; pitch++) { /* Use the transmitter to test the receiver */ modem_connect_tones_tx_init(&modem_tone_tx, tone_type); @@ -609,7 +681,7 @@ int main(int argc, char *argv[]) } /*endif*/ if (hit != MODEM_CONNECT_TONES_NONE) - printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %d\n", pitch, ans_pr_rx.channel_level, ans_pr_rx.notch_level, hit); + printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %s (%d)\n", pitch, ans_pr_rx.channel_level, ans_pr_rx.notch_level, modem_connect_tone_to_str(hit), hit); /*endif*/ } /*endfor*/ @@ -630,7 +702,7 @@ int main(int argc, char *argv[]) awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f); false_hit = FALSE; false_miss = FALSE; - for (pitch = 2000; pitch <= 2200; pitch++) + for (pitch = 2100 - 100; pitch <= 2100 + 100; pitch++) { /* Use the transmitter to test the receiver */ modem_connect_tones_tx_init(&modem_tone_tx, tone_type); @@ -661,7 +733,125 @@ int main(int argc, char *argv[]) } /*endif*/ if (hit != MODEM_CONNECT_TONES_NONE) - printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %d\n", pitch, ans_pr_rx.channel_level, ans_pr_rx.notch_level, hit); + printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %s (%d)\n", pitch, ans_pr_rx.channel_level, ans_pr_rx.notch_level, modem_connect_tone_to_str(hit), hit); + /*endif*/ + } + /*endfor*/ + if (false_hit || false_miss) + { + printf("Test failed.\n"); + exit(2); + } + /*endif*/ + printf("Test passed.\n"); + } + /*endif*/ + + if ((test_list & PERFORM_TEST_2F)) + { + printf("Test 2f: Bell answer tone detection with frequency\n"); + tone_type = MODEM_CONNECT_TONES_BELL_ANS; + awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f); + false_hit = FALSE; + false_miss = FALSE; + for (pitch = 2225 - 500; pitch <= 2225 + 500; pitch++) + { + /* Use the transmitter to test the receiver */ + modem_connect_tones_tx_init(&modem_tone_tx, tone_type); + /* Fudge things for the test */ + modem_tone_tx.tone_phase_rate = dds_phase_rate(pitch); + modem_connect_tones_rx_init(&bell_ans_rx, tone_type, NULL, NULL); + level2 = 0; + max_level2 = 0; + for (i = 0; i < 8000; i += SAMPLES_PER_CHUNK) + { + samples = modem_connect_tones_tx(&modem_tone_tx, amp, SAMPLES_PER_CHUNK); + for (j = 0; j < samples; j++) + { + amp[j] += awgn(&chan_noise_source); + level2 += ((abs(amp[j]) - level2) >> 5); + if (level2 > max_level2) + max_level2 = level2; + } + /*endfor*/ + modem_connect_tones_rx(&bell_ans_rx, amp, samples); + } + /*endfor*/ + hit = modem_connect_tones_rx_get(&bell_ans_rx); + if (pitch < (2225 - BELL_ANS_FREQ_BLACKOUT) || pitch > (2225 + BELL_ANS_FREQ_BLACKOUT)) + { + if (hit != MODEM_CONNECT_TONES_NONE) + false_hit = TRUE; + /*endif*/ + } + else if (pitch > (2225 - BELL_ANS_FREQ_TOLERANCE) && pitch < (2225 + BELL_ANS_FREQ_TOLERANCE)) + { + if (hit != tone_type) + false_miss = TRUE; + /*endif*/ + } + /*endif*/ + if (hit != MODEM_CONNECT_TONES_NONE) + printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %s (%d)\n", pitch, bell_ans_rx.channel_level, bell_ans_rx.notch_level, modem_connect_tone_to_str(hit), hit); + /*endif*/ + } + /*endfor*/ + if (false_hit || false_miss) + { + printf("Test failed.\n"); + exit(2); + } + /*endif*/ + printf("Test passed.\n"); + } + /*endif*/ + + if ((test_list & PERFORM_TEST_2G)) + { + printf("Test 2g: Calling tone detection with frequency\n"); + tone_type = MODEM_CONNECT_TONES_CALLING_TONE; + awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f); + false_hit = FALSE; + false_miss = FALSE; + for (pitch = 1300 - 500; pitch <= 1300 + 500; pitch++) + { + /* Use the transmitter to test the receiver */ + modem_connect_tones_tx_init(&modem_tone_tx, tone_type); + /* Fudge things for the test */ + modem_tone_tx.tone_phase_rate = dds_phase_rate(pitch); + modem_connect_tones_rx_init(&calling_tone_rx, tone_type, NULL, NULL); + level2 = 0; + max_level2 = 0; + for (i = 0; i < 10*SAMPLE_RATE; i += SAMPLES_PER_CHUNK) + { + samples = modem_connect_tones_tx(&modem_tone_tx, amp, SAMPLES_PER_CHUNK); + for (j = 0; j < samples; j++) + { + amp[j] += awgn(&chan_noise_source); + level2 += ((abs(amp[j]) - level2) >> 5); + if (level2 > max_level2) + max_level2 = level2; + } + /*endfor*/ + modem_connect_tones_rx(&calling_tone_rx, amp, samples); + } + /*endfor*/ + hit = modem_connect_tones_rx_get(&calling_tone_rx); + if (pitch < (1300 - CALLING_TONE_FREQ_BLACKOUT) || pitch > (1300 + CALLING_TONE_FREQ_BLACKOUT)) + { + if (hit != MODEM_CONNECT_TONES_NONE) + false_hit = TRUE; + /*endif*/ + } + else if (pitch > (1300 - CALLING_TONE_FREQ_TOLERANCE) && pitch < (1300 + CALLING_TONE_FREQ_TOLERANCE)) + { + if (hit != tone_type) + false_miss = TRUE; + /*endif*/ + } + /*endif*/ + if (hit != MODEM_CONNECT_TONES_NONE) + printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %s (%d)\n", pitch, calling_tone_rx.channel_level, calling_tone_rx.notch_level, modem_connect_tone_to_str(hit), hit); /*endif*/ } /*endfor*/ @@ -716,7 +906,7 @@ int main(int argc, char *argv[]) } /*endif*/ if (hit != MODEM_CONNECT_TONES_NONE) - printf("Detected at %5dHz %4ddB %12" PRId32 " %12" PRId32 " %d\n", pitch, level, cng_rx.channel_level, cng_rx.notch_level, hit); + printf("Detected at %5dHz %4ddB %12" PRId32 " %12" PRId32 " %s (%d)\n", pitch, level, cng_rx.channel_level, cng_rx.notch_level, modem_connect_tone_to_str(hit), hit); /*endif*/ } /*endfor*/ @@ -773,7 +963,7 @@ int main(int argc, char *argv[]) } /*endif*/ if (hit != MODEM_CONNECT_TONES_NONE) - printf("Detected at %5dHz %4ddB %12" PRId32 " %12" PRId32 " %d\n", pitch, level, ced_rx.channel_level, ced_rx.notch_level, hit); + printf("Detected at %5dHz %4ddB %12" PRId32 " %12" PRId32 " %s (%d)\n", pitch, level, ced_rx.channel_level, ced_rx.notch_level, modem_connect_tone_to_str(hit), hit); /*endif*/ } /*endfor*/ @@ -831,8 +1021,8 @@ int main(int argc, char *argv[]) /*endif*/ } /*endif*/ - //if (hit != MODEM_CONNECT_TONES_NONE) - printf("Detected at %5dHz %4ddB %12" PRId32 " %12" PRId32 " %d\n", pitch, level, ans_pr_rx.channel_level, ans_pr_rx.notch_level, hit); + if (hit != MODEM_CONNECT_TONES_NONE) + printf("Detected at %5dHz %4ddB %12" PRId32 " %12" PRId32 " %s (%d)\n", pitch, level, ans_pr_rx.channel_level, ans_pr_rx.notch_level, modem_connect_tone_to_str(hit), hit); /*endif*/ } /*endfor*/ @@ -889,7 +1079,7 @@ int main(int argc, char *argv[]) } /*endif*/ if (hit != MODEM_CONNECT_TONES_NONE) - printf("Detected at %5dHz %4ddB %12" PRId32 " %12" PRId32 " %d\n", pitch, level, ans_pr_rx.channel_level, ans_pr_rx.notch_level, hit); + printf("Detected at %5dHz %4ddB %12" PRId32 " %12" PRId32 " %s (%d)\n", pitch, level, ans_pr_rx.channel_level, ans_pr_rx.notch_level, modem_connect_tone_to_str(hit), hit); /*endif*/ } /*endfor*/ @@ -947,7 +1137,121 @@ int main(int argc, char *argv[]) } /*endif*/ if (hit != MODEM_CONNECT_TONES_NONE) - printf("Detected at %5dHz %4ddB %12" PRId32 " %12" PRId32 " %d\n", pitch, level, ans_pr_rx.channel_level, ans_pr_rx.notch_level, hit); + printf("Detected at %5dHz %4ddB %12" PRId32 " %12" PRId32 " %s (%d)\n", pitch, level, ans_pr_rx.channel_level, ans_pr_rx.notch_level, modem_connect_tone_to_str(hit), hit); + /*endif*/ + } + /*endfor*/ + } + /*endfor*/ + if (false_hit || false_miss) + { + printf("Test failed.\n"); + exit(2); + } + /*endif*/ + printf("Test passed.\n"); + } + /*endif*/ + + if ((test_list & PERFORM_TEST_3F)) + { + printf("Test 3f: Bell answer tone detection with level\n"); + tone_type = MODEM_CONNECT_TONES_BELL_ANS; + awgn_init_dbm0(&chan_noise_source, 7162534, -60.0f); + false_hit = FALSE; + false_miss = FALSE; + for (pitch = 2225 - BELL_ANS_FREQ_TOLERANCE; pitch <= 2225 + BELL_ANS_FREQ_TOLERANCE; pitch += 2*BELL_ANS_FREQ_TOLERANCE) + { + for (level = LEVEL_MAX; level >= LEVEL_MIN; level--) + { + /* Use the transmitter to test the receiver */ + modem_connect_tones_tx_init(&modem_tone_tx, tone_type); + /* Fudge things for the test */ + modem_tone_tx.tone_phase_rate = dds_phase_rate(pitch); + modem_tone_tx.level = dds_scaling_dbm0(level); + modem_connect_tones_rx_init(&calling_tone_rx, tone_type, NULL, NULL); + for (i = 0; i < 10*SAMPLE_RATE; i += SAMPLES_PER_CHUNK) + { + samples = modem_connect_tones_tx(&modem_tone_tx, amp, SAMPLES_PER_CHUNK); + for (j = 0; j < samples; j++) + amp[j] += awgn(&chan_noise_source); + /*endfor*/ + modem_connect_tones_rx(&calling_tone_rx, amp, samples); + } + /*endfor*/ + hit = modem_connect_tones_rx_get(&calling_tone_rx); + if (level < LEVEL_MIN_REJECT) + { + if (hit != MODEM_CONNECT_TONES_NONE) + false_hit = TRUE; + /*endif*/ + } + else if (level > LEVEL_MIN_ACCEPT) + { + if (hit != tone_type) + false_miss = TRUE; + /*endif*/ + } + /*endif*/ + if (hit != MODEM_CONNECT_TONES_NONE) + printf("Detected at %5dHz %4ddB %12" PRId32 " %12" PRId32 " %s (%d)\n", pitch, level, calling_tone_rx.channel_level, calling_tone_rx.notch_level, modem_connect_tone_to_str(hit), hit); + /*endif*/ + } + /*endfor*/ + } + /*endfor*/ + if (false_hit || false_miss) + { + printf("Test failed.\n"); + exit(2); + } + /*endif*/ + printf("Test passed.\n"); + } + /*endif*/ + + if ((test_list & PERFORM_TEST_3G)) + { + printf("Test 3g: Calling tone detection with level\n"); + tone_type = MODEM_CONNECT_TONES_CALLING_TONE; + awgn_init_dbm0(&chan_noise_source, 7162534, -60.0f); + false_hit = FALSE; + false_miss = FALSE; + for (pitch = 1300 - CALLING_TONE_FREQ_TOLERANCE; pitch <= 1300 + CALLING_TONE_FREQ_TOLERANCE; pitch += 2*CALLING_TONE_FREQ_TOLERANCE) + { + for (level = LEVEL_MAX; level >= LEVEL_MIN; level--) + { + /* Use the transmitter to test the receiver */ + modem_connect_tones_tx_init(&modem_tone_tx, tone_type); + /* Fudge things for the test */ + modem_tone_tx.tone_phase_rate = dds_phase_rate(pitch); + modem_tone_tx.level = dds_scaling_dbm0(level); + modem_connect_tones_rx_init(&calling_tone_rx, tone_type, NULL, NULL); + for (i = 0; i < 10*SAMPLE_RATE; i += SAMPLES_PER_CHUNK) + { + samples = modem_connect_tones_tx(&modem_tone_tx, amp, SAMPLES_PER_CHUNK); + for (j = 0; j < samples; j++) + amp[j] += awgn(&chan_noise_source); + /*endfor*/ + modem_connect_tones_rx(&calling_tone_rx, amp, samples); + } + /*endfor*/ + hit = modem_connect_tones_rx_get(&calling_tone_rx); + if (level < LEVEL_MIN_REJECT) + { + if (hit != MODEM_CONNECT_TONES_NONE) + false_hit = TRUE; + /*endif*/ + } + else if (level > LEVEL_MIN_ACCEPT) + { + if (hit != tone_type) + false_miss = TRUE; + /*endif*/ + } + /*endif*/ + if (hit != MODEM_CONNECT_TONES_NONE) + printf("Detected at %5dHz %4ddB %12" PRId32 " %12" PRId32 " %s (%d)\n", pitch, level, calling_tone_rx.channel_level, calling_tone_rx.notch_level, modem_connect_tone_to_str(hit), hit); /*endif*/ } /*endfor*/ @@ -1146,7 +1450,7 @@ int main(int argc, char *argv[]) } /*endif*/ if (hit != MODEM_CONNECT_TONES_NONE) - printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %d\n", pitch, ans_pr_rx.channel_level, ans_pr_rx.notch_level, hit); + printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %s (%d)\n", pitch, ans_pr_rx.channel_level, ans_pr_rx.notch_level, modem_connect_tone_to_str(hit), hit); /*endif*/ } /*endfor*/ @@ -1198,7 +1502,7 @@ int main(int argc, char *argv[]) } /*endif*/ if (hit != MODEM_CONNECT_TONES_NONE) - printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %d\n", pitch, ans_pr_rx.channel_level, ans_pr_rx.notch_level, hit); + printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %s (%d)\n", pitch, ans_pr_rx.channel_level, ans_pr_rx.notch_level, modem_connect_tone_to_str(hit), hit); /*endif*/ } /*endfor*/ @@ -1251,7 +1555,7 @@ int main(int argc, char *argv[]) } /*endif*/ if (hit != MODEM_CONNECT_TONES_NONE) - printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %d\n", pitch, ans_pr_rx.channel_level, ans_pr_rx.notch_level, hit); + printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %s (%d)\n", pitch, ans_pr_rx.channel_level, ans_pr_rx.notch_level, modem_connect_tone_to_str(hit), hit); /*endif*/ } /*endfor*/ @@ -1304,7 +1608,7 @@ int main(int argc, char *argv[]) } /*endif*/ if (hit != MODEM_CONNECT_TONES_NONE) - printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %d\n", pitch, ans_pr_rx.channel_level, ans_pr_rx.notch_level, hit); + printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %s (%d)\n", pitch, ans_pr_rx.channel_level, ans_pr_rx.notch_level, modem_connect_tone_to_str(hit), hit); /*endif*/ } /*endfor*/ @@ -1331,6 +1635,8 @@ int main(int argc, char *argv[]) modem_connect_tones_rx_init(&cng_rx, MODEM_CONNECT_TONES_FAX_CNG, NULL, NULL); modem_connect_tones_rx_init(&ced_rx, MODEM_CONNECT_TONES_FAX_CED_OR_PREAMBLE, NULL, NULL); modem_connect_tones_rx_init(&ans_pr_rx, MODEM_CONNECT_TONES_ANS_PR, NULL, NULL); + modem_connect_tones_rx_init(&bell_ans_rx, MODEM_CONNECT_TONES_BELL_ANS, NULL, NULL); + modem_connect_tones_rx_init(&calling_tone_rx, MODEM_CONNECT_TONES_CALLING_TONE, NULL, NULL); for (j = 0; bellcore_files[j][0]; j++) { if ((inhandle = sf_open_telephony_read(bellcore_files[j], 1)) == NULL) @@ -1348,6 +1654,8 @@ int main(int argc, char *argv[]) modem_connect_tones_rx(&cng_rx, amp, frames); modem_connect_tones_rx(&ced_rx, amp, frames); modem_connect_tones_rx(&ans_pr_rx, amp, frames); + modem_connect_tones_rx(&bell_ans_rx, amp, frames); + modem_connect_tones_rx(&calling_tone_rx, amp, frames); if (modem_connect_tones_rx_get(&cng_rx) != MODEM_CONNECT_TONES_NONE) { /* This is not a true measure of hits, as there might be more @@ -1372,6 +1680,20 @@ int main(int argc, char *argv[]) modem_connect_tones_rx_init(&ans_pr_rx, MODEM_CONNECT_TONES_ANS_PR, NULL, NULL); } /*endif*/ + if (modem_connect_tones_rx_get(&bell_ans_rx) != MODEM_CONNECT_TONES_NONE) + { + printf("Hit calling tone at %ds\n", when); + hits++; + modem_connect_tones_rx_init(&bell_ans_rx, MODEM_CONNECT_TONES_BELL_ANS, NULL, NULL); + } + /*endif*/ + if (modem_connect_tones_rx_get(&calling_tone_rx) != MODEM_CONNECT_TONES_NONE) + { + printf("Hit calling tone at %ds\n", when); + hits++; + modem_connect_tones_rx_init(&calling_tone_rx, MODEM_CONNECT_TONES_CALLING_TONE, NULL, NULL); + } + /*endif*/ } /*endwhile*/ if (sf_close_telephony(inhandle)) @@ -1399,6 +1721,8 @@ int main(int argc, char *argv[]) modem_connect_tones_rx_init(&cng_rx, MODEM_CONNECT_TONES_FAX_CNG, cng_detected, NULL); modem_connect_tones_rx_init(&ced_rx, MODEM_CONNECT_TONES_FAX_CED_OR_PREAMBLE, ced_detected, NULL); modem_connect_tones_rx_init(&ans_pr_rx, MODEM_CONNECT_TONES_ANS_PR, ans_pr_detected, NULL); + modem_connect_tones_rx_init(&bell_ans_rx, MODEM_CONNECT_TONES_BELL_ANS, bell_ans_detected, NULL); + modem_connect_tones_rx_init(&calling_tone_rx, MODEM_CONNECT_TONES_CALLING_TONE, calling_tone_detected, NULL); hits = 0; if ((inhandle = sf_open_telephony_read(decode_test_file, 1)) == NULL) { @@ -1415,6 +1739,8 @@ int main(int argc, char *argv[]) modem_connect_tones_rx(&cng_rx, amp, frames); modem_connect_tones_rx(&ced_rx, amp, frames); modem_connect_tones_rx(&ans_pr_rx, amp, frames); + modem_connect_tones_rx(&bell_ans_rx, amp, frames); + modem_connect_tones_rx(&calling_tone_rx, amp, frames); } /*endwhile*/ if (sf_close_telephony(inhandle)) diff --git a/libs/spandsp/tests/t38_core_tests.c b/libs/spandsp/tests/t38_core_tests.c index c986d90c5d..efd103dcb3 100644 --- a/libs/spandsp/tests/t38_core_tests.c +++ b/libs/spandsp/tests/t38_core_tests.c @@ -479,7 +479,7 @@ int main(int argc, char *argv[]) int attack_packets; int opt; - attack_packets = 10000000; + attack_packets = 100000; while ((opt = getopt(argc, argv, "a:")) != -1) { switch (opt) diff --git a/libs/spandsp/tests/t4_tests.c b/libs/spandsp/tests/t4_tests.c index fc8d3f4ebb..2c07794196 100644 --- a/libs/spandsp/tests/t4_tests.c +++ b/libs/spandsp/tests/t4_tests.c @@ -62,7 +62,7 @@ t4_state_t receive_state; #define FILL_670 FILL_100 FILL_100 FILL_100 FILL_100 FILL_100 FILL_100 FILL_70 #define FILL_980 FILL_100 FILL_100 FILL_100 FILL_100 FILL_100 FILL_100 FILL_100 FILL_100 FILL_100 FILL_80 -static const char t4_test_patterns[][1728 + 1] = +static const char t4_t6_test_patterns[][1728 + 1] = { "XXXXXX " FILL_980 " XXX XXX X " FILL_670 " XXXX", "XXXXXX " FILL_980 " XXX X " FILL_670 " XXXX", @@ -145,7 +145,7 @@ static int row_read_handler(void *user_data, uint8_t buf[], size_t len) /* Send the test pattern. */ if (rows_read >= 16) return 0; - s = t4_test_patterns[rows_read++]; + s = t4_t6_test_patterns[rows_read++]; memset(buf, 0, len); for (i = 0; i < len; i++) { @@ -171,7 +171,7 @@ static int row_write_handler(void *user_data, const uint8_t buf[], size_t len) /* Verify that what is received matches the test pattern. */ if (len == 0) return 0; - s = t4_test_patterns[rows_written++]; + s = t4_t6_test_patterns[rows_written++]; memset(ref, 0, len); for (i = 0; i < len; i++) { diff --git a/libs/spandsp/tests/tsb85_tests.c b/libs/spandsp/tests/tsb85_tests.c index 74587fbb90..af557285ce 100644 --- a/libs/spandsp/tests/tsb85_tests.c +++ b/libs/spandsp/tests/tsb85_tests.c @@ -972,7 +972,6 @@ static int next_step(faxtester_state_t *s) printf("Test failed\n"); exit(2); } - t4_tx_set_min_bits_per_row(&t4_tx_state, min_row_bits); t4_tx_set_header_info(&t4_tx_state, NULL); compression_type = T4_COMPRESSION_ITU_T4_1D; if (compression) @@ -983,6 +982,7 @@ static int next_step(faxtester_state_t *s) compression_type = T4_COMPRESSION_ITU_T6; } t4_tx_set_tx_encoding(&t4_tx_state, compression_type); + t4_tx_set_min_bits_per_row(&t4_tx_state, min_row_bits); if (t4_tx_start_page(&t4_tx_state)) { span_log(&s->logging, SPAN_LOG_FLOW, "Failed to start T.4 send\n"); @@ -996,7 +996,7 @@ static int next_step(faxtester_state_t *s) corrupt_image(s, image, len, (const char *) bad_rows); } t4_tx_release(&t4_tx_state); - span_log(&s->logging, SPAN_LOG_FLOW, "Non-ECM image is %d bytes\n", len); + span_log(&s->logging, SPAN_LOG_FLOW, "Non-ECM image is %d bytes (min row bits %d)\n", len, min_row_bits); faxtester_set_non_ecm_image_buffer(s, image, len); } else if (strcasecmp((const char *) type, "PP") == 0) @@ -1012,7 +1012,6 @@ static int next_step(faxtester_state_t *s) printf("Test failed\n"); exit(2); } - t4_tx_set_min_bits_per_row(&t4_tx_state, min_row_bits); t4_tx_set_header_info(&t4_tx_state, NULL); compression_type = T4_COMPRESSION_ITU_T4_1D; if (compression) @@ -1023,6 +1022,7 @@ static int next_step(faxtester_state_t *s) compression_type = T4_COMPRESSION_ITU_T6; } t4_tx_set_tx_encoding(&t4_tx_state, compression_type); + t4_tx_set_min_bits_per_row(&t4_tx_state, min_row_bits); if (t4_tx_start_page(&t4_tx_state)) { span_log(&s->logging, SPAN_LOG_FLOW, "Failed to start T.4 send\n"); @@ -1038,7 +1038,7 @@ static int next_step(faxtester_state_t *s) } /*endif*/ t4_tx_release(&t4_tx_state); - span_log(&s->logging, SPAN_LOG_FLOW, "ECM image is %d bytes\n", len); + span_log(&s->logging, SPAN_LOG_FLOW, "ECM image is %d bytes (min row bits %d)\n", len, min_row_bits); faxtester_set_ecm_image_buffer(s, image, len, ecm_block, ecm_frame_size, i); } else diff --git a/libs/spandsp/tests/v17_tests.c b/libs/spandsp/tests/v17_tests.c index 33aef4d2ba..940e7f0751 100644 --- a/libs/spandsp/tests/v17_tests.c +++ b/libs/spandsp/tests/v17_tests.c @@ -227,11 +227,13 @@ static void qam_report(void *user_data, const complexf_t *constel, const complex #endif #if defined(ENABLE_GUI) if (use_gui) + { #if defined(SPANDSP_USE_FIXED_POINTx) qam_monitor_update_int_equalizer(qam_monitor, coeffs, len); #else qam_monitor_update_equalizer(qam_monitor, coeffs, len); #endif + } #endif update_interval = 100; } diff --git a/libs/spandsp/tests/v18_tests.c b/libs/spandsp/tests/v18_tests.c index 1666ce96a1..951fc88781 100644 --- a/libs/spandsp/tests/v18_tests.c +++ b/libs/spandsp/tests/v18_tests.c @@ -70,7 +70,6 @@ const char *full_baudot_rx = "XABCDEFGHIJKLMNOPQRSTUVWXYZ(/)' " "'ABCDEFGHIJKLMNOPQRSTUVWXYZ(!) "; -#if 1 static void put_text_msg(void *user_data, const uint8_t *msg, int len) { if (strcmp((const char *) msg, qbf_rx)) @@ -94,10 +93,17 @@ static void basic_tests(int mode) int i; v18_state_t *v18_a; v18_state_t *v18_b; + logging_state_t *logging; printf("Testing %s\n", v18_mode_to_str(mode)); v18_a = v18_init(NULL, TRUE, mode, put_text_msg, NULL); + logging = v18_get_logging_state(v18_a); + span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); + span_log_set_tag(logging, "A"); v18_b = v18_init(NULL, FALSE, mode, put_text_msg, NULL); + logging = v18_get_logging_state(v18_b); + span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); + span_log_set_tag(logging, "B"); /* Fake an OK condition for the first message test */ good_message_received = TRUE; @@ -153,11 +159,1353 @@ static void basic_tests(int mode) v18_free(v18_b); } /*- End of function --------------------------------------------------------*/ -#endif + +static int test_misc_01(void) +{ + /* + III.5.4.1.1 No disconnection test + Purpose: To verify that the DCE does not initiate a disconnection. + Preamble: N/A + Method: A call is made to the TUT from the tester which remains off hook for 10 minutes + without sending any signal. + Pass criteria: The TUT should answer the call and enter the probing state after 3 seconds. The + TUT should continue to probe until the test is terminated. + Comments: This feature should also be verified by observation during the automoding tests. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_misc_02(void) +{ + /* + III.5.4.1.2 Automatic resumption of automoding + Purpose: To ensure that the DCE can be configured to automatically re-assume the automode + calling state after 10 s of no valid signal. + Preamble: The TUT should be configured to automatically re-assume the initial automoding + state. + Method: The tester should set up a call to the TUT in V.21 mode and then drop the carrier. + The tester will then transmit silence for 11 seconds followed by a 1300 Hz tone for + 5 seconds (i.e. V.23). + Pass criteria: 1) Ten seconds after dropping the carrier the TUT should return to state Monitor 1. + 2) After 2.7±0.3 seconds the TUT should select V.23 mode and send a 390 Hz tone. + Comments: The TUT should indicate that carrier has been lost at some time after the 1650 Hz + signal is lost. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_misc_03(void) +{ + /* + III.5.4.1.3 Retention of selected mode on loss of signal + Purpose: To ensure that the DCE stays in the selected transmission mode if it is not + configured to automatically re-assume the initial automoding state. + Preamble: The TUT should be configured to remain in the selected transmission mode when + the carrier is lost. + Method: The tester should set up a call to the TUT in V.21 mode, for example. It will drop + the carrier for 9 seconds and then re-start transmission of the same carrier for + 1 second followed by a short message. + Pass criteria: The TUT should resume operation in V.21 mode and capture the entire test + message. + Comments: The TUT should indicate that carrier has been lost at some time after the carrier + signal is removed and not disconnect. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_misc_04(void) +{ + /* + III.5.4.1.4 Detection of BUSY tone + Purpose: To ensure that the DCE provides the call progress indication "BUSY" in presence of + the national busy tone. + Preamble: N/A + Method: The TUT should be configured to dial out and then be presented with the + appropriate national busy tone. + Pass criteria: Detection of busy tone should be displayed by the TUT. + Comments: ITU-T V.18 specifies that the DCE should not hang up, but that is intended to apply + to the case where a connection is established and then lost. A terminal may + automatically hang up when busy tone is detected. PABX busy tones may differ in + frequency and cadence from national parameters. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_misc_05(void) +{ + /* + III.5.4.1.5 Detection of RINGING + Purpose: To ensure that the DCE provides the call progress indication "RINGING" in + presence of the national ringing tone. + Preamble: N/A + Method: The tester will make a call to the TUT using the nationally recommended cadence + and the minimum recommended ring voltage/current. + Pass criteria: The RINGING condition should be visually indicated by the TUT. + Comments: This test should be repeated across a range of valid timings and ring voltages. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_misc_06(void) +{ + /* + III.5.4.1.6 "LOSS OF CARRIER" indication + Purpose: To ensure that the DCE provides the call progress indication "LOSS OF CARRIER" + upon a loss of carrier in full duplex modes, i.e. V.21, V.23, Bell 103. + Preamble: N/A + Method: Set up a call in each of the full duplex modes and force a carrier failure to the TUT. + Pass criteria: Loss of carrier should be indicated and disappear when the carrier is restored. + Comments: The V.18 modem should not automatically disconnect when used in a manual + conversation mode. However, a V.18 equipped terminal may disconnect based on + operational decisions, e.g. when it is a terminal in automatic answering machine + mode. There may be other cases, e.g. where the V.18 DCE is used in a gateway, + when automatic disconnection is required. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_misc_07(void) +{ + /* + III.5.4.1.7 Call progress indication + Purpose: To ensure that the DCE provides the call progress indication "CONNECT(x)" upon + a connection. + Preamble: N/A + Method: Correct CONNECT messages should be verified during the Automode tests that + follow. + Pass criteria: The relevant mode should be indicated by the DCE when automoding is complete. + However, this may possibly not be indicated by the DTE. + Comments: The possible modes are: V.21, V.23, Baudot 45, Baudot 50, EDT, Bell 103, DTMF. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_misc_08(void) +{ + /* + III.5.4.1.8 Circuit 135 Test + Purpose: To ensure that the DCE implements circuit 135 or an equivalent way of indicating + presence of a signal. + Preamble: N/A + Method: A call from the TUT should be answered in voice mode after 20 seconds. The tester + will transmit sampled voice messages. V.24 circuit 135 or its equivalent should be + observed. + Pass criteria: The ring tone and speech shall be indicated by circuit 135. + Comment: The response times and signal level thresholds of Circuit 135 are not specified in + ITU-T V.18 or V.24 and therefore the pattern indicated may vary. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_misc_09(void) +{ + /* + III.5.4.1.9 Connection procedures + Purpose: To ensure that the TUT implements the call connect procedure described in + clause 6. + Preamble: N/A + Method: TBD + Pass criteria: TBD + Comment: TBD + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_org_01(void) +{ + /* + III.5.4.2.1 CI and XCI signal coding and cadence + Purpose: To verify that TUT correctly emits the CI and XCI signals with the ON/OFF + cadence defined in 5.1.1. + Preamble: N/A + Method: V.21 demodulator is used to decode the CI sequence and a timer to measure the + silence intervals between them. The XCI signal is also monitored and decoded to + check for correct coding and timing of the signal. + Pass criteria: 1) No signal should be transmitted for one second after connecting to the line. + 2) Four CI patterns are transmitted for each repetition. + 3) No signal is transmitted for two seconds after the end of each CI. + 4) Each CI must have the correct bit pattern. + 5) The CI patterns followed by two seconds of silence must be repeated twice. + 6) One second after every 3 blocks CI an XCI signal must be transmitted. + 7) The XCI should have the structure defined in 3.11. + 8) The whole sequence should be repeated until the call is cleared. + 9) When V.18 to V.18, the XCI must not force V.23 or Minitel mode. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_org_02(void) +{ + /* + III.5.4.2.2 ANS signal detection + Purpose: To verify that TUT correctly detects the ANS (2100 Hz) signal during the + two-second interval (Toff) between transmission of CI sequences. + Preamble: Make a V.18 call from the TUT. + Method: The Test System waits for the TUT to stop transmitting a CI and responds with an + ANS signal. The V.21 demodulator is used to decode the TXP sequence and a timer + measures the silence intervals between them. ANS should be transmitted for 2 + seconds. + Pass criteria: 1) No signal should be transmitted by TUT for 0.5 seconds from detection of ANS. + 2) The TUT should reply with transmission of TXP as defined in 5.1.2. + 3) Verify that TXP sequence has correct bit pattern. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_org_03(void) +{ + /* + III.5.4.2.3 End of ANS signal detection + Purpose: The TUT should stop sending TXP at the end of the current sequence when the ANS + tone ceases. + Preamble: Test ORG-02 should be successfully completed immediately prior to this test. + Method: The tester sends ANS for 2 seconds followed by silence. The tester will then + monitor for cessation of TXP at the end of the answer tone. + Pass criteria: The TUT should stop sending TXP at the end of the current sequence when ANS + tone ceases. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_org_04(void) +{ + /* + III.5.4.2.4 ANS tone followed by TXP + Purpose: To check correct detection of V.18 modem. + Preamble: Tests ORG-02 and ORG-03 should be successfully completed prior to this test. + Method: Tester transmits ANS for 2.5 seconds followed by 75 ms of no tone then transmits + 3 TXP sequences using V.21 (2) and starts a 1 s timer. It will then transmit 1650 Hz + for 5 seconds. + Pass criteria: 1) TUT should initially respond with TXP. + 2) TUT should stop sending TXP within 0.2 seconds of end of ANS. + 3) TUT should respond with 980 Hz carrier within 1 second of end of 3 TXP sequences. + 4) Data should be transmitted and received according to ITU-T T.140 to comply + with the V.18 operational requirements. + Comments: The TUT should indicate that V.18 mode has been selected. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_org_05(void) +{ + /* + III.5.4.2.5 ANS tone followed by 1650 Hz + Purpose: To check correct detection of V.21 modem upper channel when preceded by answer + tone and to confirm discrimination between V.21 and V.18 modes. + Preamble: Tests ORG-02 and ORG-03 should be successfully completed prior to this test. + Method: Tester transmits ANS for 2.5 seconds followed by 75 ms of no tone then transmits + 1650 Hz and starts a 0.7 second timer. + Pass criteria: 1) TUT should initially respond with TXP. + 2) TUT should stop sending TXP within 0.2 seconds of end of ANS. + 3) TUT should respond with 980 Hz at 0.5(+0.2-0.0) seconds of start of 1650 Hz. + 4) Data should be transmitted and received at 300 bit/s complying with Annex F. + Comments: Selection of ITU-T V.21 as opposed to ITU-T V.18 should be confirmed by + examination of TUT. If there is no visual indication, verify by use of ITU-T T.50 for + ITU-T V.21 as opposed to UTF-8 coded ISO 10646 character set for ITU-T V.18. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_org_06(void) +{ + /* + III.5.4.2.6 ANS tone followed by 1300 Hz + Purpose: To check correct detection of V.23 modem upper channel when preceded by answer + tone. + Preamble: Tests ORG-02 and ORG-03 should be successfully completed prior to this test. + Method: Tester transmits ANS for 2.5 seconds followed by 75 ms of no tone then transmits + 1300 Hz and starts a 2.7 s timer. + Pass criteria: 1) TUT should initially respond with TXP. + 2) TUT should stop sending TXP within 0.2 seconds of end of ANS. + 3) TUT should respond with 390 Hz after 1.7(+0.2-0.0) seconds of start of 1300 Hz. + 4) Data should be transmitted and received at 75 bit/s and 1200 bit/s respectively + by the TUT to comply with Annex E. + Comments: The TUT should indicate that V.23 mode has been selected. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_org_07(void) +{ + /* + III.5.4.2.7 ANS tone followed by no tone + Purpose: To confirm that TUT does not lock up under this condition. + Preamble: Tests ORG-02 and ORG-03 should be successfully completed prior to this test. + Method: Tester transmits ANS for 2.5 seconds followed by no tone for 10 s. It then transmits + DTMF tones for 2 seconds. + Pass criteria: 1) TUT should initially respond with TXP. + 2) TUT should stop sending TXP within 0.2 seconds of end of ANS. + 3) TUT should return to Monitor 1 state and then connect in DTMF mode within + 12 seconds of the end of ANS tone. + Comments: This condition would cause the terminal to lock up if the V.18 standard is followed + literally. It may however, occur when connected to certain Swedish textphones if the + handset is lifted just after the start of an automatically answered incoming call. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_org_08(void) +{ + /* + III.5.4.2.8 Bell 103 (2225 Hz signal) detection + Purpose: To verify that the TUT correctly detects the Bell 103 upper channel signal during + the 2-second interval between transmission of CI sequences. + Preamble: N/A + Method: The tester waits for a CI and then sends a 2225 Hz signal for 5 seconds. + Pass criteria: 1) The TUT should respond with a 1270 Hz tone in 0.5±0.1 seconds. + 2) Data should be transmitted and received at 300 bit/s to comply with Annex D. + Comments: The TUT should indicate that Bell 103 mode has been selected. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_org_09(void) +{ + /* + III.5.4.2.9 V.21 (1650 Hz signal) detection + Purpose: To verify that the TUT correctly detects the V.21 upper channel signal during the + 2-second interval between transmission of CI sequences. + Preamble: N/A + Method: The tester waits for a CI and then sends a 1650 Hz signal for 5 seconds. + Pass criteria: 1) The TUT should respond with a 980 Hz tone in 0.5±0.1 seconds. + 2) Data should be transmitted and received at 300 bit/s to comply with Annex F. + Comments: + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_org_10(void) +{ + /* + III.5.4.2.10 The TUT should indicate that V.21 mode has been selected. + V.23 (1300 Hz signal) detection + Purpose: To verify that the TUT correctly detects the V.23 upper channel signal during the + 2-second interval between transmission of CI sequences. + Preamble: N/A + Method: The tester waits for a CI and then sends a 1300 Hz signal for 5 seconds. + Pass criteria: 1) The TUT should respond with a 390 Hz tone in 1.7±0.1 seconds. + 2) Data should be transmitted and received at 75 bit/s and 1200 bit/s respectively + by the TUT to comply with Annex E. + Comments: + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_org_11(void) +{ + /* + III.5.4.2.11 The TUT should indicate that V.23 mode has been selected. + V.23 (390 Hz signal) detection + Purpose: To confirm correct selection of V.23 reverse mode during sending of XCI. + Preamble: N/A + Method: The tester should wait for the start of the XCI signal and then send 390 Hz to TUT + for 5 seconds. + Pass criteria: 1) The TUT should complete the XCI as normal. + 2) The TUT should then maintain the 1300 Hz tone while the 390 Hz test tone is + present. + 3) Data should be transmitted and received at 1200 bit/s and 75 bit/s respectively + by the TUT to comply with Annex E when connection is indicated. + Comments: + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_org_12(void) +{ + /* + III.5.4.2.12 The TUT should indicate that V.23 mode has been selected at least 3 seconds after + the start of the 390 Hz tone. + 5 bit mode (Baudot) detection tests + Purpose: To confirm detection of Baudot modulation at various bit rates that may be + encountered. + Preamble: N/A + Method: The tester transmits the 5-bit coded characters "0" to "9" followed by "abcdef" at + (a) 45.45, (b) 47.6, (c) 50 and (d) 100 bits per second. When TUT indicates a + connection, type at least 5 characters back to the tester so that correct selection of bit + rate can be confirmed. + Pass criteria: 1) TUT should select Baudot mode and the appropriate bit rate. + 2) The tester will analyse the bit rate of received characters, which should be at + either 45.45 or 50 bits per second as appropriate. + Comments: 45.45 and 50 bit/s are the commonly used Baudot bit rates. However, certain + textphones can operate at higher rates (e.g. 100 bit/s). Responding at either 45.45 or + 50 bit/s is acceptable to these devices which normally fall back to the selected rate. + 47.6 bit/s may possibly be encountered from another V.18 textphone in the + automode answer state. The TUT may then select either 45.45 or 50 bit/s for the + transmission. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_org_13(void) +{ + /* + III.5.4.2.13 DTMF signal detection + Purpose: To verify whether the TUT correctly recognizes DTMF signals during the 2-second + interval between transmission of CI. + Preamble: N/A + Method: The tester will send a single DTMF tone of 40 ms duration to TUT. When TUT + indicates a connection, type at least 5 characters back to the tester so that correct + selection of mode can be confirmed. + Pass criteria: The tester will analyse the received characters to confirm DTMF mode selection. + Comments: TUT should indicate that it has selected DTMF mode. The DTMF capabilities of the + TUT should comply with ITU-T Q.24 for the Danish Administration while + receiving for best possible performance. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_org_14(void) +{ + /* + III.5.4.2.14 EDT rate detection + Purpose: To confirm detection of EDT modems by detecting the transmission rate of received + characters. + Preamble: N/A + Method: The tester transmits EDT characters "abcdef" to TUT at 110 bit/s. When TUT + indicates that the connection is established, type characters "abcdef" back to + the tester. The same characters will then be transmitted back to the TUT. + Pass criteria: Ensure correct reception of characters by tester and TUT. + Comments: The TUT should be able to determine the rate on the six characters given. If it takes + more than this then performance is probably inadequate as too many characters + would be lost. Some characters may be lost during the detection process. However, + the number lost should be minimal. The data bits and parity are specified in + Annex C. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_org_15(void) +{ + /* + III.5.4.2.15 Rate detection test + Purpose: To verify the presence of 980/1180 Hz at a different signalling rate than 110 bit/s + returns the TUT modem to the "monitor A" state. + Preamble: N/A + Method: The tester transmits 980/1180 Hz signals at 300 bit/s for 2 seconds. + Pass criteria: The TUT should not select EDT or any other mode and should continue to transmit + the CI signal. + Comments: Echoes of the CI sequences may be detected at 300 bit/s. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_org_16(void) +{ + /* + III.5.4.2.16 980 Hz detection + Purpose: To confirm correct selection of V.21 reverse mode. + Preamble: N/A + Method: The tester sends 980 Hz to TUT for 5 seconds. + Pass criteria: 1) TUT should respond with 1650 Hz tone after 1.5±0.1 seconds after start of + 980 Hz tone. + 2) Data should be transmitted and received at 300 bit/s complying with Annex F. + Comments: + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_org_17(void) +{ + /* + III.5.4.2.17 The TUT should indicate that V.21 mode has been selected. + Loss of signal after 980 Hz + Purpose: To confirm that TUT returns to the Monitor 1 state if 980 Hz signal disappears. + Preamble: N/A + Method: The tester sends 980 Hz to TUT for 1.2 seconds followed by silence for 5 seconds. + Pass criteria: TUT should not respond to the 980 Hz tone and resume sending CI signals after a + maximum of 2.4 seconds from the end of the 980 Hz tone. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_org_18(void) +{ + /* + III.5.4.2.18 Tr timer + Purpose: To confirm that TUT returns to the Monitor 1 state if Timer Tr expires. + Preamble: N/A + Method: The tester sends 980 Hz to TUT for 1.2 seconds followed by 1650 Hz for 5 seconds + with no pause. + Pass criteria: TUT should respond with 980 Hz after 1.3±0.1 seconds of 1650 Hz. + Comments: This implies timer Tr has expired 2 seconds after the start of the 980 Hz tone and + then 1650 Hz has been detected for 0.5 seconds. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_org_19(void) +{ + /* + III.5.4.2.19 Bell 103 (1270 Hz signal) detection + Purpose: To confirm correct selection of Bell 103 reverse mode. + Preamble: N/A + Method: The tester sends 1270 Hz to TUT for 5 seconds. + Pass criteria: 1) TUT should respond with 2225 Hz tone after 0.7±0.1 s. + 2) Data should be transmitted and received at 300 bit/s complying with Annex D. + Comments: + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_org_20(void) +{ + /* + III.5.4.2.20 The TUT should indicate that Bell 103 mode has been selected. + Immunity to network tones + Purpose: To ensure that the TUT does not interpret network tones as valid signals. + Preamble: N/A + Method: The tester will first send a dial tone to the TUT, this will be followed by a ringing + tone and a network congestion tone. The frequencies and cadences of the tones will + vary according to the country setting. The tester must be configured for the same + country as the TUT. + Pass criteria: The countries supported by the TUT should be noted along with the response to + each tone. The tones should either be ignored or reported as the relevant network + tone to the user. + Comments: V.18 is required to recognize and report RINGING and BUSY tones. Other network + tones may be ignored. Some devices may only provide a visual indication of the + presence and cadence of the tones for instance by a flashing light. The TUT may + disconnect on reception of tones indicating a failed call attempt. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_org_21(void) +{ + /* + III.5.4.2.21 Immunity to non-textphone modems + Purpose: To ensure that the TUT does not interpret modem tones not supported by V.18 as + valid text telephone tones. + Preamble: N/A + Method: The tester will respond with an ANS tone (2100 Hz) followed by simulated (a) + V.32 bis and (b) V.34 modem training sequences. + Pass criteria: The tones should either be ignored or reported back to the user. No textphone + modem should be selected. + Comments: Some high speed modems may fall back to a compatibility mode, e.g. V.21 or V.23 + that should be correctly detected by the TUT. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_org_22(void) +{ + /* + III.5.4.2.22 Immunity to fax tones + Purpose: To ensure that the TUT will not interpret a called fax machine as being a textphone. + Preamble: N/A + Method: The tester will respond as if it were a typical group 3 fax machine in automatic + answer mode. It should send a CED tone (2100 Hz) plus Digital Identification + Signal (DIS) as defined in ITU-T T.30. + Pass criteria: The TUT should ignore the received tones. + Comments: Ideally the TUT should detect the presence of a fax machine and report it back to + the user. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_org_23(void) +{ + /* + III.5.4.2.23 Immunity to voice + Purpose: To ensure that the TUT does not misinterpret speech as a valid textphone signal. + Preamble: N/A + Method: The tester will respond with sampled speech. A number of phrases recorded from + typical male and female speakers will be transmitted. This will include a typical + network announcement. + Pass criteria: The TUT should ignore the speech. + Comments: Ideally the TUT should report the presence of speech back to the user, e.g. via + circuit 135. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_org_24(void) +{ + /* + III.5.4.2.24 ANSam signal detection + Purpose: To verify that TUT correctly detects the ANSam (2100 Hz modulated) signal during + the two-second interval (Toff) between transmission of CI sequences. + Preamble: Make a V.18 call from the TUT. + Method: The Test System waits for the TUT to stop transmitting a CI and responds with an + ANSam signal. The V.21 demodulator is used to decode the CM sequence. ANSam + should be transmitted for 2 seconds. + Pass criteria: 1) No signal should be transmitted by TUT for 0.5 seconds from detection of + ANSam. + 2) The TUT should reply with transmission of CM as defined in 5.2.13. + 3) Verify that CM sequence has correct bit pattern. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_org_25(void) +{ + /* + III.5.4.2.25 V.8 calling procedure + Purpose: To verify that TUT correctly performs a V.8 call negotiation. + Preamble: Make a V.18 call from the TUT. Answer with ANSam from the Tester and with JM + for V.21 on the CM. + Method: The Test System waits for the TUT to start transmitting V.21 carrier (1). + Pass criteria: The TUT should connect by sending V.21 carrier (1). + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_01(void) +{ + /* + III.5.4.3.1 Ta timer + Purpose: To ensure that on connecting the call, the DCE starts timer Ta (3 seconds) and on + expiry begins probing. + Preamble: N/A + Method: The tester makes a call to the TUT and attempts to determine when the TUT + answers the call. It will then monitor for any signal. + Pass criteria: The TUT should start probing 3 seconds after answering the call. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_02(void) +{ + /* + III.5.4.3.2 CI signal detection + Purpose: To confirm the correct detection and response to the V.18 CI signal. + Preamble: N/A + Method: The tester will transmit 2 sequences of 4 CI patterns separated by 2 seconds. It will + monitor for ANS and measure duration. + Pass criteria: 1) The TUT should respond after either the first or second CI with ANSam tone. + 2) ANSam tone should remain for 3 seconds ±0.5 s followed by silence. + Comments: The ANSam tone is a modulated 2100 Hz tone. It may have phase reversals. The + XCI signal is tested in a separate test. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_03(void) +{ + /* + III.5.4.3.3 Early termination of ANSam tone + Purpose: To confirm that the TUT will respond correctly to TXP signals, i.e. by stopping + ANSam tone on reception of TXP signal. + Preamble: N/A + Method: The tester will transmit 2 sequences of 4 CI patterns separated by 2 seconds. On + reception of the ANSam tone the tester will wait 0.5 seconds and then begin + transmitting the TXP signal in V.21 (1) mode. + Pass criteria: 1) On reception of the TXP signal, the TUT should remain silent for 75±5 ms. + 2) The TUT should then transmit 3 TXP sequences in V.21(2) mode. + 3) The 3 TXPs should be followed by continuous 1650 Hz. + 4) Correct transmission and reception of T.140 data should be verified after the + V.18 mode connection is completed. + Comments: The TUT should indicate V.18 mode. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_04(void) +{ + /* + III.5.4.3.4 Tt timer + Purpose: To ensure that after detection of ANSam the TUT will return to Monitor A after + timer Tt expires. + Preamble: Successful completion of test ANS-03. + Method: After completion of test ANS-03 the tester will continue to monitor for signals. + Pass criteria: The TUT should start probing 3 seconds after ANSam disappears. + Comments: It is assumed that timer Ta is restarted on return to Monitor A. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_05(void) +{ + /* + III.5.4.3.5 ANS tone followed by 980 Hz + Purpose: To check correct detection of V.21 modem lower channel when preceded by answer + tone. + Preamble: N/A + Method: Tester transmits ANS for 2.5 seconds followed by 75 ms of no tone then transmits + 980 Hz and starts a 1 s timer. + Pass criteria: TUT should respond with 1650 Hz within 400±100 ms of start of 980 Hz. + Comments: The TUT should indicate that V.21 mode has been selected. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_06(void) +{ + /* + III.5.4.3.6 ANS tone followed by 1300 Hz + Purpose: To check correct detection of V.23 modem upper channel when preceded by answer + tone. + Preamble: N/A + Method: Tester transmits ANS for 2.5 seconds followed by 75 ms of no tone then transmits + 1300 Hz and starts a 2-s timer. + Pass criteria: TUT should respond with 390 Hz after 1.7(+0.2-0.0) seconds of start of 1300 Hz. + Comments: The TUT should indicate that V.23 mode has been selected. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_07(void) +{ + /* + III.5.4.3.7 ANS tone followed by 1650 Hz + Purpose: To check correct detection of V.21 modem upper channel when preceded by answer + tone and to confirm discrimination between V.21 and V.18 modes. + Preamble: N/A + Method: Tester transmits ANS for 2.5 seconds followed by 75 ms of no tone then transmits + 1650 Hz and starts a 1-second timer. + Pass criteria: TUT should respond with 980 Hz within 400±100 ms of start of 1650 Hz. + Comments: The TUT should indicate that V.21 mode has been selected. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_08(void) +{ + /* + III.5.4.3.8 980 Hz followed by 1650 Hz + Purpose: To ensure the correct selection of V.21 modem channel when certain types of + Swedish textphones are encountered. + Preamble: N/A + Method: The tester will simulate a call from a Diatext2 textphone that alternates between + 980 Hz and 1650 Hz until a connection is made. + Pass criteria: The TUT should respond with the appropriate carrier depending on when it + connects. + Comments: The TUT should indicate a V.21 connection. The time for which each frequency is + transmitted is random and varies between 0.64 and 2.56 seconds. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_09(void) +{ + /* + III.5.4.3.9 980 Hz calling tone detection + Purpose: To confirm correct detection of 980 Hz calling tones as defined in V.25. + Preamble: N/A + Method: The tester will send bursts of 980 Hz signals (a) 400 ms, (b) 500 ms, (c) 700 ms and + (d) 800 ms followed by 1 second of silence. + Pass criteria: 1) The TUT should not respond to bursts of 400 or 800 ms. + 2) The TUT should immediately begin probing after a burst of 980 Hz for 500 or + 700 ms followed by 1 second of silence. + Comments: + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_10(void) +{ + /* + III.5.4.3.10 The probe sent by the TUT will depend on the country setting. + V.21 detection by timer + Purpose: To confirm correct selection of V.21 calling modem when the received signal is not + modulated, i.e. there is no 1180 Hz. + Preamble: N/A + Method: The tester sends 980 Hz to TUT for 2 seconds. + Pass criteria: The TUT should respond with a 1650 Hz tone in 1.5±0.1 seconds. + Comments: The TUT should indicate that V.21 mode has been selected. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_11(void) +{ + /* + III.5.4.3.11 EDT detection by rate + Purpose: To confirm detection of EDT modems by detecting the transmission rate of received + characters. + Preamble: N/A + Method: The tester transmits EDT characters "abcdef" to TUT at 110 bit/s. When TUT + indicates that the connection is established, type characters "abcdef" back to + the tester. The same characters will then be transmitted back to the TUT. + Pass criteria: Ensure correct reception of characters by tester and TUT. + Comments: The TUT should indicate that EDT mode has been selected. Some characters may + be lost during the detection process. However, the number lost should be minimal. + The data bits and parity are specified in Annex C. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_12(void) +{ + /* + III.5.4.3.12 V.21 Detection by rate + Purpose: To confirm detection of V.21 modem low channel by detecting the transmission rate + of received characters and to ensure correct discrimination between V.18 and V.21 + modes. + Preamble: N/A + Method: The tester transmits characters "abcdef" to TUT using V.21 (1) at 300 bit/s. When + TUT indicates that the connection is established, type characters "abcdef" + back to the tester. The same characters will then be transmitted back to the TUT. + Pass criteria: Ensure correct reception of characters by tester and TUT. + Comments: This situation is unlikely to occur in practice unless the DCE is sending a V.21 + (1650 Hz) probe. However, it is catered for in V.18. It is more likely that this is + where CI or TXP characters would be detected (see test ANS-02). + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_13(void) +{ + /* + III.5.4.3.13 Tr timer + Purpose: To ensure that the TUT returns to the Monitor A state on expiry of timer Tr + (2 seconds). Timer Tr is started when a modulated V.21 (1) signal is detected. + Preamble: N/A + Method: The tester will transmit 980 Hz for 200 ms followed by alternating 980 Hz/1180 Hz + at 110 bit/s for 100 ms followed by 980 Hz for 1 second. + Pass criteria: The TUT should begin probing 4±0.5 seconds after the 980 Hz signal is removed. + Comments: It is not possible to be precise on timings for this test since the definition of a + "modulated signal" as in 5.2.4.4 is not specified. Therefore it is not known exactly + when timer Tr will start. It is assumed that timer Ta is restarted on re-entering the + Monitor A state. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_14(void) +{ + /* + III.5.4.3.14 Te timer + Purpose: To ensure that the TUT returns to the Monitor A on expiry of timer Te + (2.7 seconds). Timer Te is started when a 980 Hz signal is detected. + Preamble: N/A + Method: The tester will transmit 980 Hz for 200 ms followed silence for 7 s. + Pass criteria: The TUT should begin probing 5.5±0.5 seconds after the 980 Hz signal is removed. + Comments: It is assumed that timer Ta (3 seconds) is restarted on re-entering the Monitor A + state. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_15(void) +{ + /* + III.5.4.3.15 5 Bit mode (Baudot) detection tests + Purpose: To confirm detection of Baudot modulation at various bit rates that may be + encountered. + Preamble: N/A + Method: The tester transmits the 5-bit coded characters "0" to "9" followed by "abcdef" at + (a) 45.45, (b) 47.6, (c) 50 and (d) 100 bits per second. When TUT indicates a + connection, type at least 5 characters back to the tester so that correct selection of bit + rate can be confirmed. + Pass criteria: 1) The TUT should select Baudot mode and the appropriate bit rate. + 2) The tester will analyse the bit rate of received characters, which should be at an + appropriate rate, and confirm the carrier on/off times before and after the + characters. + Comments: 45.45 and 50 bit/s are the commonly used Baudot bit rates. However, some + textphones can transmit at higher rates, e.g. 100 bit/s. Responding at either 45.45 or + 50 bit/s is acceptable to these devices which then fall back to the selected rate. + A rate of 47.6 bit/s may be encountered from another V.18 textphone in the + automode answer state. The TUT may then select either 45.45 or 50 bit/s for the + transmission. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_16(void) +{ + /* + III.5.4.3.16 DTMF signal detection + Purpose: To verify whether the TUT correctly recognizes DTMF signals. + Preamble: N/A + Method: The tester will send a single DTMF tone of 40 ms duration to TUT. When TUT + indicates a connection, type at least 5 characters back to the tester so that correct + selection of mode can be confirmed. + Pass criteria: Tester will analyse the received characters to confirm DTMF mode selection. + Comments: The TUT should indicate that it has selected DTMF mode. The DTMF capabilities + of the TUT should comply with ITU-T Q.24 for the Danish Administration. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_17(void) +{ + /* + III.5.4.3.17 Bell 103 (1270 Hz signal) detection + Purpose: To ensure correct detection and selection of Bell 103 modems. + Preamble: N/A + Method: The tester sends 1270 Hz to TUT for 5 seconds. + Pass criteria: TUT should respond with 2225 Hz tone after 0.7±0.1 s. + Comments: The TUT should indicate that Bell 103 mode has been selected. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_18(void) +{ + /* + III.5.4.3.18 Bell 103 (2225 Hz signal) detection + Purpose: To ensure correct detection and selection of Bell 103 modems in reverse mode. + Preamble: N/A + Method: The tester sends 2225 Hz to TUT for 5 seconds. + Pass criteria: The TUT should respond with 1270 Hz after 1±0.2 seconds. + Comments: The TUT should indicate that Bell 103 mode has been selected. Bell 103 modems + use 2225 Hz as both answer tone and higher frequency of the upper channel. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_19(void) +{ + /* + III.5.4.3.19 V.21 Reverse mode (1650 Hz) detection + Purpose: To ensure correct detection and selection of V.21 reverse mode. + Preamble: N/A + Method: The tester sends 1650 Hz to TUT for 5 seconds. + Pass criteria: The TUT should respond with 980 Hz after 0.4±0.2 seconds. + Comments: The TUT should indicate that V.21 mode has been selected. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_20(void) +{ + /* + III.5.4.3.20 1300 Hz calling tone discrimination + Purpose: To confirm correct detection of 1300 Hz calling tones as defined in ITU-T V.25. + Preamble: N/A + Method: The tester will send 1300 Hz bursts of (a) 400 ms, (b) 500 ms, (c) 700 ms and + (d) 800 ms followed by 1 second of silence. + Pass criteria: 1) The TUT should not respond to bursts of 400 or 800 ms. + 2) The TUT should immediately begin probing after a burst of 1300 Hz for 500 or + 700 ms followed by 1 second of silence. + Comments: + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_21(void) +{ + /* + III.5.4.3.21 The probe sent by the TUT will depend on the country setting. + V.23 Reverse mode (1300 Hz) detection + Purpose: To ensure correct detection and selection of V.23 reverse mode. + Preamble: N/A + Method: The tester sends 1300 Hz only, with no XCI signals, to TUT for 5 seconds. + Pass criteria: The TUT should respond with 390 Hz after 1.7±0.1 seconds. + Comments: The TUT should indicate that V.23 mode has been selected. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_22(void) +{ + /* + III.5.4.3.22 1300 Hz with XCI test + Purpose: To ensure correct detection of the XCI signal and selection of V.18 mode. + Preamble: N/A + Method: The tester sends XCI signal as defined in 3.11. On reception of ANS it will become + silent for 500 ms then transmit the TXP signal in V.21 (1) mode. + Pass criteria: The TUT should respond with TXP using V.21 (2) and select V.18 mode. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_23(void) +{ + /* + III.5.4.3.23 Stimulate mode country settings + Purpose: To ensure that the TUT steps through the probes in the specified order for the + country selected. + Preamble: The TUT should be configured for each of the possible probe orders specified in + Appendix I in turn. + Method: The tester will call the TUT, wait for Ta to expire and then monitor the probes sent + by the TUT. + Pass criteria: The TUT should use the orders described in Appendix I. + Comments: The order of the probes is not mandatory. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_24(void) +{ + /* + III.5.4.3.24 Stimulate carrierless mode probe message + Purpose: To ensure that the TUT sends the correct probe message for each of the carrierless + modes. + Preamble: N/A + Method: The tester will call the TUT, wait for Ta to expire and then monitor the probes sent + by the TUT. + Pass criteria: The TUT should send the user defined probe message for Annexes A, B, and C + modes followed by a pause of Tm (default 3) seconds. + Comments: + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_25(void) +{ + /* + III.5.4.3.25 The carrierless modes are those described in Annexes A, B and C. + Interrupted carrierless mode probe + Purpose: To ensure that the TUT continues probing from the point of interruption a maximum + of 20 s after a failed connect attempt. + Preamble: The TUT should be configured for the UK country setting. + Method: The tester will call the TUT, wait for Ta to expire and then during the pause after + the first Baudot probe it will send a 200 ms burst of 1270 Hz followed by silence + for 30 s. + Pass criteria: The TUT should transmit silence on detecting the 1270 Hz tone and then continue + probing starting with the V.23 probe 20 seconds after the end of the 1270 Hz signal. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_26(void) +{ + /* + III.5.4.3.26 Stimulate carrier mode probe time + Purpose: To ensure that the TUT sends each carrier mode for time Tc (default 6 seconds) + preceded by the correct answer tone. + Preamble: None. + Method: The tester will call the TUT, wait for Ta to expire and then monitor the probes sent + by the TUT. + Pass criteria: The TUT should send the ANS tone (2100 Hz) for 1 second followed by silence for + 75±5 ms and then the 1650 Hz, 1300 Hz and 2225 Hz probes for time Tc. + Comments: The carrier modes are those described in Annexes D, E, and F. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_27(void) +{ + /* + III.5.4.3.27 V.23 mode (390 Hz) detection + Purpose: To confirm correct selection of V.23 mode. + Preamble: N/A + Method: The tester waits until the 1300 Hz probe is detected from the TUT and then + transmits 390 Hz for 11 seconds. + Pass criteria: 1) After 3 seconds of the 390 Hz signal the TUT should indicate that V.23 has + been selected. + 2) The tester will confirm that the 1300 Hz carrier is maintained for at least + 4 seconds beyond the normal probe duration, i.e. Tc (= 6 s default) + 4 s = + 10 seconds total. + Comments: + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_28(void) +{ + /* + III.5.4.3.28 All known V.23 devices need to receive 1300 Hz tone before they will respond with + 390 Hz. When the 1300 Hz probe is not being transmitted, a 390 Hz tone may be + interpreted as a 400 Hz network tone. + Interrupted carrier mode probe + Purpose: To ensure that the TUT continues probing from the point of interruption a maximum + of 4 s after a failed connect attempt. + Preamble: The TUT should be configured for the UK country setting. + Method: The tester will call the TUT, wait for Ta to expire and then during the first V.21 + probe it will send a 200 ms burst of 1270 Hz followed by silence for 30 s. + Pass criteria: The TUT should transmit silence on detecting the 1270 Hz tone and then continue + probing with the Baudot stored message 4 seconds after the end of the 1270 Hz + burst. + Comments: It is most likely that the TUT will return to probing time Ta (3 seconds) after the + 1270 Hz tone ceases. This condition needs further clarification. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_29(void) +{ + /* + III.5.4.3.29 Stimulate mode response during probe + Purpose: To ensure that the TUT is able to detect an incoming signal while transmitting a + carrier mode probe. + Preamble: N/A + Method: The tester will step through each possible response as defined in tests ANS-08 to + ANS-23 for each of the carrier mode probes and for each pause after a carrierless + mode probe message. + Pass criteria: The TUT should respond as described in the appropriate test above. + Comments: The TUT may not respond to any signals while a carrierless mode probe is being + sent since these modes are half duplex. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_30(void) +{ + /* + III.5.4.3.30 Immunity to network tones + Purpose: To ensure that the TUT does not interpret network tones as valid signals. + Preamble: N/A + Method: The tester will first send a busy tone to the TUT this will be followed by a number + unobtainable tone. The frequencies and cadences of the tones will vary according to + the country setting. The tester must be configured for the same country as the TUT. + Pass criteria: The countries supported by the TUT should be noted along with the response to + each tone. The tones should either be ignored or reported as the relevant network + tone to the user. + Comments: V.18 is required to recognize and report RINGING and BUSY tones. Other network + tones may be ignored. Some devices may only provide a visual indication of the + presence and cadence of the tones for instance by a flashing light. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_31(void) +{ + /* + III.5.4.3.31 Immunity to fax calling tones + Purpose: To determine whether the TUT can discriminate fax calling tones. + Preamble: N/A + Method: The tester will call the TUT and send the fax calling tone, CNG. This is an 1100 Hz + tone with cadence of 0.5 seconds ON and 3 seconds OFF as defined in ITU-T T.30. + Pass criteria: The TUT should not respond to this signal and may report it as being a calling fax + machine. + Comments: This is an optional test as detection of the fax calling tone is not required by + ITU-T V.18. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_32(void) +{ + /* + III.5.4.3.32 Immunity to voice + Purpose: To ensure that the TUT does not misinterpret speech as a valid textphone signal. + Preamble: N/A + Method: The tester will respond with sampled speech. A number of phrases recorded from + typical male and female speakers will be transmitted. This will include a typical + network announcement. + Pass criteria: The TUT should ignore the speech. + Comments: Ideally the TUT should report the presence of speech back to the user. This is an + optional test. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_ans_33(void) +{ + /* + III.5.4.3.33 CM detection and V.8 answering + Purpose: To confirm that the TUT will respond correctly to CM signals and connect + according to V.8 procedures. + Preamble: N/A + Method: The tester will transmit 2 sequences of 4 CI patterns separated by 2 seconds. On + reception of the ANSam tone the tester will wait 0.5 seconds and then begin + transmitting the CM signal with textphone and V.21 specified. + Pass criteria: 1) On reception of the CM signal, the TUT should transmit JM with textphone + and V.21. + 2) The TUT should then transmit in V.21 (2) mode. + 3) The JM should be followed by continuous 1650 Hz. + 4) Correct transmission and reception of T.140 data should be verified after the + V.18 mode connection is completed. + Comments: The TUT should indicate V.18 mode. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_mon_01(void) +{ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_mon_21(void) +{ + /* + III.5.4.4.1 Automode monitor Ta timer test + Purpose: To ensure that on entering monitor mode, timer Ta (3 seconds) is not active and that + the TUT does not enter the probing state. + Preamble: N/A + Method: The TUT should be put into monitor state. The tester will then monitor for signals + for 1 minute. + Pass criteria: The TUT should not start probing. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_mon_22(void) +{ + /* + III.5.4.4.2 Automode monitor 1300 Hz calling tone discrimination + Purpose: To confirm correct detection and reporting of 1300 Hz calling tones as defined in + ITU-T V.25. + Preamble: N/A + Method: The tester will send 1300 Hz bursts of (a) 400 ms, (b) 500 ms, (c) 700 ms and + (d) 800 ms followed by 1 second of silence. + Pass criteria: 1) The TUT should not respond to bursts of 400 or 800 ms. + 2) The TUT should report detection of calling tones to the DTE after a burst of + 1300 Hz for 500 or 700 ms followed by 1 second of silence. + Comments: In automode answer, the 1300 Hz calling causes the DCE to start probing. In + monitor mode it should only report detection to the DTE. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ + +static int test_mon_23(void) +{ + /* + III.5.4.4.3 Automode monitor 980 Hz calling tone discrimination + Purpose: To confirm correct detection and reporting of 980 Hz calling tones as defined in + ITU-T V.25. + Preamble: N/A + Method: The tester will send 980 Hz bursts of (a) 400 ms, (b) 500 ms, (c) 700 ms and + (d) 800 ms followed by 1 second of silence. + Pass criteria: 1) The TUT should not respond to bursts of 400 or 800 ms. + 2) The TUT should report detection of calling tones to the DTE after a burst of + 980 Hz for 500 or 700 ms followed by 1 second of silence. + Comments: In automode answer, the 980 Hz calling causes the DCE to start probing. In monitor + mode it should only report detection to the DTE. + */ + printf("Test not yet implemented\n"); + return 1; +} +/*- End of function --------------------------------------------------------*/ static int test_x_01(void) { - /* III.5.4.5.1 Baudot carrier timing and receiver disabling */ + /* + III.5.4.5.1 Baudot carrier timing and receiver disabling + Purpose: To verify that the TUT sends unmodulated carrier for 150 ms before a new character + and disables its receiver for 300 ms after a character is transmitted. + Preamble: Establish a call between the tester and TUT in Baudot mode. + Method: The operator should send a single character from the TUT. The tester will + immediately start sending a unique character sequence. Examination of the TUT + display will show when its receiver is re-enabled. + Pass criteria: 1) The TUT should send unmodulated carrier for 150 ms before the beginning of + the start bit. + 2) The receiver should be re-enabled after 300 ms. + 3) The tester will confirm that 1 start bit and at least 1.5 stop bits are used. + Comments: The carrier should be maintained during the 300 ms after a character. + */ printf("Test not yet implemented\n"); return 1; } @@ -165,7 +1513,15 @@ static int test_x_01(void) static int test_x_02(void) { - /* III.5.4.5.2 Baudot bit rate confirmation */ + /* + III.5.4.5.2 Baudot bit rate confirmation + Purpose: To verify that the TUT uses the correct bit rates in the Baudot mode. + Preamble: Establish a call between the tester and TUT in Baudot mode for each of the two + tests. + Method: The operator should select Baudot (a) 45 bit/s followed by (b) 50 bit/s modes and + transmit the string "abcdef" at each rate. + Pass criteria: The tester will measure the bit timings and confirm the rates. + */ printf("Test not yet implemented\n"); return 1; } @@ -173,7 +1529,18 @@ static int test_x_02(void) static int test_x_03(void) { - /* III.5.4.5.3 Baudot probe bit rate confirmation */ + /* + III.5.4.5.3 Baudot probe bit rate confirmation + Purpose: To verify that the TUT uses the correct bit rates in the Baudot mode probe during + automoding. + Preamble: Set the user defined carrierless mode probe message to the string "abcdef" if + possible. Set the TUT country setting to "United States". A call should be initiated + from the tester to the TUT. + Method: The tester will wait for the Baudot mode probe and measure the bit rate. + Pass criteria: The tester will measure the bit timings and confirm the rate of 47.6 bit/s. + Comments: The probe message must be long enough for the tester to establish the bit rate. "GA" + may not be sufficient. + */ printf("Test not yet implemented\n"); return 1; } @@ -188,9 +1555,31 @@ static int test_x_04(void) int yy; int i; v18_state_t *v18_state; + logging_state_t *logging; - /* III.5.4.5.4 5 Bit to T.50 character conversion */ + /* + III.5.4.5.4 5 Bit to T.50 character conversion + Purpose: To check that the character conversion tables in Annex A have been correctly + implemented. + Preamble: Establish a call between the tester and TUT in Baudot mode at 45 bit/s. + Method: The tester will send all possible characters preceded by the relevant case shift + command one at a time and wait for a response from the TUT operator. Each + character should be responded to at the TUT by typing the received character or + if the character is not available. + Pass criteria: 1) The tester will verify that each character is correctly echoed back by the TUT. + The operator should verify that each character is correctly displayed on the TUT. + 2) The TUT will send the LTRS symbol before its first character and the + appropriate mode character (either LTRS or FIGS) after every 72 subsequent + characters. + Comments: The tester should indicate which character has been sent in each case. Some of the + characters may not be available from the TUT keyboard and can be ignored. It is + assumed that the character conversion is the same for Baudot at 50 bit/s and any + other supported speed. + */ v18_state = v18_init(NULL, TRUE, V18_MODE_5BIT_45, NULL, NULL); + logging = v18_get_logging_state(v18_state); + span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); + span_log_set_tag(logging, ""); printf("Original:\n"); t = result; for (i = 0; i < 127; i++) @@ -222,6 +1611,24 @@ static int test_x_04(void) } /*- End of function --------------------------------------------------------*/ +static int test_x_05(void) +{ + /* + III.5.4.5.5 DTMF receiver disabling + Purpose: To verify that the TUT disables its DTMF receiver for 300 ms when a character is + transmitted. + Preamble: Establish a call between the tester and TUT in DTMF mode. + Method: The operator should send a single "e" character from the TUT which will result in + sending a single DTMF tone to the tester. The tester will immediately start sending a + unique character sequence using single DTMF tones. Examination of the TUT + display will show when its receiver is re-enabled. + Pass criteria: The receiver should be re-enabled after 300 ms. + */ + printf("Test not yet implemented\n"); + return 0; +} +/*- End of function --------------------------------------------------------*/ + static int test_x_06(void) { char msg[128]; @@ -230,7 +1637,20 @@ static int test_x_06(void) const char *ref; int i; - /* III.5.4.5.6 DTMF character conversion */ + /* + III.5.4.5.6 DTMF character conversion + Purpose: To check that the character conversion tables in Annex B have been correctly + implemented. + Preamble: Establish a call between the tester and TUT in DTMF mode. + Method: The tester will send each character from the set in Annex B, waiting for a response + after each one. Each character should be responded to at the TUT by typing the + same character. + Pass criteria: The tester will verify that each character is correctly echoed back by the TUT. + Comments: The conversion table is specified in Annex B. The receiver at the tester may be re- + enabled 100 ms after transmission of each character to maximize likelihood of + receiving character from the TUT. It is assumed that the echo delay in the test + system is negligible. + */ for (i = 0; i < 127; i++) msg[i] = i + 1; msg[127] = '\0'; @@ -253,10 +1673,124 @@ static int test_x_06(void) } /*- End of function --------------------------------------------------------*/ -static int test_unimplemented(void) +static int test_x_07(void) { + /* + III.5.4.5.7 EDT carrier timing and receiver disabling + Purpose: To verify that the TUT sends unmodulated carrier for 300 ms before a character and + disables its receiver for 300 ms after a character is transmitted. + Preamble: Establish a call between the tester and TUT in EDT mode. + Method: The operator should send a single character from the TUT. The tester will + immediately start sending a unique character sequence. Examination of the TUT + display will show when its receiver is re-enabled. + Pass criteria: 1) The TUT should send unmodulated carrier for 300 ms before the beginning of + the start bit. + 2) The receiver should be re-enabled after 300 ms. + 3) The tester will confirm that 1 start bit and at least 1.5 stop bits are used. + Comments: The carrier should be maintained during the 300 ms after a character. + */ printf("Test not yet implemented\n"); - return 1; + return 0; +} +/*- End of function --------------------------------------------------------*/ + +static int test_x_08(void) +{ + /* + III.5.4.5.8 EDT bit rate and character structure + Purpose: To verify that the TUT uses the correct bit rate and character structure in the EDT + mode. + Preamble: Establish a call between the tester and TUT in EDT mode. + Method: The operator should transmit the string "abcdef" from the TUT. + Pass criteria: 1) The tester should measure the bit timings and confirm that the rate is 110 bit/s. + 2) The tester should confirm that 1 start bit, 7 data bits, 1 even parity bit and 2 stop + bits are used. + */ + printf("Test not yet implemented\n"); + return 0; +} +/*- End of function --------------------------------------------------------*/ + +static int test_x_09(void) +{ + /* + III.5.4.5.9 V.23 calling mode character format + Purpose: To verify that the TUT uses the correct character format in the V.23 calling mode. + Preamble: Establish a call from the TUT to the tester in V.23 mode. + Method: The operator should transmit the string "abcdef" from the TUT. The tester will echo + characters back to the TUT as they are received. The tester will then transmit the + string "abcdef" with ODD parity to the TUT. + Pass criteria: 1) Confirm that 1 start bit, 7 data bits, 1 even parity bit and 2 stop bits are + transmitted. + 2) The operator should confirm that there is no local echo at the TUT by checking + that there are no duplicate characters on the TUT display. + 3) The received string should be correctly displayed despite the incorrect parity. + */ + printf("Test not yet implemented\n"); + return 0; +} +/*- End of function --------------------------------------------------------*/ + +static int test_x_10(void) +{ + /* + III.5.4.5.10 V.23 answer mode character format + Purpose: To verify that the TUT uses the correct character format in the V.23 answer mode. + Preamble: Establish a call from the tester to the TUT in V.23 mode. + Method: The tester will transmit the string "abcdef" with ODD parity. The TUT should echo + characters back to the tester as they are received. The operator should then transmit + the string "abcdef" from the TUT. + Pass criteria: 1) The received string should be correctly displayed at the TUT despite the + incorrect parity. + 2) Confirm that 1 start bit, 7 data bits, 1 even parity bit and 2 stop bits are + transmitted by the TUT. + 3) The tester should confirm that there is remote echo from TUT. + 4) The operator should confirm that there is local echo on the TUT. + Comments: + */ + printf("Test not yet implemented\n"); + return 0; +} +/*- End of function --------------------------------------------------------*/ + +static int test_x_11(void) +{ + /* + III.5.4.5.11 This test is only applicable to Minitel Dialogue terminals. Prestel and Minitel + Normal terminals cannot operate in this mode. + V.21 character structure + Purpose: To verify that the TUT uses the character structure in the V.21 mode. + Preamble: Establish a call from the TUT to the tester in V.21 mode. + Method: The operator should transmit a string from the TUT that is long enough to cause the + display to word wrap followed by "abcdef", new line (CR+LF). The tester will then + transmit the string "123456", BACKSPACE (0/8) with ODD parity to the TUT. + Pass criteria: 1) The tester should confirm that 1 start bit, 7 data bits, 1 even parity bit and 1 stop + bits are transmitted. + 2) The word wrap should not result in CR+LF. + 3) The forced new line should be indicated by CR+LF. + 4) The last five characters on the TUT display should be "12345" (no "6") + correctly displayed despite the incorrect parity. + */ + printf("Test not yet implemented\n"); + return 0; +} +/*- End of function --------------------------------------------------------*/ + +static int test_x_12(void) +{ + /* + III.5.4.5.12 V.18 mode + Purpose: To verify that the TUT uses the protocol defined in ITU-T T.140. + Preamble: Establish a call from the TUT to the tester in V.18 mode. + Method: The operator should transmit a string from the TUT that is long enough to cause the + display to word wrap followed by "abcdef", new line (CR+LF), new line + (UNICODE preferred). The tester will then transmit the string "123456", + BACKSPACE. + Pass criteria: The tester should confirm UTF8 encoded UNICODE characters are used with the + controls specified in ITU-T T.140. + */ + printf("Test not yet implemented\n"); + return 0; } /*- End of function --------------------------------------------------------*/ @@ -272,10 +1806,11 @@ static void put_v18_msg(void *user_data, const uint8_t *msg, int len) static int decode_test_data_file(int mode, const char *filename) { - v18_state_t *v18_state; int16_t amp[SAMPLES_PER_CHUNK]; SNDFILE *inhandle; int len; + v18_state_t *v18_state; + logging_state_t *logging; printf("Decoding as '%s'\n", v18_mode_to_str(mode)); /* We will decode the audio from a file. */ @@ -285,10 +1820,12 @@ static int decode_test_data_file(int mode, const char *filename) exit(2); } v18_state = v18_init(NULL, FALSE, mode, put_v18_msg, NULL); + logging = v18_get_logging_state(v18_state); + span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); + span_log_set_tag(logging, ""); for (;;) { - len = sf_readf_short(inhandle, amp, SAMPLES_PER_CHUNK); - if (len == 0) + if ((len = sf_readf_short(inhandle, amp, SAMPLES_PER_CHUNK)) <= 0) break; v18_rx(v18_state, amp, len); } @@ -309,97 +1846,97 @@ const struct } test_list[] = { {"III.3.2.1 Operational requirements tests", NULL}, - {"MISC-01 4 (1) No Disconnection Test", test_unimplemented}, - {"MISC-02 4 (2) Automatic resumption of automoding", test_unimplemented}, - {"MISC-03 4 (2) Retention of selected mode on loss of signal", test_unimplemented}, - {"MISC-04 4 (4) Detection of BUSY tone", test_unimplemented}, - {"MISC-05 4 (4) Detection of RINGING", test_unimplemented}, - {"MISC-06 4 (4) LOSS OF CARRIER indication", test_unimplemented}, - {"MISC-07 4 (4) Call progress indication", test_unimplemented}, - {"MISC-08 4 (5) Circuit 135 test", test_unimplemented}, - {"MISC-09 Connection Procedures", test_unimplemented}, + {"MISC-01 4 (1) No Disconnection Test", test_misc_01}, + {"MISC-02 4 (2) Automatic resumption of automoding", test_misc_02}, + {"MISC-03 4 (2) Retention of selected mode on loss of signal", test_misc_03}, + {"MISC-04 4 (4) Detection of BUSY tone", test_misc_04}, + {"MISC-05 4 (4) Detection of RINGING", test_misc_05}, + {"MISC-06 4 (4) LOSS OF CARRIER indication", test_misc_06}, + {"MISC-07 4 (4) Call progress indication", test_misc_07}, + {"MISC-08 4 (5) Circuit 135 test", test_misc_08}, + {"MISC-09 4 (6) Connection Procedures", test_misc_09}, {"III.3.2.2 Automode originate tests", NULL}, - {"ORG-01 5.1.1 CI & XCI Signal coding and cadence", test_unimplemented}, - {"ORG-02 5.1.3 ANS Signal Detection", test_unimplemented}, - {"ORG-03 5.2.3.1 End of ANS signal detection", test_unimplemented}, - {"ORG-04 5.1.3.2 ANS tone followed by TXP", test_unimplemented}, - {"ORG-05 5.1.3.3 ANS tone followed by 1650Hz", test_unimplemented}, - {"ORG-06 5.1.3.4 ANS tone followed by 1300Hz", test_unimplemented}, - {"ORG-07 5.1.3 ANS tone followed by no tone", test_unimplemented}, - {"ORG-08 5.1.4 Bell 103 (2225Hz Signal) Detection", test_unimplemented}, - {"ORG-09 5.1.5 V.21 (1650Hz Signal) Detection", test_unimplemented}, - {"ORG-10 5.1.6 V.23 (1300Hz Signal) Detection", test_unimplemented}, - {"ORG-11 5.1.7 V.23 (390Hz Signal) Detection", test_unimplemented}, - {"ORG-12a to d 5.1.8 5 Bit Mode (Baudot) Detection Tests", test_unimplemented}, - {"ORG-13 5.1.9 DTMF signal detection", test_unimplemented}, - {"ORG-14 5.1.10 EDT Rate Detection", test_unimplemented}, - {"ORG-15 5.1.10.1 Rate Detection Test", test_unimplemented}, - {"ORG-16 5.1.10.2 980Hz Detection", test_unimplemented}, - {"ORG-17 5.1.10.3 Loss of signal after 980Hz", test_unimplemented}, - {"ORG-18 5.1.10.3 Tr Timer", test_unimplemented}, - {"ORG-19 5.1.11 Bell 103 (1270Hz Signal) Detection", test_unimplemented}, - {"ORG-20 Immunity to Network Tones", test_unimplemented}, - {"ORG-21a to b Immunity to other non-textphone modems", test_unimplemented}, - {"ORG-22 Immunity to Fax Tones", test_unimplemented}, - {"ORG-23 Immunity to Voice", test_unimplemented}, - {"ORG-24 5.1.2 ANSam detection", test_unimplemented}, - {"ORG-25 6.1 V.8 originate call", test_unimplemented}, + {"ORG-01 5.1.1 CI & XCI Signal coding and cadence", test_org_01}, + {"ORG-02 5.1.3 ANS Signal Detection", test_org_02}, + {"ORG-03 5.2.3.1 End of ANS signal detection", test_org_03}, + {"ORG-04 5.1.3.2 ANS tone followed by TXP", test_org_04}, + {"ORG-05 5.1.3.3 ANS tone followed by 1650Hz", test_org_05}, + {"ORG-06 5.1.3.4 ANS tone followed by 1300Hz", test_org_06}, + {"ORG-07 5.1.3 ANS tone followed by no tone", test_org_07}, + {"ORG-08 5.1.4 Bell 103 (2225Hz Signal) Detection", test_org_08}, + {"ORG-09 5.1.5 V.21 (1650Hz Signal) Detection", test_org_09}, + {"ORG-10 5.1.6 V.23 (1300Hz Signal) Detection", test_org_10}, + {"ORG-11 5.1.7 V.23 (390Hz Signal) Detection", test_org_11}, + {"ORG-12a to d 5.1.8 5 Bit Mode (Baudot) Detection Tests", test_org_12}, + {"ORG-13 5.1.9 DTMF signal detection", test_org_13}, + {"ORG-14 5.1.10 EDT Rate Detection", test_org_14}, + {"ORG-15 5.1.10.1 Rate Detection Test", test_org_15}, + {"ORG-16 5.1.10.2 980Hz Detection", test_org_16}, + {"ORG-17 5.1.10.3 Loss of signal after 980Hz", test_org_17}, + {"ORG-18 5.1.10.3 Tr Timer", test_org_18}, + {"ORG-19 5.1.11 Bell 103 (1270Hz Signal) Detection", test_org_19}, + {"ORG-20 Immunity to Network Tones", test_org_20}, + {"ORG-21a to b Immunity to other non-textphone modems", test_org_21}, + {"ORG-22 Immunity to Fax Tones", test_org_22}, + {"ORG-23 Immunity to Voice", test_org_23}, + {"ORG-24 5.1.2 ANSam detection", test_org_24}, + {"ORG-25 6.1 V.8 originate call", test_org_25}, {"III.3.2.3 Automode answer tests", NULL}, - {"ANS-01 5.2.1 Ta timer", test_unimplemented}, - {"ANS-02 5.2.2 CI Signal Detection", test_unimplemented}, - {"ANS-03 5.2.2.1 Early Termination of ANS tone", test_unimplemented}, - {"ANS-04 5.2.2.2 Tt Timer", test_unimplemented}, - {"ANS-05 5.2.3.2 ANS tone followed by 980Hz", test_unimplemented}, - {"ANS-06 5.2.3.2 ANS tone followed by 1300Hz", test_unimplemented}, - {"ANS-07 5.2.3.3 ANS tone followed by 1650Hz", test_unimplemented}, - {"ANS-08 5.2.4.1 980Hz followed by 1650Hz", test_unimplemented}, - {"ANS-09a to d 5.2.4.2 980Hz calling tone detection", test_unimplemented}, - {"ANS-10 5.2.4.3 V.21 Detection by Timer", test_unimplemented}, - {"ANS-11 5.2.4.4.1 EDT Detection by Rate", test_unimplemented}, - {"ANS-12 5.2.4.4.2 V.21 Detection by Rate", test_unimplemented}, - {"ANS-13 5.2.4.4.3 Tr Timer", test_unimplemented}, - {"ANS-14 5.2.4.5 Te Timer", test_unimplemented}, - {"ANS-15a to d 5.2.5 5 Bit Mode (Baudot) Detection Tests", test_unimplemented}, - {"ANS-16 5.2.6 DTMF Signal Detection", test_unimplemented}, - {"ANS-17 5.2.7 Bell 103 (1270Hz signal) detection", test_unimplemented}, - {"ANS-18 5.2.8 Bell 103 (2225Hz signal) detection", test_unimplemented}, - {"ANS-19 5.2.9 V.21 Reverse Mode (1650Hz) Detection", test_unimplemented}, - {"ANS-20a to d 5.2.10 1300Hz Calling Tone Discrimination", test_unimplemented}, - {"ANS-21 5.2.11 V.23 Reverse Mode (1300Hz) Detection", test_unimplemented}, - {"ANS-22 1300Hz with XCI Test", test_unimplemented}, - {"ANS-23 5.2.12 Stimulate Mode Country Settings", test_unimplemented}, - {"ANS-24 5.2.12.1 Stimulate Carrierless Mode Probe Message", test_unimplemented}, - {"ANS-25 5.2.12.1.1 Interrupted Carrierless Mode Probe", test_unimplemented}, - {"ANS-26 5.2.12.2 Stimulate Carrier Mode Probe Time", test_unimplemented}, - {"ANS-27 5.2.12.2.1 V.23 Mode (390Hz) Detection", test_unimplemented}, - {"ANS-28 5.2.12.2.2 Interrupted Carrier Mode Probe", test_unimplemented}, - {"ANS-29 5.2.12.2.2 Stimulate Mode Response During Probe", test_unimplemented}, - {"ANS-30 Immunity to Network Tones", test_unimplemented}, - {"ANS-31 Immunity to Fax Calling Tones", test_unimplemented}, - {"ANS-32 Immunity to Voice", test_unimplemented}, - {"ANS-33 5.2.2.1 V.8 CM detection and V.8 Answering", test_unimplemented}, + {"ANS-01 5.2.1 Ta timer", test_ans_01}, + {"ANS-02 5.2.2 CI Signal Detection", test_ans_02}, + {"ANS-03 5.2.2.1 Early Termination of ANS tone", test_ans_03}, + {"ANS-04 5.2.2.2 Tt Timer", test_ans_04}, + {"ANS-05 5.2.3.2 ANS tone followed by 980Hz", test_ans_05}, + {"ANS-06 5.2.3.2 ANS tone followed by 1300Hz", test_ans_06}, + {"ANS-07 5.2.3.3 ANS tone followed by 1650Hz", test_ans_07}, + {"ANS-08 5.2.4.1 980Hz followed by 1650Hz", test_ans_08}, + {"ANS-09a to d 5.2.4.2 980Hz calling tone detection", test_ans_09}, + {"ANS-10 5.2.4.3 V.21 Detection by Timer", test_ans_10}, + {"ANS-11 5.2.4.4.1 EDT Detection by Rate", test_ans_11}, + {"ANS-12 5.2.4.4.2 V.21 Detection by Rate", test_ans_12}, + {"ANS-13 5.2.4.4.3 Tr Timer", test_ans_13}, + {"ANS-14 5.2.4.5 Te Timer", test_ans_14}, + {"ANS-15a to d 5.2.5 5 Bit Mode (Baudot) Detection Tests", test_ans_15}, + {"ANS-16 5.2.6 DTMF Signal Detection", test_ans_16}, + {"ANS-17 5.2.7 Bell 103 (1270Hz signal) detection", test_ans_17}, + {"ANS-18 5.2.8 Bell 103 (2225Hz signal) detection", test_ans_18}, + {"ANS-19 5.2.9 V.21 Reverse Mode (1650Hz) Detection", test_ans_19}, + {"ANS-20a to d 5.2.10 1300Hz Calling Tone Discrimination", test_ans_20}, + {"ANS-21 5.2.11 V.23 Reverse Mode (1300Hz) Detection", test_ans_21}, + {"ANS-22 1300Hz with XCI Test", test_ans_22}, + {"ANS-23 5.2.12 Stimulate Mode Country Settings", test_ans_23}, + {"ANS-24 5.2.12.1 Stimulate Carrierless Mode Probe Message", test_ans_24}, + {"ANS-25 5.2.12.1.1 Interrupted Carrierless Mode Probe", test_ans_25}, + {"ANS-26 5.2.12.2 Stimulate Carrier Mode Probe Time", test_ans_26}, + {"ANS-27 5.2.12.2.1 V.23 Mode (390Hz) Detection", test_ans_27}, + {"ANS-28 5.2.12.2.2 Interrupted Carrier Mode Probe", test_ans_28}, + {"ANS-29 5.2.12.2.2 Stimulate Mode Response During Probe", test_ans_29}, + {"ANS-30 Immunity to Network Tones", test_ans_30}, + {"ANS-31 Immunity to Fax Calling Tones", test_ans_31}, + {"ANS-32 Immunity to Voice", test_ans_32}, + {"ANS-33 5.2.2.1 V.8 CM detection and V.8 Answering", test_ans_33}, {"III.3.2.4 Automode monitor tests", NULL}, - {"MON-01 to -20 5.3 Repeat all answer mode tests excluding tests ANS-01, ANS-20 and ANS-23 to ANS-29", test_unimplemented}, - {"MON-21 5.3 Automode Monitor Ta timer", test_unimplemented}, - {"MON-22a to d 5.3 Automode Monitor 1300Hz Calling Tone Discrimination", test_unimplemented}, - {"MON-23a to d 5.3 Automode Monitor 980Hz Calling Tone Discrimination", test_unimplemented}, + {"MON-01 to -20 5.3 Repeat all answer mode tests excluding tests ANS-01, ANS-20 and ANS-23 to ANS-29", test_mon_01}, + {"MON-21 5.3 Automode Monitor Ta timer", test_mon_21}, + {"MON-22a to d 5.3 Automode Monitor 1300Hz Calling Tone Discrimination", test_mon_22}, + {"MON-23a to d 5.3 Automode Monitor 980Hz Calling Tone Discrimination", test_mon_23}, {"III.3.2.5 ITU-T V.18 annexes tests", NULL}, {"X-01 A.1 Baudot carrier timing and receiver disabling", test_x_01}, {"X-02 A.2 Baudot bit rate confirmation", test_x_02}, {"X-03 A.3 Baudot probe bit rate confirmation", test_x_03}, {"X-04 A.4 5 Bit to T.50 Character Conversion", test_x_04}, - {"X-05 B.1 DTMF receiver disabling", test_unimplemented}, + {"X-05 B.1 DTMF receiver disabling", test_x_05}, {"X-06 B.2 DTMF character conversion", test_x_06}, - {"X-07 C.1 EDT carrier timing and receiver disabling", test_unimplemented}, - {"X-08 C.2-3 EDT bit rate and character structure", test_unimplemented}, - {"X-09 E V.23 calling mode character format", test_unimplemented}, - {"X-10 E V.23 answer mode character format", test_unimplemented}, - {"X-11 F.4-5 V.21 character structure", test_unimplemented}, - {"X-12 G.1-3 V.18 mode", test_unimplemented}, + {"X-07 C.1 EDT carrier timing and receiver disabling", test_x_07}, + {"X-08 C.2-3 EDT bit rate and character structure", test_x_08}, + {"X-09 E V.23 calling mode character format", test_x_09}, + {"X-10 E V.23 answer mode character format", test_x_10}, + {"X-11 F.4-5 V.21 character structure", test_x_11}, + {"X-12 G.1-3 V.18 mode", test_x_12}, {"", NULL} }; @@ -490,6 +2027,7 @@ int main(int argc, char *argv[]) exit(2); } basic_tests(V18_MODE_5BIT_45); + basic_tests(V18_MODE_5BIT_45 | 0x100); if (log_audio) { if (sf_close_telephony(outhandle)) diff --git a/libs/spandsp/tests/v22bis_tests.c b/libs/spandsp/tests/v22bis_tests.c index f7d7ef7703..f070dd709c 100644 --- a/libs/spandsp/tests/v22bis_tests.c +++ b/libs/spandsp/tests/v22bis_tests.c @@ -228,11 +228,13 @@ static void qam_report(void *user_data, const complexf_t *constel, const complex #endif #if defined(ENABLE_GUI) if (use_gui) + { #if defined(SPANDSP_USE_FIXED_POINTx) qam_monitor_update_int_equalizer(s->qam_monitor, coeffs, len); #else qam_monitor_update_equalizer(s->qam_monitor, coeffs, len); #endif + } #endif } } diff --git a/libs/spandsp/tests/v27ter_tests.c b/libs/spandsp/tests/v27ter_tests.c index cd05b13738..ca0e710ae3 100644 --- a/libs/spandsp/tests/v27ter_tests.c +++ b/libs/spandsp/tests/v27ter_tests.c @@ -260,11 +260,13 @@ static void qam_report(void *user_data, const complexf_t *constel, const complex #endif #if defined(ENABLE_GUI) if (use_gui) + { #if defined(SPANDSP_USE_FIXED_POINTx) qam_monitor_update_int_equalizer(qam_monitor, coeffs, len); #else qam_monitor_update_equalizer(qam_monitor, coeffs, len); #endif + } #endif } } diff --git a/libs/spandsp/tests/v29_tests.c b/libs/spandsp/tests/v29_tests.c index 4b3b3858dc..dd1ac1bae5 100644 --- a/libs/spandsp/tests/v29_tests.c +++ b/libs/spandsp/tests/v29_tests.c @@ -244,11 +244,13 @@ static void qam_report(void *user_data, const complexf_t *constel, const complex #endif #if defined(ENABLE_GUI) if (use_gui) + { #if defined(SPANDSP_USE_FIXED_POINT) qam_monitor_update_int_equalizer(qam_monitor, coeffs, len); #else qam_monitor_update_equalizer(qam_monitor, coeffs, len); #endif + } #endif update_interval = 100; } diff --git a/libs/spandsp/tests/v8_tests.c b/libs/spandsp/tests/v8_tests.c index 4c48143099..ae59817232 100644 --- a/libs/spandsp/tests/v8_tests.c +++ b/libs/spandsp/tests/v8_tests.c @@ -206,6 +206,8 @@ static int v8_calls_v8_tests(SNDFILE *outhandle) negotiations_ok = 0; v8_call_parms.modem_connect_tone = MODEM_CONNECT_TONES_NONE; + v8_call_parms.send_ci = TRUE; + v8_call_parms.v92 = -1; v8_call_parms.call_function = V8_CALL_V_SERIES; v8_call_parms.modulations = caller_available_modulations; v8_call_parms.protocol = V8_PROTOCOL_LAPM_V42; @@ -219,6 +221,8 @@ static int v8_calls_v8_tests(SNDFILE *outhandle) handler, (void *) "caller"); v8_answer_parms.modem_connect_tone = MODEM_CONNECT_TONES_ANSAM_PR; + v8_answer_parms.send_ci = TRUE; + v8_answer_parms.v92 = -1; v8_answer_parms.call_function = V8_CALL_V_SERIES; v8_answer_parms.modulations = answerer_available_modulations; v8_answer_parms.protocol = V8_PROTOCOL_LAPM_V42; @@ -329,6 +333,8 @@ static int non_v8_calls_v8_tests(SNDFILE *outhandle) non_v8_caller_rx = modem_connect_tones_rx_init(NULL, MODEM_CONNECT_TONES_ANS_PR, NULL, NULL); v8_answer_parms.modem_connect_tone = MODEM_CONNECT_TONES_ANSAM_PR; + v8_answer_parms.send_ci = TRUE; + v8_answer_parms.v92 = -1; v8_answer_parms.call_function = V8_CALL_V_SERIES; v8_answer_parms.modulations = answerer_available_modulations; v8_answer_parms.protocol = V8_PROTOCOL_LAPM_V42; @@ -439,6 +445,8 @@ static int v8_calls_non_v8_tests(SNDFILE *outhandle) negotiations_ok = 0; v8_call_parms.modem_connect_tone = MODEM_CONNECT_TONES_NONE; + v8_call_parms.send_ci = TRUE; + v8_call_parms.v92 = -1; v8_call_parms.call_function = V8_CALL_V_SERIES; v8_call_parms.modulations = caller_available_modulations; v8_call_parms.protocol = V8_PROTOCOL_LAPM_V42; @@ -578,6 +586,8 @@ int main(int argc, char *argv[]) printf("Decode file '%s'\n", decode_test_file); v8_call_parms.modem_connect_tone = MODEM_CONNECT_TONES_NONE; + v8_call_parms.send_ci = TRUE; + v8_call_parms.v92 = -1; v8_call_parms.call_function = V8_CALL_V_SERIES; v8_call_parms.modulations = caller_available_modulations; v8_call_parms.protocol = V8_PROTOCOL_LAPM_V42; @@ -595,6 +605,8 @@ int main(int argc, char *argv[]) span_log_set_tag(logging, "caller"); v8_answer_parms.modem_connect_tone = MODEM_CONNECT_TONES_ANSAM_PR; + v8_answer_parms.send_ci = TRUE; + v8_answer_parms.v92 = -1; v8_answer_parms.call_function = V8_CALL_V_SERIES; v8_answer_parms.modulations = answerer_available_modulations; v8_answer_parms.protocol = V8_PROTOCOL_LAPM_V42;