mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-29 14:44:17 +00:00
update to snapshot spandsp-20090427
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13177 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
9355013017
commit
a802976818
60 files changed
+4937
-786
No files matched your search
@@ -22,7 +22,7 @@
|
||||
* License along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Id: async.c,v 1.18 2009/02/10 13:06:46 steveu Exp $
|
||||
* $Id: async.c,v 1.19 2009/04/23 14:12:34 steveu Exp $
|
||||
*/
|
||||
|
||||
/*! \file */
|
||||
@@ -67,6 +67,10 @@ SPAN_DECLARE(const char *) signal_status_to_str(int status)
|
||||
return "Shutdown complete";
|
||||
case SIG_STATUS_OCTET_REPORT:
|
||||
return "Octet report";
|
||||
case SIG_STATUS_POOR_SIGNAL_QUALITY:
|
||||
return "Poor signal quality";
|
||||
case SIG_STATUS_MODEM_RETRAIN_OCCURRED:
|
||||
return "Modem retrain occurred";
|
||||
}
|
||||
return "???";
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
* License along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Id: at_interpreter.c,v 1.37 2009/03/23 14:17:42 steveu Exp $
|
||||
* $Id: at_interpreter.c,v 1.39 2009/04/24 22:35:25 steveu Exp $
|
||||
*/
|
||||
|
||||
/*! \file */
|
||||
@@ -519,6 +519,64 @@ static int parse_2_out(at_state_t *s, const char **t, int *target1, int max_valu
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
static int parse_n_out(at_state_t *s,
|
||||
const char **t,
|
||||
int *targets[],
|
||||
const int max_values[],
|
||||
int entries,
|
||||
const char *prefix,
|
||||
const char *def)
|
||||
{
|
||||
char buf[100];
|
||||
int val;
|
||||
int len;
|
||||
int i;
|
||||
|
||||
switch (*(*t)++)
|
||||
{
|
||||
case '=':
|
||||
switch (**t)
|
||||
{
|
||||
case '?':
|
||||
/* Show possible values */
|
||||
(*t)++;
|
||||
snprintf(buf, sizeof(buf), "%s%s", (prefix) ? prefix : "", def);
|
||||
at_put_response(s, buf);
|
||||
break;
|
||||
default:
|
||||
/* Set value */
|
||||
for (i = 0; i < entries; i++)
|
||||
{
|
||||
if ((val = parse_num(t, max_values[i])) < 0)
|
||||
return FALSE;
|
||||
if (targets[i])
|
||||
*targets[i] = val;
|
||||
if (**t != ',')
|
||||
break;
|
||||
(*t)++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case '?':
|
||||
/* Show current value */
|
||||
len = snprintf(buf, sizeof(buf), "%s", (prefix) ? prefix : "");
|
||||
for (i = 0; i < entries; i++)
|
||||
{
|
||||
if (i > 0)
|
||||
len += snprintf(&buf[len], sizeof(buf) - len, ",");
|
||||
val = (targets[i]) ? *targets[i] : 0;
|
||||
len += snprintf(&buf[len], sizeof(buf) - len, "%d", val);
|
||||
}
|
||||
at_put_response(s, buf);
|
||||
break;
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
static int parse_hex_out(at_state_t *s, const char **t, int *target, int max_value, const char *prefix, const char *def)
|
||||
{
|
||||
char buf[100];
|
||||
@@ -3191,9 +3249,76 @@ static const char *at_cmd_plus_ER(at_state_t *s, const char *t)
|
||||
|
||||
static const char *at_cmd_plus_ES(at_state_t *s, const char *t)
|
||||
{
|
||||
static const int maxes[3] =
|
||||
{
|
||||
7, 4, 9
|
||||
};
|
||||
int *locations[3];
|
||||
|
||||
/* V.250 6.5.1 - Error control selection */
|
||||
|
||||
/* orig_rqst
|
||||
0: Direct mode
|
||||
1: Initiate call with Buffered mode only
|
||||
2: Initiate V.42 without Detection Phase. If Rec. V.8 is in use, this is a request to disable V.42 Detection Phase
|
||||
3: Initiate V.42 with Detection Phase
|
||||
4: Initiate Altemative Protocol
|
||||
5: Initiate Synchronous Mode when connection is completed, immediately after the entire CONNECT result code
|
||||
is delivered. V.24 circuits 113 and 115 are activated when Data State is entered
|
||||
6: Initiate Synchronous Access Mode when connection is completed, and Data State is entered
|
||||
7: Initiate Frame Tunnelling Mode when connection is completed, and Data State is entered
|
||||
|
||||
orig_fbk
|
||||
0: Error control optional (either LAPM or Alternative acceptable); if error control not established, maintain
|
||||
DTE-DCE data rate and use V.14 buffered mode with flow control during non-error-control operation
|
||||
1: Error control optional (either LAPM or Alternative acceptable); if error control not established, change
|
||||
DTE-DCE data rate to match line rate and use Direct mode
|
||||
2: Error control required (either LAPM or Alternative acceptable); if error control not established, disconnect
|
||||
3: Error control required (only LAPM acceptable); if error control not established, disconnect
|
||||
4: Error control required (only Altemative protocol acceptable); if error control not established, disconnect
|
||||
|
||||
ans_fbk
|
||||
0: Direct mode
|
||||
1: Error control disabled, use Buffered mode
|
||||
2: Error control optional (either LAPM or Alternative acceptable); if error control not established, maintain
|
||||
DTE-DCE data rate and use local buffering and flow control during non-error-control operation
|
||||
3: Error control optional (either LAPM or Alternative acceptable); if error control not established, change
|
||||
DTE-DCE data rate to match line rate and use Direct mode
|
||||
4: Error control required (either LAPM or Alternative acceptable); if error control not established, disconnect
|
||||
5: Error control required (only LAPM acceptable); if error control not established, disconnect
|
||||
6: Error control required (only Alternative protocol acceptable); if error control not established, disconnect
|
||||
7: Initiate Synchronous Mode when connection is completed, immediately after the entire CONNECT result code
|
||||
is delivered. V.24 cicuits 113 and 115 are activated when Data State is entered
|
||||
8: Initiate Synchronous Access Mode when connection is completed, and Data State is entered
|
||||
9: Initiate Frame Tunnelling Mode when connection is completed, and Data State is entered */
|
||||
|
||||
/* TODO: */
|
||||
t += 3;
|
||||
locations[0] = NULL;
|
||||
locations[1] = NULL;
|
||||
locations[2] = NULL;
|
||||
if (!parse_n_out(s, &t, locations, maxes, 3, "+ES:", "(0-7),(0-4),(0-9)"))
|
||||
return NULL;
|
||||
return t;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
static const char *at_cmd_plus_ESA(at_state_t *s, const char *t)
|
||||
{
|
||||
static const int maxes[8] =
|
||||
{
|
||||
2, 1, 1, 1, 2, 1, 255, 255
|
||||
};
|
||||
int *locations[8];
|
||||
int i;
|
||||
|
||||
/* V.80 8.2 - Synchronous access mode configuration */
|
||||
/* TODO: */
|
||||
t += 4;
|
||||
for (i = 0; i < 8; i++)
|
||||
locations[i] = NULL;
|
||||
if (!parse_n_out(s, &t, locations, maxes, 8, "+ESA:", "(0-2),(0-1),(0-1),(0-1),(0-2),(0-1),(0-255),(0-255)"))
|
||||
return NULL;
|
||||
return t;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
@@ -3800,18 +3925,66 @@ static const char *at_cmd_plus_GSN(at_state_t *s, const char *t)
|
||||
|
||||
static const char *at_cmd_plus_IBC(at_state_t *s, const char *t)
|
||||
{
|
||||
/* TIA-617 8.3 - Control of in-band control */
|
||||
static const int maxes[13] =
|
||||
{
|
||||
2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
|
||||
};
|
||||
int *locations[13];
|
||||
int i;
|
||||
|
||||
/* V.80 7.9 - Control of in-band control */
|
||||
/* TODO: */
|
||||
t += 4;
|
||||
/* 0: In-band control service disabled
|
||||
1: In-band control service enabled, 7-bit codes allowed, and top bit insignificant
|
||||
2; In-band control service enabled, 7-bit codes allowed, and 8-bit codes available
|
||||
|
||||
Circuits 105, 106, 107, 108, 109, 110, 125, 132, 133, 135, 142 in that order. For each one:
|
||||
0: disabled
|
||||
1: enabled
|
||||
|
||||
DCE line connect status reports:
|
||||
0: disabled
|
||||
1: enabled */
|
||||
for (i = 0; i < 13; i++)
|
||||
locations[i] = NULL;
|
||||
if (!parse_n_out(s, &t, locations, maxes, 13, "+IBC:", "(0-2),(0,1),(0,1),(0,1),(0,1),(0,1),(0,1),(0,1),(0,1),(0,1),(0,1),(0.1),(0,1)"))
|
||||
return NULL;
|
||||
return t;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
static const char *at_cmd_plus_IBM(at_state_t *s, const char *t)
|
||||
{
|
||||
/* TIA-617 8.4 - In-Band MARK idle reporting control */
|
||||
static const int maxes[3] =
|
||||
{
|
||||
7, 255, 255
|
||||
};
|
||||
int *locations[3];
|
||||
|
||||
/* V.80 7.10 - In-band MARK idle reporting control */
|
||||
/* TODO: */
|
||||
t += 4;
|
||||
/* Report control
|
||||
0: No reports
|
||||
1: Report only once when <T1 > expires
|
||||
2: Report each time <T2> expires
|
||||
3: Report once when <T1> expires, and then each time <T2> expires
|
||||
4: Report only when the Mark-ldle Period ends; T3 = the entire interval
|
||||
5: Report the first time when <T1> is exceeded, and then once more when the mark idle period ends
|
||||
6: Report each time when <T2> is exceeded, and then once more when the mark idle period ends;
|
||||
T3 = entire interval -- N*T2
|
||||
7: report the first time when <T1> is exceeded, and then each time <T2> is exceeded, and then once
|
||||
more when the mark idle period ends; T3 = entire mark idle period -- N*T2 - T1
|
||||
|
||||
T1 in units of 10ms
|
||||
|
||||
T2 in units of 10ms */
|
||||
locations[0] = NULL;
|
||||
locations[1] = NULL;
|
||||
locations[2] = NULL;
|
||||
if (!parse_n_out(s, &t, locations, maxes, 3, "+IBM:", "(0-7),(0-255),(0-255)"))
|
||||
return NULL;
|
||||
return t;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
@@ -3821,19 +3994,19 @@ static const char *at_cmd_plus_ICF(at_state_t *s, const char *t)
|
||||
/* V.250 6.2.11 - DTE-DCE character framing */
|
||||
t += 4;
|
||||
/* Character format
|
||||
0 auto detect
|
||||
1 8 data 2 stop
|
||||
2 8 data 1 parity 1 stop
|
||||
3 8 data 1 stop
|
||||
4 7 data 2 stop
|
||||
5 7 data 1 parity 1 stop
|
||||
6 7 data 1 stop
|
||||
0: auto detect
|
||||
1: 8 data 2 stop
|
||||
2: 8 data 1 parity 1 stop
|
||||
3: 8 data 1 stop
|
||||
4: 7 data 2 stop
|
||||
5: 7 data 1 parity 1 stop
|
||||
6: 7 data 1 stop
|
||||
|
||||
parity
|
||||
0 Odd
|
||||
1 Even
|
||||
2 Mark
|
||||
3 Space */
|
||||
Parity
|
||||
0: Odd
|
||||
1: Even
|
||||
2: Mark
|
||||
3: Space */
|
||||
if (!parse_2_out(s, &t, &s->dte_char_format, 6, &s->dte_parity, 3, "+ICF:", "(0-6),(0-3)"))
|
||||
return NULL;
|
||||
return t;
|
||||
@@ -3909,6 +4082,15 @@ static const char *at_cmd_plus_IRTS(at_state_t *s, const char *t)
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
static const char *at_cmd_plus_ITF(at_state_t *s, const char *t)
|
||||
{
|
||||
/* V.80 8.4 - Transmit flow control thresholds */
|
||||
/* TODO: */
|
||||
t += 5;
|
||||
return t;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
static const char *at_cmd_plus_MA(at_state_t *s, const char *t)
|
||||
{
|
||||
/* V.250 6.4.2 - Modulation automode control */
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* License along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Id: fax.c,v 1.91 2009/04/12 03:29:58 steveu Exp $
|
||||
* $Id: fax.c,v 1.92 2009/04/23 15:48:21 steveu Exp $
|
||||
*/
|
||||
|
||||
/*! \file */
|
||||
@@ -575,7 +575,7 @@ SPAN_DECLARE(fax_state_t *) fax_init(fax_state_t *s, int calling_party)
|
||||
(void *) s,
|
||||
fax_send_hdlc,
|
||||
(void *) s);
|
||||
t30_set_supported_modems(&s->t30, T30_SUPPORT_V27TER | T30_SUPPORT_V29);
|
||||
t30_set_supported_modems(&s->t30, T30_SUPPORT_V27TER | T30_SUPPORT_V29 | T30_SUPPORT_V17);
|
||||
t30_restart(&s->t30);
|
||||
#if defined(LOG_FAX_AUDIO)
|
||||
{
|
||||
|
||||
+14
-7
@@ -28,7 +28,7 @@
|
||||
* Computer Science, Speech Group
|
||||
* Chengxiang Lu and Alex Hauptmann
|
||||
*
|
||||
* $Id: g722.c,v 1.9 2009/02/21 04:27:46 steveu Exp $
|
||||
* $Id: g722.c,v 1.10 2009/04/22 12:57:40 steveu Exp $
|
||||
*/
|
||||
|
||||
/*! \file */
|
||||
@@ -415,7 +415,8 @@ SPAN_DECLARE(int) g722_decode(g722_decode_state_t *s, int16_t amp[], const uint8
|
||||
{
|
||||
if (s->eight_k)
|
||||
{
|
||||
amp[outlen++] = (int16_t) rlow;
|
||||
/* We shift by 1 to allow for the 15 bit input to the G.722 algorithm. */
|
||||
amp[outlen++] = (int16_t) (rlow << 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -424,8 +425,10 @@ SPAN_DECLARE(int) g722_decode(g722_decode_state_t *s, int16_t amp[], const uint8
|
||||
s->y[s->ptr] = (int16_t) (rlow - rhigh);
|
||||
if (++s->ptr >= 12)
|
||||
s->ptr = 0;
|
||||
amp[outlen++] = (int16_t) (vec_circular_dot_prodi16(s->y, qmf_coeffs_rev, 12, s->ptr) >> 12);
|
||||
amp[outlen++] = (int16_t) (vec_circular_dot_prodi16(s->x, qmf_coeffs_fwd, 12, s->ptr) >> 12);
|
||||
/* We shift by 12 to allow for the QMF filters (DC gain = 4096), less 1
|
||||
to allow for the 15 bit input to the G.722 algorithm. */
|
||||
amp[outlen++] = (int16_t) (vec_circular_dot_prodi16(s->y, qmf_coeffs_rev, 12, s->ptr) >> 11);
|
||||
amp[outlen++] = (int16_t) (vec_circular_dot_prodi16(s->x, qmf_coeffs_fwd, 12, s->ptr) >> 11);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -511,7 +514,8 @@ SPAN_DECLARE(int) g722_encode(g722_encode_state_t *s, uint8_t g722_data[], const
|
||||
{
|
||||
if (s->eight_k)
|
||||
{
|
||||
xlow = amp[j++];
|
||||
/* We shift by 1 to allow for the 15 bit input to the G.722 algorithm. */
|
||||
xlow = amp[j++] >> 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -522,8 +526,11 @@ SPAN_DECLARE(int) g722_encode(g722_encode_state_t *s, uint8_t g722_data[], const
|
||||
s->ptr = 0;
|
||||
sumodd = vec_circular_dot_prodi16(s->x, qmf_coeffs_fwd, 12, s->ptr);
|
||||
sumeven = vec_circular_dot_prodi16(s->y, qmf_coeffs_rev, 12, s->ptr);
|
||||
xlow = (int16_t) ((sumeven + sumodd) >> 13);
|
||||
xhigh = (int16_t) ((sumeven - sumodd) >> 13);
|
||||
/* We shift by 12 to allow for the QMF filters (DC gain = 4096), plus 1
|
||||
to allow for us summing two filters, plus 1 to allow for the 15 bit
|
||||
input to the G.722 algorithm. */
|
||||
xlow = (int16_t) ((sumeven + sumodd) >> 14);
|
||||
xhigh = (int16_t) ((sumeven - sumodd) >> 14);
|
||||
}
|
||||
}
|
||||
/* Block 1L, SUBTRA */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual Studio 2008
|
||||
# Visual C++ Express 2008
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_at_dictionary", "msvc\make_at_dictionary.2008.vcproj", "{DEE932AB-5911-4700-9EEB-8C7090A0A330}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_modem_filter", "msvc\make_modem_filter.2008.vcproj", "{329A6FA0-0FCC-4435-A950-E670AEFA9838}"
|
||||
@@ -19,6 +19,41 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtiff", "libtiff.2008.vcp
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download TIFF", "msvc\Download_TIFF.2008.vcproj", "{2B8A45C9-FEB4-4734-AB37-8DB9DB899917}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "t38_core_tests", "..\tests\msvc\t38_core_tests.vcproj", "{A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "t38_non_ecm_buffer_tests", "..\tests\msvc\t38_non_ecm_buffer_tests.vcproj", "{80A3D9D9-3846-4DA5-8676-F940D725EA62}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vector_int_tests", "..\tests\msvc\vector_int_tests.vcproj", "{80A60464-29E8-4EE8-BAFA-8708B7C08CC3}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vector_float_tests", "..\tests\msvc\vector_float_tests.vcproj", "{EA745FF7-9E4B-4C13-BA19-2EE8165A6245}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "complex_tests", "..\tests\msvc\complex_tests.vcproj", "{A349379F-0FEA-49C8-9535-05F39663337B}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "complex_vector_float_tests", "..\tests\msvc\complex_vector_float_tests.vcproj", "{2B0D705C-1CF2-401C-BFBC-A43FB806908C}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "complex_vector_int_tests", "..\tests\msvc\complex_vector_int_tests.vcproj", "{C2E8B4D1-A398-4D57-94F8-B61F20C7D514}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
All|Win32 = All|Win32
|
||||
@@ -76,6 +111,69 @@ Global
|
||||
{2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.Release|Win32.ActiveCfg = All|Win32
|
||||
{2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.Release|Win32.Build.0 = All|Win32
|
||||
{2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.Release|x64.ActiveCfg = All|Win32
|
||||
{A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}.All|Win32.ActiveCfg = Release|Win32
|
||||
{A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}.All|Win32.Build.0 = Release|Win32
|
||||
{A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}.All|x64.ActiveCfg = Release|Win32
|
||||
{A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}.Release|Win32.Build.0 = Release|Win32
|
||||
{A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}.Release|x64.ActiveCfg = Release|Win32
|
||||
{80A3D9D9-3846-4DA5-8676-F940D725EA62}.All|Win32.ActiveCfg = Release|Win32
|
||||
{80A3D9D9-3846-4DA5-8676-F940D725EA62}.All|Win32.Build.0 = Release|Win32
|
||||
{80A3D9D9-3846-4DA5-8676-F940D725EA62}.All|x64.ActiveCfg = Release|Win32
|
||||
{80A3D9D9-3846-4DA5-8676-F940D725EA62}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{80A3D9D9-3846-4DA5-8676-F940D725EA62}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{80A3D9D9-3846-4DA5-8676-F940D725EA62}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{80A3D9D9-3846-4DA5-8676-F940D725EA62}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{80A3D9D9-3846-4DA5-8676-F940D725EA62}.Release|Win32.Build.0 = Release|Win32
|
||||
{80A3D9D9-3846-4DA5-8676-F940D725EA62}.Release|x64.ActiveCfg = Release|Win32
|
||||
{80A60464-29E8-4EE8-BAFA-8708B7C08CC3}.All|Win32.ActiveCfg = Release|Win32
|
||||
{80A60464-29E8-4EE8-BAFA-8708B7C08CC3}.All|Win32.Build.0 = Release|Win32
|
||||
{80A60464-29E8-4EE8-BAFA-8708B7C08CC3}.All|x64.ActiveCfg = Release|Win32
|
||||
{80A60464-29E8-4EE8-BAFA-8708B7C08CC3}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{80A60464-29E8-4EE8-BAFA-8708B7C08CC3}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{80A60464-29E8-4EE8-BAFA-8708B7C08CC3}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{80A60464-29E8-4EE8-BAFA-8708B7C08CC3}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{80A60464-29E8-4EE8-BAFA-8708B7C08CC3}.Release|Win32.Build.0 = Release|Win32
|
||||
{80A60464-29E8-4EE8-BAFA-8708B7C08CC3}.Release|x64.ActiveCfg = Release|Win32
|
||||
{EA745FF7-9E4B-4C13-BA19-2EE8165A6245}.All|Win32.ActiveCfg = Release|Win32
|
||||
{EA745FF7-9E4B-4C13-BA19-2EE8165A6245}.All|Win32.Build.0 = Release|Win32
|
||||
{EA745FF7-9E4B-4C13-BA19-2EE8165A6245}.All|x64.ActiveCfg = Release|Win32
|
||||
{EA745FF7-9E4B-4C13-BA19-2EE8165A6245}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{EA745FF7-9E4B-4C13-BA19-2EE8165A6245}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{EA745FF7-9E4B-4C13-BA19-2EE8165A6245}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{EA745FF7-9E4B-4C13-BA19-2EE8165A6245}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{EA745FF7-9E4B-4C13-BA19-2EE8165A6245}.Release|Win32.Build.0 = Release|Win32
|
||||
{EA745FF7-9E4B-4C13-BA19-2EE8165A6245}.Release|x64.ActiveCfg = Release|Win32
|
||||
{A349379F-0FEA-49C8-9535-05F39663337B}.All|Win32.ActiveCfg = Release|Win32
|
||||
{A349379F-0FEA-49C8-9535-05F39663337B}.All|Win32.Build.0 = Release|Win32
|
||||
{A349379F-0FEA-49C8-9535-05F39663337B}.All|x64.ActiveCfg = Release|Win32
|
||||
{A349379F-0FEA-49C8-9535-05F39663337B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{A349379F-0FEA-49C8-9535-05F39663337B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{A349379F-0FEA-49C8-9535-05F39663337B}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{A349379F-0FEA-49C8-9535-05F39663337B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{A349379F-0FEA-49C8-9535-05F39663337B}.Release|Win32.Build.0 = Release|Win32
|
||||
{A349379F-0FEA-49C8-9535-05F39663337B}.Release|x64.ActiveCfg = Release|Win32
|
||||
{2B0D705C-1CF2-401C-BFBC-A43FB806908C}.All|Win32.ActiveCfg = Release|Win32
|
||||
{2B0D705C-1CF2-401C-BFBC-A43FB806908C}.All|Win32.Build.0 = Release|Win32
|
||||
{2B0D705C-1CF2-401C-BFBC-A43FB806908C}.All|x64.ActiveCfg = Release|Win32
|
||||
{2B0D705C-1CF2-401C-BFBC-A43FB806908C}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{2B0D705C-1CF2-401C-BFBC-A43FB806908C}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{2B0D705C-1CF2-401C-BFBC-A43FB806908C}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{2B0D705C-1CF2-401C-BFBC-A43FB806908C}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{2B0D705C-1CF2-401C-BFBC-A43FB806908C}.Release|Win32.Build.0 = Release|Win32
|
||||
{2B0D705C-1CF2-401C-BFBC-A43FB806908C}.Release|x64.ActiveCfg = Release|Win32
|
||||
{C2E8B4D1-A398-4D57-94F8-B61F20C7D514}.All|Win32.ActiveCfg = Release|Win32
|
||||
{C2E8B4D1-A398-4D57-94F8-B61F20C7D514}.All|Win32.Build.0 = Release|Win32
|
||||
{C2E8B4D1-A398-4D57-94F8-B61F20C7D514}.All|x64.ActiveCfg = Release|Win32
|
||||
{C2E8B4D1-A398-4D57-94F8-B61F20C7D514}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C2E8B4D1-A398-4D57-94F8-B61F20C7D514}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C2E8B4D1-A398-4D57-94F8-B61F20C7D514}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{C2E8B4D1-A398-4D57-94F8-B61F20C7D514}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C2E8B4D1-A398-4D57-94F8-B61F20C7D514}.Release|Win32.Build.0 = Release|Win32
|
||||
{C2E8B4D1-A398-4D57-94F8-B61F20C7D514}.Release|x64.ActiveCfg = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* License along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Id: make_at_dictionary.c,v 1.2 2009/02/10 17:16:57 steveu Exp $
|
||||
* $Id: make_at_dictionary.c,v 1.4 2009/04/24 22:35:25 steveu Exp $
|
||||
*/
|
||||
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
@@ -228,6 +228,7 @@ const char *wordlist[] =
|
||||
"+EFRAM", /* V.250 6.5.8 - Frame length */
|
||||
"+ER", /* V.250 6.5.5 - Error control reporting */
|
||||
"+ES", /* V.250 6.5.1 - Error control selection */
|
||||
"+ESA", /* V.80 8.2 - Synchronous access mode configuration */
|
||||
"+ESR", /* V.250 6.5.3 - Selective repeat */
|
||||
"+ETBM", /* V.250 6.5.6 - Call termination buffer management */
|
||||
"+EWIND", /* V.250 6.5.7 - Window size */
|
||||
@@ -289,8 +290,8 @@ const char *wordlist[] =
|
||||
"+GMR", /* V.250 6.1.6 - Request revision identification */
|
||||
"+GOI", /* V.250 6.1.8 - Request global object identification */
|
||||
"+GSN", /* V.250 6.1.7 - Request product serial number identification */
|
||||
"+IBC", /* TIA-617 8.3 - Control of in-band control */
|
||||
"+IBM", /* TIA-617 8.4 - In-Band MARK idle reporting control */
|
||||
"+IBC", /* V.80 7.9 - Control of in-band control */
|
||||
"+IBM", /* V.80 7.10 - In-band MARK idle reporting control */
|
||||
"+ICF", /* V.250 6.2.11 - DTE-DCE character framing */
|
||||
"+ICLOK", /* V.250 6.2.14 - Select sync transmit clock source */
|
||||
"+IDSR", /* V.250 6.2.16 - Select data set ready option */
|
||||
@@ -299,6 +300,7 @@ const char *wordlist[] =
|
||||
"+ILSD", /* V.250 6.2.15 - Select long space disconnect option */
|
||||
"+IPR", /* V.250 6.2.10 - Fixed DTE rate */
|
||||
"+IRTS", /* V.250 6.2.17 - Select synchronous mode RTS option */
|
||||
"+ITF", /* V.80 8.4 - Transmit flow control thresholds */
|
||||
"+MA", /* V.250 6.4.2 - Modulation automode control */
|
||||
"+MR", /* V.250 6.4.3 - Modulation reporting control */
|
||||
"+MS", /* V.250 6.4.1 - Modulation selection */
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* License along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Id: async.h,v 1.24 2009/02/12 12:38:39 steveu Exp $
|
||||
* $Id: async.h,v 1.25 2009/04/23 14:12:34 steveu Exp $
|
||||
*/
|
||||
|
||||
/*! \file */
|
||||
@@ -78,7 +78,11 @@ enum
|
||||
/*! \brief A modem has completed its task, and shut down. */
|
||||
SIG_STATUS_SHUTDOWN_COMPLETE = -10,
|
||||
/*! \brief Regular octet report for things like HDLC to the MTP standards. */
|
||||
SIG_STATUS_OCTET_REPORT = -11
|
||||
SIG_STATUS_OCTET_REPORT = -11,
|
||||
/*! \brief Notification that a modem has detected signal quality degradation. */
|
||||
SIG_STATUS_POOR_SIGNAL_QUALITY = -12,
|
||||
/*! \brief Notification that a modem retrain has occurred. */
|
||||
SIG_STATUS_MODEM_RETRAIN_OCCURRED = -13
|
||||
};
|
||||
|
||||
/*! Message put function for data pumps */
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* License along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Id: fax_modems.h,v 1.10 2009/02/14 15:21:14 steveu Exp $
|
||||
* $Id: fax_modems.h,v 1.11 2009/04/26 12:55:23 steveu Exp $
|
||||
*/
|
||||
|
||||
/*! \file */
|
||||
@@ -63,6 +63,10 @@ extern "C"
|
||||
SPAN_DECLARE(int) fax_modems_v17_v21_rx(void *user_data, const int16_t amp[], int len);
|
||||
SPAN_DECLARE(int) fax_modems_v27ter_v21_rx(void *user_data, const int16_t amp[], int len);
|
||||
SPAN_DECLARE(int) fax_modems_v29_v21_rx(void *user_data, const int16_t amp[], int len);
|
||||
SPAN_DECLARE(int) fax_modems_v17_v21_rx_fillin(void *user_data, int len);
|
||||
SPAN_DECLARE(int) fax_modems_v27ter_v21_rx_fillin(void *user_data, int len);
|
||||
SPAN_DECLARE(int) fax_modems_v29_v21_rx_fillin(void *user_data, int len);
|
||||
SPAN_DECLARE(void) fax_modems_start_rx_modem(fax_modems_state_t *s, int which);
|
||||
|
||||
SPAN_DECLARE(void) fax_modems_set_tep_mode(fax_modems_state_t *s, int use_tep);
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* License along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Id: v22bis.h,v 1.4 2009/04/17 14:37:53 steveu Exp $
|
||||
* $Id: v22bis.h,v 1.9 2009/04/26 09:50:28 steveu Exp $
|
||||
*/
|
||||
|
||||
#if !defined(_SPANDSP_PRIVATE_V22BIS_H_)
|
||||
@@ -34,22 +34,26 @@
|
||||
*/
|
||||
struct v22bis_state_s
|
||||
{
|
||||
/*! \brief The bit rate of the modem. Valid values are 1200 and 2400. */
|
||||
/*! \brief The maximum permitted bit rate of the modem. Valid values are 1200 and 2400. */
|
||||
int bit_rate;
|
||||
/*! \brief TRUE is this is the calling side modem. */
|
||||
int caller;
|
||||
/*! \brief The callback function used to put each bit received. */
|
||||
put_bit_func_t put_bit;
|
||||
/*! \brief The callback function used to get the next bit to be transmitted. */
|
||||
get_bit_func_t get_bit;
|
||||
/*! \brief A user specified opaque pointer passed to the callback routines. */
|
||||
void *user_data;
|
||||
/*! \brief A user specified opaque pointer passed to the get_bit callback routine. */
|
||||
void *get_bit_user_data;
|
||||
/*! \brief The callback function used to put each bit received. */
|
||||
put_bit_func_t put_bit;
|
||||
/*! \brief A user specified opaque pointer passed to the put_bit callback routine. */
|
||||
void *put_bit_user_data;
|
||||
/*! \brief The callback function used to report modem status changes. */
|
||||
modem_rx_status_func_t status_handler;
|
||||
/*! \brief A user specified opaque pointer passed to the status function. */
|
||||
void *status_user_data;
|
||||
|
||||
/* RECEIVE SECTION */
|
||||
int negotiated_bit_rate;
|
||||
|
||||
/* Receive section */
|
||||
struct
|
||||
{
|
||||
/*! \brief The route raised cosine (RRC) pulse shaping filter buffer. */
|
||||
@@ -84,8 +88,6 @@ struct v22bis_state_s
|
||||
/*! \brief The integral part of the carrier tracking filter. */
|
||||
float carrier_track_i;
|
||||
|
||||
int scrambled_ones_to_date;
|
||||
|
||||
/*! \brief A callback function which may be enabled to report every symbol's
|
||||
constellation position. */
|
||||
qam_report_handler_t qam_report;
|
||||
@@ -132,12 +134,11 @@ struct v22bis_state_s
|
||||
|
||||
int sixteen_way_decisions;
|
||||
|
||||
int detected_unscrambled_ones;
|
||||
int detected_unscrambled_zeros;
|
||||
int detected_2400bps_markers;
|
||||
int pattern_repeats;
|
||||
int last_raw_bits;
|
||||
} rx;
|
||||
|
||||
/* TRANSMIT SECTION */
|
||||
/* Transmit section */
|
||||
struct
|
||||
{
|
||||
/*! \brief The gain factor needed to achieve the specified output power. */
|
||||
@@ -181,5 +182,22 @@ struct v22bis_state_s
|
||||
logging_state_t logging;
|
||||
};
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/*! Reinitialise an existing V.22bis modem receive context.
|
||||
\brief Reinitialise an existing V.22bis modem receive context.
|
||||
\param s The modem context.
|
||||
\return 0 for OK, -1 for bad parameter */
|
||||
int v22bis_rx_restart(v22bis_state_t *s);
|
||||
|
||||
void v22bis_report_status_change(v22bis_state_t *s, int status);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/*- End of file ------------------------------------------------------------*/
|
||||
@@ -22,7 +22,7 @@
|
||||
* License along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Id: v22bis.h,v 1.39 2009/04/17 14:37:53 steveu Exp $
|
||||
* $Id: v22bis.h,v 1.41 2009/04/25 10:18:50 steveu Exp $
|
||||
*/
|
||||
|
||||
/*! \file */
|
||||
@@ -81,13 +81,6 @@ extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/*! Reinitialise an existing V.22bis modem receive context.
|
||||
\brief Reinitialise an existing V.22bis modem receive context.
|
||||
\param s The modem context.
|
||||
\param bit_rate The bit rate of the modem. Valid values are 1200 and 2400.
|
||||
\return 0 for OK, -1 for bad parameter */
|
||||
SPAN_DECLARE(int) v22bis_rx_restart(v22bis_state_t *s, int bit_rate);
|
||||
|
||||
/*! Process a block of received V.22bis modem audio samples.
|
||||
\brief Process a block of received V.22bis modem audio samples.
|
||||
\param s The modem context.
|
||||
@@ -108,7 +101,7 @@ SPAN_DECLARE(int) v22bis_rx_fillin(v22bis_state_t *s, int len);
|
||||
\brief Get a snapshot of the current equalizer coefficients.
|
||||
\param coeffs The vector of complex coefficients.
|
||||
\return The number of coefficients in the vector. */
|
||||
SPAN_DECLARE(int) v22bis_equalizer_state(v22bis_state_t *s, complexf_t **coeffs);
|
||||
SPAN_DECLARE(int) v22bis_rx_equalizer_state(v22bis_state_t *s, complexf_t **coeffs);
|
||||
|
||||
/*! Get the current received carrier frequency.
|
||||
\param s The modem context.
|
||||
@@ -118,7 +111,7 @@ SPAN_DECLARE(float) v22bis_rx_carrier_frequency(v22bis_state_t *s);
|
||||
/*! Get the current symbol timing correction since startup.
|
||||
\param s The modem context.
|
||||
\return The correction. */
|
||||
SPAN_DECLARE(float) v22bis_symbol_timing_correction(v22bis_state_t *s);
|
||||
SPAN_DECLARE(float) v22bis_rx_symbol_timing_correction(v22bis_state_t *s);
|
||||
|
||||
/*! Get a current received signal power.
|
||||
\param s The modem context.
|
||||
@@ -134,7 +127,7 @@ SPAN_DECLARE(void) v22bis_rx_signal_cutoff(v22bis_state_t *s, float cutoff);
|
||||
\param s The modem context.
|
||||
\param handler The handler routine.
|
||||
\param user_data An opaque pointer passed to the handler routine. */
|
||||
SPAN_DECLARE(void) v22bis_set_qam_report_handler(v22bis_state_t *s, qam_report_handler_t handler, void *user_data);
|
||||
SPAN_DECLARE(void) v22bis_rx_set_qam_report_handler(v22bis_state_t *s, qam_report_handler_t handler, void *user_data);
|
||||
|
||||
/*! Generate a block of V.22bis modem audio samples.
|
||||
\brief Generate a block of V.22bis modem audio samples.
|
||||
@@ -157,6 +150,18 @@ SPAN_DECLARE(void) v22bis_tx_power(v22bis_state_t *s, float power);
|
||||
\return 0 for OK, -1 for bad parameter. */
|
||||
SPAN_DECLARE(int) v22bis_restart(v22bis_state_t *s, int bit_rate);
|
||||
|
||||
/*! Request a retrain for a V.22bis modem context. A rate change may also be resquested.
|
||||
\brief Request a retrain for a V.22bis modem context.
|
||||
\param s The modem context.
|
||||
\param bit_rate The bit rate of the modem. Valid values are 1200 and 2400.
|
||||
\return 0 for OK, -1 for bad parameter. */
|
||||
SPAN_DECLARE(int) v22bis_request_retrain(v22bis_state_t *s, int bit_rate);
|
||||
|
||||
/*! Report the current operating bit rate of a V.22bis modem context.
|
||||
\brief Report the current operating bit rate of a V.22bis modem context
|
||||
\param s The modem context. */
|
||||
SPAN_DECLARE(int) v22bis_current_bit_rate(v22bis_state_t *s);
|
||||
|
||||
/*! Initialise a V.22bis modem context. This must be called before the first
|
||||
use of the context, to initialise its contents.
|
||||
\brief Initialise a V.22bis modem context.
|
||||
@@ -173,8 +178,9 @@ SPAN_DECLARE(v22bis_state_t *) v22bis_init(v22bis_state_t *s,
|
||||
int guard,
|
||||
int caller,
|
||||
get_bit_func_t get_bit,
|
||||
void *get_bit_user_data,
|
||||
put_bit_func_t put_bit,
|
||||
void *user_data);
|
||||
void *put_bit_user_data);
|
||||
|
||||
/*! Release a V.22bis modem receive context.
|
||||
\brief Release a V.22bis modem receive context.
|
||||
|
||||
@@ -30,9 +30,9 @@
|
||||
|
||||
/* The date and time of the version are in UTC form. */
|
||||
|
||||
#define SPANDSP_RELEASE_DATE 20090420
|
||||
#define SPANDSP_RELEASE_TIME 163808
|
||||
#define SPANDSP_RELEASE_DATETIME_STRING "20090420 163808"
|
||||
#define SPANDSP_RELEASE_DATE 20090427
|
||||
#define SPANDSP_RELEASE_TIME 151958
|
||||
#define SPANDSP_RELEASE_DATETIME_STRING "20090427 151958"
|
||||
|
||||
#endif
|
||||
/*- End of file ------------------------------------------------------------*/
|
||||
@@ -22,7 +22,7 @@
|
||||
* License along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Id: t30.c,v 1.290 2009/04/16 12:11:54 steveu Exp $
|
||||
* $Id: t30.c,v 1.291 2009/04/23 15:40:32 steveu Exp $
|
||||
*/
|
||||
|
||||
/*! \file */
|
||||
@@ -5914,7 +5914,7 @@ SPAN_DECLARE(t30_state_t *) t30_init(t30_state_t *s,
|
||||
s->send_hdlc_user_data = send_hdlc_user_data;
|
||||
|
||||
/* Default to the basic modems. */
|
||||
s->supported_modems = T30_SUPPORT_V27TER | T30_SUPPORT_V29;
|
||||
s->supported_modems = T30_SUPPORT_V27TER | T30_SUPPORT_V29 | T30_SUPPORT_V17;
|
||||
s->supported_compressions = T30_SUPPORT_T4_1D_COMPRESSION | T30_SUPPORT_T4_2D_COMPRESSION;
|
||||
s->supported_resolutions = T30_SUPPORT_STANDARD_RESOLUTION | T30_SUPPORT_FINE_RESOLUTION | T30_SUPPORT_SUPERFINE_RESOLUTION
|
||||
| T30_SUPPORT_R8_RESOLUTION;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* License along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Id: v17rx.c,v 1.145 2009/04/20 16:36:36 steveu Exp $
|
||||
* $Id: v17rx.c,v 1.146 2009/04/21 13:59:07 steveu Exp $
|
||||
*/
|
||||
|
||||
/*! \file */
|
||||
@@ -1323,6 +1323,16 @@ SPAN_DECLARE(int) v17_rx_restart(v17_rx_state_t *s, int bit_rate, int short_trai
|
||||
|
||||
SPAN_DECLARE(v17_rx_state_t *) v17_rx_init(v17_rx_state_t *s, int bit_rate, put_bit_func_t put_bit, void *user_data)
|
||||
{
|
||||
switch (bit_rate)
|
||||
{
|
||||
case 14400:
|
||||
case 12000:
|
||||
case 9600:
|
||||
case 7200:
|
||||
break;
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
if (s == NULL)
|
||||
{
|
||||
if ((s = (v17_rx_state_t *) malloc(sizeof(*s))) == NULL)
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* License along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Id: v17tx.c,v 1.72 2009/04/12 04:20:01 steveu Exp $
|
||||
* $Id: v17tx.c,v 1.73 2009/04/21 13:59:07 steveu Exp $
|
||||
*/
|
||||
|
||||
/*! \file */
|
||||
@@ -400,6 +400,16 @@ SPAN_DECLARE(int) v17_tx_restart(v17_tx_state_t *s, int bit_rate, int tep, int s
|
||||
|
||||
SPAN_DECLARE(v17_tx_state_t *) v17_tx_init(v17_tx_state_t *s, int bit_rate, int tep, get_bit_func_t get_bit, void *user_data)
|
||||
{
|
||||
switch (bit_rate)
|
||||
{
|
||||
case 14400:
|
||||
case 12000:
|
||||
case 9600:
|
||||
case 7200:
|
||||
break;
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
if (s == NULL)
|
||||
{
|
||||
if ((s = (v17_tx_state_t *) malloc(sizeof(*s))) == NULL)
|
||||
|
||||
+10
-1
@@ -22,7 +22,7 @@
|
||||
* License along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Id: v18.c,v 1.6 2009/04/20 16:36:36 steveu Exp $
|
||||
* $Id: v18.c,v 1.7 2009/04/26 07:00:38 steveu Exp $
|
||||
*/
|
||||
|
||||
/*! \file */
|
||||
@@ -113,12 +113,21 @@ static const struct dtmf_to_ascii_s dtmf_to_ascii[] =
|
||||
{"##8", 'W'},
|
||||
{"##9", 'Z'},
|
||||
{"##0", ' '},
|
||||
#if defined(WIN32)
|
||||
{"#*1", 'X'}, // (Note 1) 111 1011
|
||||
{"#*2", 'X'}, // (Note 1) 111 1100
|
||||
{"#*3", 'X'}, // (Note 1) 111 1101
|
||||
{"#*4", 'X'}, // (Note 1) 101 1011
|
||||
{"#*5", 'X'}, // (Note 1) 101 1100
|
||||
{"#*6", 'X'}, // (Note 1) 101 1101
|
||||
#else
|
||||
{"#*1", 'æ'}, // (Note 1) 111 1011
|
||||
{"#*2", 'ø'}, // (Note 1) 111 1100
|
||||
{"#*3", 'å'}, // (Note 1) 111 1101
|
||||
{"#*4", 'Æ'}, // (Note 1) 101 1011
|
||||
{"#*5", 'Ø'}, // (Note 1) 101 1100
|
||||
{"#*6", 'Å'}, // (Note 1) 101 1101
|
||||
#endif
|
||||
{"#0", '?'},
|
||||
{"#1", 'c'},
|
||||
{"#2", 'f'},
|
||||
|
||||
+175
-166
@@ -22,7 +22,7 @@
|
||||
* License along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Id: v22bis_rx.c,v 1.56 2009/04/20 12:26:38 steveu Exp $
|
||||
* $Id: v22bis_rx.c,v 1.66 2009/04/27 15:18:52 steveu Exp $
|
||||
*/
|
||||
|
||||
/*! \file */
|
||||
@@ -47,11 +47,12 @@
|
||||
|
||||
#include "spandsp/telephony.h"
|
||||
#include "spandsp/logging.h"
|
||||
#include "spandsp/complex.h"
|
||||
#include "spandsp/vector_float.h"
|
||||
#include "spandsp/complex_vector_float.h"
|
||||
#include "spandsp/async.h"
|
||||
#include "spandsp/power_meter.h"
|
||||
#include "spandsp/arctan2.h"
|
||||
#include "spandsp/complex.h"
|
||||
#include "spandsp/dds.h"
|
||||
#include "spandsp/complex_filters.h"
|
||||
|
||||
@@ -108,10 +109,10 @@ enum
|
||||
V22BIS_RX_TRAINING_STAGE_SYMBOL_ACQUISITION,
|
||||
V22BIS_RX_TRAINING_STAGE_LOG_PHASE,
|
||||
V22BIS_RX_TRAINING_STAGE_UNSCRAMBLED_ONES,
|
||||
V22BIS_RX_TRAINING_STAGE_UNSCRAMBLED_ONES_SUSTAINING,
|
||||
V22BIS_RX_TRAINING_STAGE_SCRAMBLED_ONES_AT_1200,
|
||||
V22BIS_RX_TRAINING_STAGE_SCRAMBLED_ONES_AT_1200_SUSTAINING,
|
||||
V22BIS_RX_TRAINING_STAGE_WAIT_FOR_START_1,
|
||||
V22BIS_RX_TRAINING_STAGE_WAIT_FOR_START_2,
|
||||
V22BIS_RX_TRAINING_STAGE_WAIT_FOR_SCRAMBLED_ONES_AT_2400,
|
||||
V22BIS_RX_TRAINING_STAGE_PARKED
|
||||
};
|
||||
|
||||
@@ -158,7 +159,7 @@ SPAN_DECLARE(float) v22bis_rx_carrier_frequency(v22bis_state_t *s)
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
SPAN_DECLARE(float) v22bis_symbol_timing_correction(v22bis_state_t *s)
|
||||
SPAN_DECLARE(float) v22bis_rx_symbol_timing_correction(v22bis_state_t *s)
|
||||
{
|
||||
return (float) s->rx.total_baud_timing_correction/((float) PULSESHAPER_COEFF_SETS*40.0f/(3.0f*2.0f));
|
||||
}
|
||||
@@ -177,16 +178,16 @@ SPAN_DECLARE(void) v22bis_rx_signal_cutoff(v22bis_state_t *s, float cutoff)
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
static void report_status_change(v22bis_state_t *s, int status)
|
||||
void v22bis_report_status_change(v22bis_state_t *s, int status)
|
||||
{
|
||||
if (s->status_handler)
|
||||
s->status_handler(s->status_user_data, status);
|
||||
else if (s->put_bit)
|
||||
s->put_bit(s->user_data, status);
|
||||
s->put_bit(s->put_bit_user_data, status);
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
SPAN_DECLARE(int) v22bis_equalizer_state(v22bis_state_t *s, complexf_t **coeffs)
|
||||
SPAN_DECLARE(int) v22bis_rx_equalizer_state(v22bis_state_t *s, complexf_t **coeffs)
|
||||
{
|
||||
*coeffs = s->rx.eq_coeff;
|
||||
return 2*V22BIS_EQUALIZER_LEN + 1;
|
||||
@@ -195,31 +196,20 @@ SPAN_DECLARE(int) v22bis_equalizer_state(v22bis_state_t *s, complexf_t **coeffs)
|
||||
|
||||
static void equalizer_reset(v22bis_state_t *s)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* Start with an equalizer based on everything being perfect */
|
||||
for (i = 0; i < 2*V22BIS_EQUALIZER_LEN + 1; i++)
|
||||
s->rx.eq_coeff[i] = complex_setf(0.0f, 0.0f);
|
||||
#if defined(SPANDSP_USE_FIXED_POINTx)
|
||||
cvec_zeroi16(s->rx.eq_coeff, 2*V22BIS_EQUALIZER_LEN + 1);
|
||||
s->rx.eq_coeff[V22BIS_EQUALIZER_LEN] = complex_seti16(3*FP_FACTOR, 0*FP_FACTOR);
|
||||
cvec_zeroi16(s->rx.eq_buf, V22BIS_EQUALIZER_MASK + 1);
|
||||
s->rx.eq_delta = 32768.0f*EQUALIZER_DELTA/(2*V22BIS_EQUALIZER_LEN + 1);
|
||||
#else
|
||||
cvec_zerof(s->rx.eq_coeff, 2*V22BIS_EQUALIZER_LEN + 1);
|
||||
s->rx.eq_coeff[V22BIS_EQUALIZER_LEN] = complex_setf(3.0f, 0.0f);
|
||||
for (i = 0; i <= V22BIS_EQUALIZER_MASK; i++)
|
||||
s->rx.eq_buf[i] = complex_setf(0.0f, 0.0f);
|
||||
|
||||
s->rx.eq_coeff[V22BIS_EQUALIZER_LEN - 6].re = -0.02f;
|
||||
s->rx.eq_coeff[V22BIS_EQUALIZER_LEN - 5].re = 0.035f;
|
||||
s->rx.eq_coeff[V22BIS_EQUALIZER_LEN - 4].re = 0.08f;
|
||||
s->rx.eq_coeff[V22BIS_EQUALIZER_LEN - 3].re = -0.30f;
|
||||
s->rx.eq_coeff[V22BIS_EQUALIZER_LEN - 2].re = -0.37f;
|
||||
s->rx.eq_coeff[V22BIS_EQUALIZER_LEN - 1].re = 0.09f;
|
||||
s->rx.eq_coeff[V22BIS_EQUALIZER_LEN].re = 3.19f;
|
||||
s->rx.eq_coeff[V22BIS_EQUALIZER_LEN + 1].re = 0.09f;
|
||||
s->rx.eq_coeff[V22BIS_EQUALIZER_LEN + 2].re = -0.37f;
|
||||
s->rx.eq_coeff[V22BIS_EQUALIZER_LEN + 3].re = -0.30f;
|
||||
s->rx.eq_coeff[V22BIS_EQUALIZER_LEN + 5].re = 0.035f;
|
||||
s->rx.eq_coeff[V22BIS_EQUALIZER_LEN + 6].re = -0.02f;
|
||||
|
||||
cvec_zerof(s->rx.eq_buf, V22BIS_EQUALIZER_MASK + 1);
|
||||
s->rx.eq_delta = EQUALIZER_DELTA/(2*V22BIS_EQUALIZER_LEN + 1);
|
||||
#endif
|
||||
s->rx.eq_put_step = 20 - 1;
|
||||
s->rx.eq_step = 0;
|
||||
s->rx.eq_delta = EQUALIZER_DELTA/(2*V22BIS_EQUALIZER_LEN + 1);
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
@@ -291,7 +281,9 @@ static __inline__ int descramble(v22bis_state_t *s, int bit)
|
||||
bit &= 1;
|
||||
|
||||
/* Descramble the bit */
|
||||
out_bit = (bit ^ (s->rx.scramble_reg >> 14) ^ (s->rx.scramble_reg >> 17)) & 1;
|
||||
out_bit = (bit ^ (s->rx.scramble_reg >> 13) ^ (s->rx.scramble_reg >> 16)) & 1;
|
||||
s->rx.scramble_reg = (s->rx.scramble_reg << 1) | bit;
|
||||
|
||||
if (s->rx.scrambler_pattern_count >= 64)
|
||||
{
|
||||
out_bit ^= 1;
|
||||
@@ -301,7 +293,6 @@ static __inline__ int descramble(v22bis_state_t *s, int bit)
|
||||
s->rx.scrambler_pattern_count++;
|
||||
else
|
||||
s->rx.scrambler_pattern_count = 0;
|
||||
s->rx.scramble_reg = (s->rx.scramble_reg << 1) | bit;
|
||||
return out_bit;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
@@ -312,7 +303,7 @@ static __inline__ void put_bit(v22bis_state_t *s, int bit)
|
||||
|
||||
/* Descramble the bit */
|
||||
out_bit = descramble(s, bit);
|
||||
s->put_bit(s->user_data, out_bit);
|
||||
s->put_bit(s->put_bit_user_data, out_bit);
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
@@ -321,16 +312,16 @@ static void decode_baud(v22bis_state_t *s, int nearest)
|
||||
int raw_bits;
|
||||
|
||||
raw_bits = phase_steps[((nearest >> 2) - (s->rx.constellation_state >> 2)) & 3];
|
||||
s->rx.constellation_state = nearest;
|
||||
/* The first two bits are the quadrant */
|
||||
put_bit(s, raw_bits >> 1);
|
||||
put_bit(s, raw_bits);
|
||||
if (s->bit_rate == 2400)
|
||||
if (s->rx.sixteen_way_decisions)
|
||||
{
|
||||
/* The other two bits are the position within the quadrant */
|
||||
put_bit(s, nearest >> 1);
|
||||
put_bit(s, nearest);
|
||||
}
|
||||
s->rx.constellation_state = nearest;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
@@ -340,16 +331,16 @@ static int decode_baudx(v22bis_state_t *s, int nearest)
|
||||
int out_bits;
|
||||
|
||||
raw_bits = phase_steps[((nearest >> 2) - (s->rx.constellation_state >> 2)) & 3];
|
||||
s->rx.constellation_state = nearest;
|
||||
/* The first two bits are the quadrant */
|
||||
out_bits = descramble(s, raw_bits >> 1);
|
||||
out_bits = (out_bits << 1) | descramble(s, raw_bits);
|
||||
if (s->bit_rate == 2400)
|
||||
if (s->rx.sixteen_way_decisions)
|
||||
{
|
||||
/* The other two bits are the position within the quadrant */
|
||||
out_bits = (out_bits << 1) | descramble(s, nearest >> 1);
|
||||
out_bits = (out_bits << 1) | descramble(s, nearest);
|
||||
}
|
||||
s->rx.constellation_state = nearest;
|
||||
return out_bits;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
@@ -443,7 +434,7 @@ static void process_half_baud(v22bis_state_t *s, const complexf_t *sample)
|
||||
when the true symbol boundary is close to a sample boundary. */
|
||||
s->rx.eq_put_step += (s->rx.gardner_integrate/16);
|
||||
s->rx.total_baud_timing_correction += (s->rx.gardner_integrate/16);
|
||||
//span_log(&s->logging, SPAN_LOG_FLOW, "Gardner kick %d [total %d]\n", s->rx.gardner_integrate, s->rx.total_baud_timing_correction);
|
||||
//span_log(&s->logging, SPAN_LOG_FLOW, "Gardner kick %d [total %d]\n", s->rx.gardner_integrate, s->rx.total_baud_timing_correction);
|
||||
if (s->rx.qam_report)
|
||||
s->rx.qam_report(s->rx.qam_user_data, NULL, NULL, s->rx.gardner_integrate);
|
||||
s->rx.gardner_integrate = 0;
|
||||
@@ -451,7 +442,6 @@ static void process_half_baud(v22bis_state_t *s, const complexf_t *sample)
|
||||
|
||||
z = equalizer_get(s);
|
||||
|
||||
//span_log(&s->logging, SPAN_LOG_FLOW, "VVV %p %d\n", s->user_data, s->rx.training);
|
||||
if (s->rx.sixteen_way_decisions)
|
||||
{
|
||||
re = (int) (z.re + 3.0f);
|
||||
@@ -468,20 +458,20 @@ static void process_half_baud(v22bis_state_t *s, const complexf_t *sample)
|
||||
}
|
||||
else
|
||||
{
|
||||
zz = complex_setf(3.0f/sqrtf(10.0f), -1.0f/sqrtf(10.0f));
|
||||
zz = complex_setf(3.0f/3.162278f, -1.0f/3.162278f);
|
||||
zz = complex_mulf(&z, &zz);
|
||||
nearest = (find_quadrant(&zz) << 2) | 0x01;
|
||||
printf("Trackit rx %p %15.5f %15.5f %15.5f %15.5f %d\n", s, z.re, z.im, zz.re, zz.im, nearest);
|
||||
}
|
||||
raw_bits = 0;
|
||||
|
||||
switch (s->rx.training)
|
||||
{
|
||||
case V22BIS_RX_TRAINING_STAGE_NORMAL_OPERATION:
|
||||
/* Normal operation. */
|
||||
track_carrier(s, &z, &v22bis_constellation[nearest]);
|
||||
tune_equalizer(s, &z, &v22bis_constellation[nearest]);
|
||||
target = &v22bis_constellation[nearest];
|
||||
track_carrier(s, &z, target);
|
||||
tune_equalizer(s, &z, target);
|
||||
decode_baud(s, nearest);
|
||||
target = &v22bis_constellation[s->rx.constellation_state];
|
||||
break;
|
||||
case V22BIS_RX_TRAINING_STAGE_SYMBOL_ACQUISITION:
|
||||
/* Allow time for the Gardner algorithm to settle the symbol timing. */
|
||||
@@ -494,13 +484,13 @@ static void process_half_baud(v22bis_state_t *s, const complexf_t *sample)
|
||||
but since we might be off in the opposite direction from the source, the total
|
||||
error could be higher. */
|
||||
s->rx.gardner_step = 4;
|
||||
s->rx.detected_unscrambled_zeros = 0;
|
||||
s->rx.detected_unscrambled_ones = 0;
|
||||
s->rx.detected_2400bps_markers = 0;
|
||||
s->rx.pattern_repeats = 0;
|
||||
if (s->caller)
|
||||
s->rx.training = V22BIS_RX_TRAINING_STAGE_UNSCRAMBLED_ONES;
|
||||
else
|
||||
s->rx.training = V22BIS_RX_TRAINING_STAGE_SCRAMBLED_ONES_AT_1200;
|
||||
/* Be pessimistic and see what the handshake brings */
|
||||
s->negotiated_bit_rate = 1200;
|
||||
break;
|
||||
}
|
||||
/* Once we have pulled in the symbol timing in a coarse way, use finer
|
||||
@@ -511,29 +501,25 @@ static void process_half_baud(v22bis_state_t *s, const complexf_t *sample)
|
||||
case V22BIS_RX_TRAINING_STAGE_UNSCRAMBLED_ONES:
|
||||
/* Calling modem only */
|
||||
/* The calling modem should initially receive unscrambled ones at 1200bps */
|
||||
track_carrier(s, &z, &v22bis_constellation[nearest]);
|
||||
target = &z;
|
||||
target = &v22bis_constellation[nearest];
|
||||
track_carrier(s, &z, target);
|
||||
raw_bits = phase_steps[((nearest >> 2) - (s->rx.constellation_state >> 2)) & 3];
|
||||
s->rx.constellation_state = nearest;
|
||||
switch (raw_bits)
|
||||
{
|
||||
case 0:
|
||||
s->rx.detected_unscrambled_zeros++;
|
||||
break;
|
||||
case 3:
|
||||
s->rx.detected_unscrambled_ones++;
|
||||
break;
|
||||
default:
|
||||
s->rx.detected_2400bps_markers++;
|
||||
break;
|
||||
}
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "TWIDDLING THUMBS - %d %d\n", s->rx.training_count, s->rx.detected_2400bps_markers);
|
||||
if (raw_bits != s->rx.last_raw_bits)
|
||||
s->rx.pattern_repeats = 0;
|
||||
else
|
||||
s->rx.pattern_repeats++;
|
||||
if (++s->rx.training_count == ms_to_symbols(155 + 456))
|
||||
{
|
||||
if (s->rx.detected_unscrambled_ones >= ms_to_symbols(456)
|
||||
||
|
||||
s->rx.detected_unscrambled_zeros >= ms_to_symbols(456))
|
||||
/* After the first 155ms things should have been steady, so check if the last 456ms was
|
||||
steady at 11 or 00. */
|
||||
if (raw_bits == s->rx.last_raw_bits
|
||||
&&
|
||||
(raw_bits == 0x3 || raw_bits == 0x0)
|
||||
&&
|
||||
s->rx.pattern_repeats >= ms_to_symbols(456))
|
||||
{
|
||||
/* It looks like the answering machine is sending us a clean unscrambled 11 or 00 */
|
||||
if (s->bit_rate == 2400)
|
||||
{
|
||||
/* Try to establish at 2400bps */
|
||||
@@ -544,127 +530,147 @@ span_log(&s->logging, SPAN_LOG_FLOW, "TWIDDLING THUMBS - %d %d\n", s->rx.trainin
|
||||
else
|
||||
{
|
||||
/* Only try to establish at 1200bps */
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "+++ starting S11 (Caller)\n");
|
||||
s->tx.training = V22BIS_TX_TRAINING_STAGE_TIMED_S11;
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "+++ starting S11 (1200) (Caller)\n");
|
||||
s->tx.training = V22BIS_TX_TRAINING_STAGE_S11;
|
||||
s->tx.training_count = 0;
|
||||
}
|
||||
}
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "unscrambled ones = %d, unscrambled zeros = %d, 2400 markers = %d\n", s->rx.detected_unscrambled_ones, s->rx.detected_unscrambled_zeros, s->rx.detected_2400bps_markers);
|
||||
s->rx.pattern_repeats = 0;
|
||||
s->rx.training_count = 0;
|
||||
s->rx.training = V22BIS_RX_TRAINING_STAGE_UNSCRAMBLED_ONES_SUSTAINING;
|
||||
}
|
||||
break;
|
||||
case V22BIS_RX_TRAINING_STAGE_UNSCRAMBLED_ONES_SUSTAINING:
|
||||
/* Calling modem only */
|
||||
/* Wait for the end of the unscrambled ones at 1200bps */
|
||||
target = &v22bis_constellation[nearest];
|
||||
track_carrier(s, &z, target);
|
||||
raw_bits = phase_steps[((nearest >> 2) - (s->rx.constellation_state >> 2)) & 3];
|
||||
s->rx.constellation_state = nearest;
|
||||
if (raw_bits != s->rx.last_raw_bits)
|
||||
{
|
||||
/* This looks like the end of the sustained initial unscrambled 11 or 00 */
|
||||
s->tx.training_count = 0;
|
||||
s->tx.training = V22BIS_TX_TRAINING_STAGE_TIMED_S11;
|
||||
s->rx.training_count = 0;
|
||||
s->rx.training = V22BIS_RX_TRAINING_STAGE_SCRAMBLED_ONES_AT_1200;
|
||||
s->rx.detected_unscrambled_zeros = 0;
|
||||
s->rx.detected_unscrambled_ones = 0;
|
||||
s->rx.detected_2400bps_markers = 0;
|
||||
s->rx.scrambled_ones_to_date = 0;
|
||||
s->rx.pattern_repeats = 0;
|
||||
}
|
||||
break;
|
||||
case V22BIS_RX_TRAINING_STAGE_SCRAMBLED_ONES_AT_1200:
|
||||
track_carrier(s, &z, &v22bis_constellation[nearest]);
|
||||
tune_equalizer(s, &z, &v22bis_constellation[nearest]);
|
||||
target = &z;
|
||||
target = &v22bis_constellation[nearest];
|
||||
track_carrier(s, &z, target);
|
||||
tune_equalizer(s, &z, target);
|
||||
raw_bits = phase_steps[((nearest >> 2) - (s->rx.constellation_state >> 2)) & 3];
|
||||
switch (raw_bits)
|
||||
{
|
||||
case 0:
|
||||
s->rx.detected_unscrambled_zeros++;
|
||||
break;
|
||||
case 3:
|
||||
s->rx.detected_unscrambled_ones++;
|
||||
break;
|
||||
default:
|
||||
s->rx.detected_2400bps_markers++;
|
||||
break;
|
||||
}
|
||||
bitstream = decode_baudx(s, nearest);
|
||||
s->rx.scrambled_ones_to_date += ones[bitstream];
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "S11 0x%02x 0x%02x 0x%X %d %d %d %d %d %d\n", raw_bits, nearest, bitstream, s->rx.scrambled_ones_to_date, s->rx.detected_unscrambled_ones, s->rx.detected_unscrambled_zeros, s->rx.detected_2400bps_markers, s->rx.training_count, s->rx.detected_2400bps_markers);
|
||||
if (s->rx.detected_2400bps_markers && ++s->rx.training_count > ms_to_symbols(270))
|
||||
s->rx.training_count++;
|
||||
//span_log(&s->logging, SPAN_LOG_FLOW, "S11 0x%02x 0x%02x 0x%X %d %d %d %d %d\n", raw_bits, nearest, bitstream, s->rx.scrambled_ones_to_date, 0, 0, 0, s->rx.training_count);
|
||||
if (s->negotiated_bit_rate == 1200)
|
||||
{
|
||||
if (!s->caller)
|
||||
/* Search for the S1 signal */
|
||||
if ((s->rx.last_raw_bits ^ raw_bits) == 0x3)
|
||||
{
|
||||
if (s->bit_rate == 2400 && s->rx.detected_2400bps_markers > 20)
|
||||
s->rx.pattern_repeats++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (s->rx.pattern_repeats >= 15 && (s->rx.last_raw_bits == 0x3 || s->rx.last_raw_bits == 0x0))
|
||||
{
|
||||
/* Try to establish at 2400bps */
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "+++ starting U0011 (S1) (Answerer)\n");
|
||||
s->tx.training = V22BIS_TX_TRAINING_STAGE_U0011;
|
||||
/* We should get a full run of 00 11 (about 60 bauds) at the calling modem, but only about 20
|
||||
at the answering modem, as the first 40 are TED settling time. */
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "+++ S1 detected at %d\n", s->rx.pattern_repeats);
|
||||
if (s->bit_rate == 2400)
|
||||
{
|
||||
if (!s->caller)
|
||||
{
|
||||
/* Accept establishment at 2400bps */
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "+++ starting U0011 (S1) (Answerer)\n");
|
||||
s->tx.training = V22BIS_TX_TRAINING_STAGE_U0011;
|
||||
s->tx.training_count = 0;
|
||||
}
|
||||
s->negotiated_bit_rate = 2400;
|
||||
}
|
||||
}
|
||||
s->rx.pattern_repeats = 0;
|
||||
}
|
||||
if (s->rx.training_count >= ms_to_symbols(270))
|
||||
{
|
||||
/* If we haven't seen the S1 signal by now, we are committed to be in 1200bps mode */
|
||||
if (s->caller)
|
||||
{
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "+++ Rx normal operation (1200)\n");
|
||||
/* The transmit side needs to sustain the scrambled ones for a timed period */
|
||||
s->tx.training_count = 0;
|
||||
s->tx.training = V22BIS_TX_TRAINING_STAGE_TIMED_S11;
|
||||
/* Normal reception starts immediately */
|
||||
s->rx.training = V22BIS_RX_TRAINING_STAGE_NORMAL_OPERATION;
|
||||
s->rx.carrier_track_i = 8000.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We are going to work at 1200bps. */
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "+++ [1200] starting S11 (Answerer)\n");
|
||||
s->bit_rate = 1200;
|
||||
s->tx.training = V22BIS_TX_TRAINING_STAGE_TIMED_S11;
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "+++ starting S11 (1200) (Answerer)\n");
|
||||
/* The transmit side needs to sustain the scrambled ones for a timed period */
|
||||
s->tx.training_count = 0;
|
||||
s->tx.training = V22BIS_TX_TRAINING_STAGE_TIMED_S11;
|
||||
/* The receive side needs to wait a timed period, receiving scrambled ones,
|
||||
before entering normal operation. */
|
||||
s->rx.training = V22BIS_RX_TRAINING_STAGE_SCRAMBLED_ONES_AT_1200_SUSTAINING;
|
||||
}
|
||||
}
|
||||
s->rx.training = V22BIS_RX_TRAINING_STAGE_SCRAMBLED_ONES_AT_1200_SUSTAINING;
|
||||
}
|
||||
break;
|
||||
case V22BIS_RX_TRAINING_STAGE_SCRAMBLED_ONES_AT_1200_SUSTAINING:
|
||||
track_carrier(s, &z, &v22bis_constellation[nearest]);
|
||||
tune_equalizer(s, &z, &v22bis_constellation[nearest]);
|
||||
target = &z;
|
||||
raw_bits = phase_steps[((nearest >> 2) - (s->rx.constellation_state >> 2)) & 3];
|
||||
switch (raw_bits)
|
||||
{
|
||||
case 0:
|
||||
s->rx.detected_unscrambled_zeros++;
|
||||
break;
|
||||
case 3:
|
||||
s->rx.detected_unscrambled_ones++;
|
||||
break;
|
||||
default:
|
||||
s->rx.detected_2400bps_markers++;
|
||||
break;
|
||||
}
|
||||
bitstream = decode_baudx(s, nearest);
|
||||
s->rx.scrambled_ones_to_date += ones[bitstream];
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "S11 0x%02x 0x%02x 0x%X %d %d %d %d %d sustain\n", raw_bits, nearest, bitstream, s->rx.scrambled_ones_to_date, s->rx.detected_unscrambled_ones, s->rx.detected_unscrambled_zeros, s->rx.detected_2400bps_markers, s->rx.training_count);
|
||||
if (s->rx.detected_2400bps_markers == 20)
|
||||
{
|
||||
/* It looks like we have the S1 (Unscrambled 00 11) section, so 2400bps
|
||||
operation is possible. */
|
||||
s->rx.detected_2400bps_markers++;
|
||||
if (s->bit_rate == 2400)
|
||||
{
|
||||
/* We are allowed to use 2400bps, and the far end is requesting 2400bps. Result: we are going to
|
||||
work at 2400bps */
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "+++ [2400] starting U0011 (S1)\n");
|
||||
s->tx.training = V22BIS_TX_TRAINING_STAGE_U0011;
|
||||
s->tx.training_count = 0;
|
||||
}
|
||||
}
|
||||
if (++s->rx.training_count > ms_to_symbols(270 + 765))
|
||||
else
|
||||
{
|
||||
if (s->caller)
|
||||
{
|
||||
if (s->bit_rate == 2400)
|
||||
if (s->rx.training_count >= ms_to_symbols(100 + 450))
|
||||
{
|
||||
/* We've continued for a further 756+-10ms. This should have given the other
|
||||
side enough time to train its equaliser. */
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "+++ starting S1111 (B)\n");
|
||||
s->tx.training = V22BIS_TX_TRAINING_STAGE_S1111;
|
||||
s->tx.training_count = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "+++ Tx normal operation (1200)\n");
|
||||
s->tx.training = V22BIS_TX_TRAINING_STAGE_NORMAL_OPERATION;
|
||||
s->tx.training_count = 0;
|
||||
s->tx.current_get_bit = s->get_bit;
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "+++ starting 16 way decisions (caller)\n");
|
||||
s->rx.sixteen_way_decisions = TRUE;
|
||||
s->rx.training = V22BIS_RX_TRAINING_STAGE_WAIT_FOR_SCRAMBLED_ONES_AT_2400;
|
||||
s->rx.pattern_repeats = 0;
|
||||
s->rx.carrier_track_i = 8000.0f;
|
||||
}
|
||||
}
|
||||
if (s->bit_rate == 2400)
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "+++ Rx normal operation (2400)\n");
|
||||
else
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "+++ Rx normal operation (1200)\n");
|
||||
{
|
||||
if (s->rx.training_count >= ms_to_symbols(450))
|
||||
{
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "+++ starting 16 way decisions (answerer)\n");
|
||||
s->rx.sixteen_way_decisions = TRUE;
|
||||
s->rx.training = V22BIS_RX_TRAINING_STAGE_WAIT_FOR_SCRAMBLED_ONES_AT_2400;
|
||||
s->rx.pattern_repeats = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case V22BIS_RX_TRAINING_STAGE_SCRAMBLED_ONES_AT_1200_SUSTAINING:
|
||||
target = &v22bis_constellation[nearest];
|
||||
track_carrier(s, &z, target);
|
||||
tune_equalizer(s, &z, target);
|
||||
bitstream = decode_baudx(s, nearest);
|
||||
if (++s->rx.training_count > ms_to_symbols(270 + 765))
|
||||
{
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "+++ Rx normal operation (1200)\n");
|
||||
s->rx.training = V22BIS_RX_TRAINING_STAGE_NORMAL_OPERATION;
|
||||
}
|
||||
if (s->bit_rate == 2400 && s->rx.training_count == ms_to_symbols(450))
|
||||
break;
|
||||
case V22BIS_RX_TRAINING_STAGE_WAIT_FOR_SCRAMBLED_ONES_AT_2400:
|
||||
target = &v22bis_constellation[nearest];
|
||||
track_carrier(s, &z, target);
|
||||
tune_equalizer(s, &z, target);
|
||||
bitstream = decode_baudx(s, nearest);
|
||||
/* We need 32 sustained 1's to switch into normal operation. */
|
||||
if (bitstream == 0xF)
|
||||
{
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "+++ starting 16 way decisions\n");
|
||||
s->rx.sixteen_way_decisions = TRUE;
|
||||
if (++s->rx.pattern_repeats >= 9)
|
||||
{
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "+++ Rx normal operation (2400)\n");
|
||||
s->rx.training = V22BIS_RX_TRAINING_STAGE_NORMAL_OPERATION;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
s->rx.pattern_repeats = 0;
|
||||
}
|
||||
break;
|
||||
case V22BIS_RX_TRAINING_STAGE_PARKED:
|
||||
@@ -674,6 +680,7 @@ span_log(&s->logging, SPAN_LOG_FLOW, "S11 0x%02x 0x%02x 0x%X %d %d %d %d %d sust
|
||||
target = &z;
|
||||
break;
|
||||
}
|
||||
s->rx.last_raw_bits = raw_bits;
|
||||
if (s->rx.qam_report)
|
||||
s->rx.qam_report(s->rx.qam_user_data, &z, target, s->rx.constellation_state);
|
||||
}
|
||||
@@ -721,8 +728,8 @@ SPAN_DECLARE(int) v22bis_rx(v22bis_state_t *s, const int16_t amp[], int len)
|
||||
/* Look for power below the carrier off point */
|
||||
if (power < s->rx.carrier_off_power)
|
||||
{
|
||||
v22bis_rx_restart(s, s->bit_rate);
|
||||
report_status_change(s, SIG_STATUS_CARRIER_DOWN);
|
||||
v22bis_restart(s, s->bit_rate);
|
||||
v22bis_report_status_change(s, SIG_STATUS_CARRIER_DOWN);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -732,7 +739,7 @@ SPAN_DECLARE(int) v22bis_rx(v22bis_state_t *s, const int16_t amp[], int len)
|
||||
if (power < s->rx.carrier_on_power)
|
||||
continue;
|
||||
s->rx.signal_present = TRUE;
|
||||
report_status_change(s, SIG_STATUS_CARRIER_UP);
|
||||
v22bis_report_status_change(s, SIG_STATUS_CARRIER_UP);
|
||||
}
|
||||
if (s->rx.training != V22BIS_RX_TRAINING_STAGE_PARKED)
|
||||
{
|
||||
@@ -813,11 +820,8 @@ SPAN_DECLARE(int) v22bis_rx_fillin(v22bis_state_t *s, int len)
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
SPAN_DECLARE(int) v22bis_rx_restart(v22bis_state_t *s, int bit_rate)
|
||||
int v22bis_rx_restart(v22bis_state_t *s)
|
||||
{
|
||||
/* If bit_rate is 2400, the real bit rate is negotiated. If bit_rate
|
||||
is 1200, the real bit rate is forced to 1200. */
|
||||
s->bit_rate = bit_rate;
|
||||
vec_zerof(s->rx.rrc_filter, sizeof(s->rx.rrc_filter)/sizeof(s->rx.rrc_filter[0]));
|
||||
s->rx.rrc_filter_step = 0;
|
||||
s->rx.scramble_reg = 0;
|
||||
@@ -837,19 +841,24 @@ SPAN_DECLARE(int) v22bis_rx_restart(v22bis_state_t *s, int bit_rate)
|
||||
|
||||
equalizer_reset(s);
|
||||
|
||||
s->rx.detected_unscrambled_ones = 0;
|
||||
s->rx.detected_unscrambled_zeros = 0;
|
||||
s->rx.detected_2400bps_markers = 0;
|
||||
s->rx.pattern_repeats = 0;
|
||||
s->rx.last_raw_bits = 0;
|
||||
s->rx.gardner_integrate = 0;
|
||||
s->rx.gardner_step = 256;
|
||||
s->rx.baud_phase = 0;
|
||||
s->rx.carrier_track_i = 8000.0f;
|
||||
s->rx.training_error = 0.0f;
|
||||
s->rx.total_baud_timing_correction = 0;
|
||||
/* We want the carrier to pull in faster on the answerer side, as it has very little time to adapt. */
|
||||
s->rx.carrier_track_i = (s->caller) ? 8000.0f : 40000.0f;
|
||||
s->rx.carrier_track_p = 8000000.0f;
|
||||
|
||||
s->negotiated_bit_rate = 1200;
|
||||
|
||||
return 0;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
SPAN_DECLARE(void) v22bis_set_qam_report_handler(v22bis_state_t *s, qam_report_handler_t handler, void *user_data)
|
||||
SPAN_DECLARE(void) v22bis_rx_set_qam_report_handler(v22bis_state_t *s, qam_report_handler_t handler, void *user_data)
|
||||
{
|
||||
s->rx.qam_report = handler;
|
||||
s->rx.qam_user_data = user_data;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* License along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Id: v22bis_tx.c,v 1.56 2009/04/17 14:37:52 steveu Exp $
|
||||
* $Id: v22bis_tx.c,v 1.61 2009/04/25 10:18:50 steveu Exp $
|
||||
*/
|
||||
|
||||
/*! \file */
|
||||
@@ -294,12 +294,13 @@ static __inline__ int scramble(v22bis_state_t *s, int bit)
|
||||
bit ^= 1;
|
||||
s->tx.scrambler_pattern_count = 0;
|
||||
}
|
||||
out_bit = (bit ^ (s->tx.scramble_reg >> 14) ^ (s->tx.scramble_reg >> 17)) & 1;
|
||||
out_bit = (bit ^ (s->tx.scramble_reg >> 13) ^ (s->tx.scramble_reg >> 16)) & 1;
|
||||
s->tx.scramble_reg = (s->tx.scramble_reg << 1) | out_bit;
|
||||
|
||||
if (out_bit == 1)
|
||||
s->tx.scrambler_pattern_count++;
|
||||
else
|
||||
s->tx.scrambler_pattern_count = 0;
|
||||
s->tx.scramble_reg = (s->tx.scramble_reg << 1) | out_bit;
|
||||
return out_bit;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
@@ -308,7 +309,7 @@ static __inline__ int get_scrambled_bit(v22bis_state_t *s)
|
||||
{
|
||||
int bit;
|
||||
|
||||
if ((bit = s->tx.current_get_bit(s->user_data)) == SIG_STATUS_END_OF_DATA)
|
||||
if ((bit = s->tx.current_get_bit(s->get_bit_user_data)) == SIG_STATUS_END_OF_DATA)
|
||||
{
|
||||
/* Fill out this symbol with ones, and prepare to send
|
||||
the rest of the shutdown sequence. */
|
||||
@@ -334,8 +335,8 @@ static complexf_t training_get(v22bis_state_t *s)
|
||||
{
|
||||
/* Initial 75ms of silence is over */
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "+++ starting U11 1200\n");
|
||||
s->tx.training = V22BIS_TX_TRAINING_STAGE_U11;
|
||||
s->tx.training_count = 0;
|
||||
s->tx.training = V22BIS_TX_TRAINING_STAGE_U11;
|
||||
}
|
||||
/* Fall through */
|
||||
case V22BIS_TX_TRAINING_STAGE_INITIAL_SILENCE:
|
||||
@@ -353,37 +354,40 @@ static complexf_t training_get(v22bis_state_t *s)
|
||||
/* Continuous unscrambled double dibit 00 11 at 1200bps. This is termed the S1 segment in
|
||||
the V.22bis spec. It is only sent to request or accept 2400bps mode, and lasts 100+-3ms. After this
|
||||
timed burst, we unconditionally change to sending scrambled ones at 1200bps. */
|
||||
s->tx.constellation_state = (s->tx.constellation_state + phase_steps[(s->tx.training_count & 1) ? 3 : 0]) & 3;
|
||||
s->tx.constellation_state = (s->tx.constellation_state + phase_steps[3*(s->tx.training_count & 1)]) & 3;
|
||||
z = v22bis_constellation[(s->tx.constellation_state << 2) | 0x01];
|
||||
if (++s->tx.training_count >= ms_to_symbols(100))
|
||||
{
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "+++ starting S11 after U0011\n");
|
||||
if (s->caller)
|
||||
{
|
||||
s->tx.training_count = 0;
|
||||
s->tx.training = V22BIS_TX_TRAINING_STAGE_S11;
|
||||
}
|
||||
else
|
||||
{
|
||||
s->tx.training_count = ms_to_symbols(756 - (600 - 100));
|
||||
s->tx.training = V22BIS_TX_TRAINING_STAGE_TIMED_S11;
|
||||
s->tx.training_count = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case V22BIS_TX_TRAINING_STAGE_TIMED_S11:
|
||||
/* A timed period of scrambled ones at 1200bps. */
|
||||
if (!s->caller)
|
||||
if (++s->tx.training_count >= ms_to_symbols(756))
|
||||
{
|
||||
if (++s->tx.training_count >= ms_to_symbols(756))
|
||||
if (s->negotiated_bit_rate == 2400)
|
||||
{
|
||||
if (s->bit_rate == 2400)
|
||||
{
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "+++ starting S1111 (C)\n");
|
||||
s->tx.training = V22BIS_TX_TRAINING_STAGE_S1111;
|
||||
s->tx.training_count = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "+++ Tx normal operation (1200)\n");
|
||||
s->tx.training = V22BIS_TX_TRAINING_STAGE_NORMAL_OPERATION;
|
||||
s->tx.training_count = 0;
|
||||
s->tx.current_get_bit = s->get_bit;
|
||||
}
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "+++ starting S1111 (C)\n");
|
||||
s->tx.training_count = 0;
|
||||
s->tx.training = V22BIS_TX_TRAINING_STAGE_S1111;
|
||||
}
|
||||
else
|
||||
{
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "+++ Tx normal operation (1200)\n");
|
||||
s->tx.training_count = 0;
|
||||
s->tx.training = V22BIS_TX_TRAINING_STAGE_NORMAL_OPERATION;
|
||||
v22bis_report_status_change(s, SIG_STATUS_TRAINING_SUCCEEDED);
|
||||
s->tx.current_get_bit = s->get_bit;
|
||||
}
|
||||
}
|
||||
/* Fall through */
|
||||
@@ -406,8 +410,9 @@ static complexf_t training_get(v22bis_state_t *s)
|
||||
{
|
||||
/* We have completed training. Now handle some real work. */
|
||||
span_log(&s->logging, SPAN_LOG_FLOW, "+++ Tx normal operation (2400)\n");
|
||||
s->tx.training = V22BIS_TX_TRAINING_STAGE_NORMAL_OPERATION;
|
||||
s->tx.training_count = 0;
|
||||
s->tx.training = V22BIS_TX_TRAINING_STAGE_NORMAL_OPERATION;
|
||||
v22bis_report_status_change(s, SIG_STATUS_TRAINING_SUCCEEDED);
|
||||
s->tx.current_get_bit = s->get_bit;
|
||||
}
|
||||
break;
|
||||
@@ -442,7 +447,7 @@ static complexf_t getbaud(v22bis_state_t *s)
|
||||
bits = get_scrambled_bit(s);
|
||||
bits = (bits << 1) | get_scrambled_bit(s);
|
||||
s->tx.constellation_state = (s->tx.constellation_state + phase_steps[bits]) & 3;
|
||||
if (s->bit_rate == 1200)
|
||||
if (s->negotiated_bit_rate == 1200)
|
||||
{
|
||||
bits = 0x01;
|
||||
}
|
||||
@@ -525,9 +530,8 @@ SPAN_DECLARE(void) v22bis_tx_power(v22bis_state_t *s, float power)
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
static int v22bis_tx_restart(v22bis_state_t *s, int bit_rate)
|
||||
static int v22bis_tx_restart(v22bis_state_t *s)
|
||||
{
|
||||
s->bit_rate = bit_rate;
|
||||
cvec_zerof(s->tx.rrc_filter, sizeof(s->tx.rrc_filter)/sizeof(s->tx.rrc_filter[0]));
|
||||
s->tx.rrc_filter_step = 0;
|
||||
s->tx.scramble_reg = 0;
|
||||
@@ -550,14 +554,14 @@ static int v22bis_tx_restart(v22bis_state_t *s, int bit_rate)
|
||||
SPAN_DECLARE(void) v22bis_set_get_bit(v22bis_state_t *s, get_bit_func_t get_bit, void *user_data)
|
||||
{
|
||||
s->get_bit = get_bit;
|
||||
s->user_data = user_data;
|
||||
s->get_bit_user_data = user_data;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
SPAN_DECLARE(void) v22bis_set_put_bit(v22bis_state_t *s, put_bit_func_t put_bit, void *user_data)
|
||||
{
|
||||
s->put_bit = put_bit;
|
||||
s->user_data = user_data;
|
||||
s->put_bit_user_data = user_data;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
@@ -576,11 +580,40 @@ SPAN_DECLARE(logging_state_t *) v22bis_get_logging_state(v22bis_state_t *s)
|
||||
|
||||
SPAN_DECLARE(int) v22bis_restart(v22bis_state_t *s, int bit_rate)
|
||||
{
|
||||
if (bit_rate != 2400 && bit_rate != 1200)
|
||||
switch (bit_rate)
|
||||
{
|
||||
case 2400:
|
||||
case 1200:
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
if (v22bis_tx_restart(s, bit_rate))
|
||||
}
|
||||
s->bit_rate = bit_rate;
|
||||
s->negotiated_bit_rate = 1200;
|
||||
if (v22bis_tx_restart(s))
|
||||
return -1;
|
||||
return v22bis_rx_restart(s, bit_rate);
|
||||
return v22bis_rx_restart(s);
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
SPAN_DECLARE(int) v22bis_request_retrain(v22bis_state_t *s, int bit_rate)
|
||||
{
|
||||
switch (bit_rate)
|
||||
{
|
||||
case 2400:
|
||||
case 1200:
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
/* TODO: Implement retrain and bit rate change */
|
||||
return -1;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
SPAN_DECLARE(int) v22bis_current_bit_rate(v22bis_state_t *s)
|
||||
{
|
||||
return s->negotiated_bit_rate;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
@@ -589,9 +622,18 @@ SPAN_DECLARE(v22bis_state_t *) v22bis_init(v22bis_state_t *s,
|
||||
int guard,
|
||||
int caller,
|
||||
get_bit_func_t get_bit,
|
||||
void *get_bit_user_data,
|
||||
put_bit_func_t put_bit,
|
||||
void *user_data)
|
||||
void *put_bit_user_data)
|
||||
{
|
||||
switch (bit_rate)
|
||||
{
|
||||
case 2400:
|
||||
case 1200:
|
||||
break;
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
if (s == NULL)
|
||||
{
|
||||
if ((s = (v22bis_state_t *) malloc(sizeof(*s))) == NULL)
|
||||
@@ -604,8 +646,9 @@ SPAN_DECLARE(v22bis_state_t *) v22bis_init(v22bis_state_t *s,
|
||||
s->caller = caller;
|
||||
|
||||
s->get_bit = get_bit;
|
||||
s->get_bit_user_data = get_bit_user_data;
|
||||
s->put_bit = put_bit;
|
||||
s->user_data = user_data;
|
||||
s->put_bit_user_data = put_bit_user_data;
|
||||
|
||||
if (s->caller)
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* License along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Id: v27ter_rx.c,v 1.125 2009/04/20 16:36:36 steveu Exp $
|
||||
* $Id: v27ter_rx.c,v 1.126 2009/04/21 13:59:07 steveu Exp $
|
||||
*/
|
||||
|
||||
/*! \file */
|
||||
@@ -1145,6 +1145,14 @@ SPAN_DECLARE(int) v27ter_rx_restart(v27ter_rx_state_t *s, int bit_rate, int old_
|
||||
|
||||
SPAN_DECLARE(v27ter_rx_state_t *) v27ter_rx_init(v27ter_rx_state_t *s, int bit_rate, put_bit_func_t put_bit, void *user_data)
|
||||
{
|
||||
switch (bit_rate)
|
||||
{
|
||||
case 4800:
|
||||
case 2400:
|
||||
break;
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
if (s == NULL)
|
||||
{
|
||||
if ((s = (v27ter_rx_state_t *) malloc(sizeof(*s))) == NULL)
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* License along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Id: v27ter_tx.c,v 1.74 2009/04/12 04:20:01 steveu Exp $
|
||||
* $Id: v27ter_tx.c,v 1.75 2009/04/21 13:59:07 steveu Exp $
|
||||
*/
|
||||
|
||||
/*! \file */
|
||||
@@ -412,6 +412,14 @@ SPAN_DECLARE(int) v27ter_tx_restart(v27ter_tx_state_t *s, int bit_rate, int tep)
|
||||
|
||||
SPAN_DECLARE(v27ter_tx_state_t *) v27ter_tx_init(v27ter_tx_state_t *s, int bit_rate, int tep, get_bit_func_t get_bit, void *user_data)
|
||||
{
|
||||
switch (bit_rate)
|
||||
{
|
||||
case 4800:
|
||||
case 2400:
|
||||
break;
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
if (s == NULL)
|
||||
{
|
||||
if ((s = (v27ter_tx_state_t *) malloc(sizeof(*s))) == NULL)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* License along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Id: v29rx.c,v 1.163 2009/04/20 16:36:36 steveu Exp $
|
||||
* $Id: v29rx.c,v 1.164 2009/04/21 13:59:07 steveu Exp $
|
||||
*/
|
||||
|
||||
/*! \file */
|
||||
@@ -1156,14 +1156,22 @@ SPAN_DECLARE(int) v29_rx_restart(v29_rx_state_t *s, int bit_rate, int old_train)
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
SPAN_DECLARE(v29_rx_state_t *) v29_rx_init(v29_rx_state_t *s, int rate, put_bit_func_t put_bit, void *user_data)
|
||||
SPAN_DECLARE(v29_rx_state_t *) v29_rx_init(v29_rx_state_t *s, int bit_rate, put_bit_func_t put_bit, void *user_data)
|
||||
{
|
||||
switch (bit_rate)
|
||||
{
|
||||
case 9600:
|
||||
case 7200:
|
||||
case 4800:
|
||||
break;
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
if (s == NULL)
|
||||
{
|
||||
if ((s = (v29_rx_state_t *) malloc(sizeof(*s))) == NULL)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memset(s, 0, sizeof(*s));
|
||||
span_log_init(&s->logging, SPAN_LOG_NONE, NULL);
|
||||
span_log_set_protocol(&s->logging, "V.29 RX");
|
||||
@@ -1176,7 +1184,7 @@ SPAN_DECLARE(v29_rx_state_t *) v29_rx_init(v29_rx_state_t *s, int rate, put_bit_
|
||||
/* The thresholds should be on at -26dBm0 and off at -31dBm0 */
|
||||
v29_rx_signal_cutoff(s, -28.5f);
|
||||
|
||||
v29_rx_restart(s, rate, FALSE);
|
||||
v29_rx_restart(s, bit_rate, FALSE);
|
||||
return s;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* License along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Id: v29tx.c,v 1.87 2009/04/12 04:20:01 steveu Exp $
|
||||
* $Id: v29tx.c,v 1.88 2009/04/21 13:59:07 steveu Exp $
|
||||
*/
|
||||
|
||||
/*! \file */
|
||||
@@ -368,6 +368,15 @@ SPAN_DECLARE(int) v29_tx_restart(v29_tx_state_t *s, int bit_rate, int tep)
|
||||
|
||||
SPAN_DECLARE(v29_tx_state_t *) v29_tx_init(v29_tx_state_t *s, int bit_rate, int tep, get_bit_func_t get_bit, void *user_data)
|
||||
{
|
||||
switch (bit_rate)
|
||||
{
|
||||
case 9600:
|
||||
case 7200:
|
||||
case 4800:
|
||||
break;
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
if (s == NULL)
|
||||
{
|
||||
if ((s = (v29_tx_state_t *) malloc(sizeof(*s))) == NULL)
|
||||
|
||||
Reference in new issue
Block a user