like the quirks we used to get using those with C++ have gone away.
AC_CHECK_HEADERS([socket.h])
AC_CHECK_HEADERS([inttypes.h], [INSERT_INTTYPES_HEADER="#include <inttypes.h>"])
AC_CHECK_HEADERS([stdint.h], [INSERT_STDINT_HEADER="#include <stdint.h>"])
+AC_CHECK_HEADERS([stdatomic.h])
+AC_CHECK_HEADERS([stdbool.h], [INSERT_STDBOOL_HEADER="#include <stdbool.h>"], [INSERT_STDBOOL_HEADER="#include <spandsp/stdbool.h>"])
+AC_CHECK_HEADERS([stdfix.h])
AC_CHECK_HEADERS([unistd.h])
AC_CHECK_HEADERS([stdlib.h])
AC_CHECK_HEADERS([string.h])
AC_SUBST(INSERT_STDINT_HEADER)
AC_SUBST(INSERT_TGMATH_HEADER)
AC_SUBST(INSERT_MATH_HEADER)
+AC_SUBST(INSERT_STDBOOL_HEADER)
AC_CONFIG_FILES([Makefile
doc/Makefile
spandsp/queue.h \
spandsp/saturated.h \
spandsp/schedule.h \
+ spandsp/stdbool.h \
spandsp/sig_tone.h \
spandsp/silence_gen.h \
spandsp/super_tone_rx.h \
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include <memory.h>
#include <string.h>
#define TONE_TO_TOTAL_ENERGY 45.2233f /* -0.85dB [GOERTZEL_SAMPLES_PER_BLOCK*10^(-0.85/10.0)] */
#endif
-static int tone_rx_init = FALSE;
+static int tone_rx_init = false;
static goertzel_descriptor_t tone_1400_desc;
static goertzel_descriptor_t tone_2300_desc;
case 0:
if (!s->clear_to_send)
return 0;
- s->clear_to_send = FALSE;
+ s->clear_to_send = false;
s->step++;
s->remaining_samples = ms_to_samples(250);
/* Fall through */
samples = dtmf_tx(&s->dtmf, &[sample], max_samples - sample);
if (samples == 0)
{
- s->clear_to_send = FALSE;
+ s->clear_to_send = false;
s->step = 0;
return sample;
}
s->callback(s->callback_user_data, -1, 0, 0);
s->tone_state = 4;
/* Release the transmit side, and it will time the 250ms post tone delay */
- s->clear_to_send = TRUE;
+ s->clear_to_send = true;
s->tries = 0;
if (s->tx_digits_len)
s->timer = ms_to_samples(3000);
case 5:
if (hit == 0)
{
- s->busy = FALSE;
+ s->busy = false;
if (s->duration < ms_to_samples(400) || s->duration > ms_to_samples(1500))
{
span_log(&s->logging, SPAN_LOG_FLOW, "Bad kissoff duration %d\n", s->duration);
{
s->timer = 0;
if (s->callback)
- s->callback(s->callback_user_data, FALSE, 0, 0);
+ s->callback(s->callback_user_data, false, 0, 0);
}
}
else
{
span_log(&s->logging, SPAN_LOG_FLOW, "Received good kissoff\n");
- s->clear_to_send = TRUE;
+ s->clear_to_send = true;
s->tx_digits_len = 0;
if (s->callback)
- s->callback(s->callback_user_data, TRUE, 0, 0);
+ s->callback(s->callback_user_data, true, 0, 0);
s->tone_state = 4;
- s->clear_to_send = TRUE;
+ s->clear_to_send = true;
s->tries = 0;
if (s->tx_digits_len)
s->timer = ms_to_samples(3000);
{
s->timer = 0;
if (s->callback)
- s->callback(s->callback_user_data, FALSE, 0, 0);
+ s->callback(s->callback_user_data, false, 0, 0);
}
}
}
return -1;
if ((s->tx_digits_len = encode_msg(s->tx_digits, report)) < 0)
return -1;
- s->busy = TRUE;
+ s->busy = true;
return dtmf_tx_put(&s->dtmf, s->tx_digits, s->tx_digits_len);
}
/*- End of function --------------------------------------------------------*/
{
make_goertzel_descriptor(&tone_1400_desc, 1400.0f, GOERTZEL_SAMPLES_PER_BLOCK);
make_goertzel_descriptor(&tone_2300_desc, 2300.0f, GOERTZEL_SAMPLES_PER_BLOCK);
- tone_rx_init = TRUE;
+ tone_rx_init = true;
}
goertzel_init(&s->tone_1400, &tone_1400_desc);
goertzel_init(&s->tone_2300, &tone_2300_desc);
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include <assert.h>
#include "spandsp/private/queue.h"
#include "spandsp/private/tone_generate.h"
#include "spandsp/private/async.h"
+#include "spandsp/private/power_meter.h"
#include "spandsp/private/fsk.h"
#include "spandsp/private/dtmf.h"
#include "spandsp/private/adsi.h"
if (s->tx_signal_on)
{
/* The FSK should now be switched off. */
- s->tx_signal_on = FALSE;
+ s->tx_signal_on = false;
s->msg_len = 0;
}
}
if (s->tx_signal_on)
{
/* The FSK should now be switched off. */
- s->tx_signal_on = FALSE;
+ s->tx_signal_on = false;
s->msg_len = 0;
}
return 0x1F;
break;
case ADSI_STANDARD_TDD:
fsk_tx_init(&s->fsktx, &preset_fsk_specs[FSK_WEITBRECHT_4545], async_tx_get_bit, &s->asynctx);
- async_tx_init(&s->asynctx, 5, ASYNC_PARITY_NONE, 2, FALSE, adsi_tdd_get_async_byte, s);
+ async_tx_init(&s->asynctx, 5, ASYNC_PARITY_NONE, 2, false, adsi_tdd_get_async_byte, s);
/* Schedule an explicit shift at the start of baudot transmission */
s->baudot_shift = 2;
break;
}
- s->tx_signal_on = TRUE;
+ s->tx_signal_on = true;
}
/*- End of function --------------------------------------------------------*/
if (len < max_len)
{
if ((lenx = fsk_tx(&s->fsktx, amp + len, max_len - len)) <= 0)
- s->tx_signal_on = FALSE;
+ s->tx_signal_on = false;
len += lenx;
}
break;
60,
0,
0,
- FALSE);
+ false);
s->standard = standard;
adsi_tx_set_preamble(s, -1, -1, -1, -1);
span_log_init(&s->logging, SPAN_LOG_NONE, NULL);
#include <stdio.h>
#include <stdarg.h>
#include <fcntl.h>
+#if !defined(__USE_ISOC11)
#define __USE_ISOC11
+#endif
#include <stdlib.h>
#if defined(HAVE_MALLOC_H)
#include <malloc.h>
#include "spandsp/telephony.h"
#include "spandsp/alloc.h"
-static void *fake_aligned_alloc(size_t alignment, size_t size);
-
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4232) /* address of dllimport is not static, identity not guaranteed */
#endif
-span_alloc_t __span_alloc = malloc;
#if defined(HAVE_ALIGNED_ALLOC)
-span_aligned_alloc_t __span_aligned_alloc = aligned_alloc;
+static span_aligned_alloc_t __span_aligned_alloc = aligned_alloc;
#elif defined(HAVE_MEMALIGN)
-span_aligned_alloc_t __span_aligned_alloc = memalign;
+static span_aligned_alloc_t __span_aligned_alloc = memalign;
#elif defined(HAVE_POSIX_MEMALIGN)
static void *fake_posix_memalign(size_t alignment, size_t size);
-span_aligned_alloc_t __span_aligned_alloc = fake_posix_memalign;
+static span_aligned_alloc_t __span_aligned_alloc = fake_posix_memalign;
#else
-span_aligned_alloc_t __span_aligned_alloc = fake_aligned_alloc;
+static void *fake_aligned_alloc(size_t alignment, size_t size);
+static span_aligned_alloc_t __span_aligned_alloc = fake_aligned_alloc;
#endif
-span_realloc_t __span_realloc = realloc;
-span_free_t __span_free = free;
+static span_alloc_t __span_alloc = malloc;
+static span_realloc_t __span_realloc = realloc;
+static span_free_t __span_free = free;
#ifdef _MSC_VER
#pragma warning(pop)
return ptr;
}
/*- End of function --------------------------------------------------------*/
-#endif
-
+#else
static void *fake_aligned_alloc(size_t alignment, size_t size)
{
- return NULL;
+ return malloc(size);
}
/*- End of function --------------------------------------------------------*/
+#endif
-SPAN_DECLARE(void *) span_alloc(size_t size)
+SPAN_DECLARE(void *) span_aligned_alloc(size_t alignment, size_t size)
{
- return __span_alloc(size);
+ return __span_aligned_alloc(alignment, size);
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(void *) span_aligned_alloc(size_t alignment, size_t size)
+SPAN_DECLARE(void *) span_alloc(size_t size)
{
- return __span_aligned_alloc(alignment, size);
+ return __span_alloc(size);
}
/*- End of function --------------------------------------------------------*/
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(int) span_mem_allocators(span_alloc_t custom_alloc,
- span_aligned_alloc_t custom_aligned_alloc,
+SPAN_DECLARE(int) span_mem_allocators(span_aligned_alloc_t custom_aligned_alloc,
+ span_alloc_t custom_alloc,
span_realloc_t custom_realloc,
span_free_t custom_free)
{
- if (custom_alloc == NULL || custom_realloc == NULL || custom_free == NULL)
- return -1;
- __span_alloc = custom_alloc;
- if (custom_aligned_alloc)
- __span_aligned_alloc = custom_aligned_alloc;
- else
- __span_aligned_alloc = fake_aligned_alloc;
- __span_realloc = custom_realloc;
- __span_free = custom_free;
+ __span_aligned_alloc = (custom_aligned_alloc)
+ ?
+ custom_aligned_alloc
+ :
+#if defined(HAVE_ALIGNED_ALLOC)
+ aligned_alloc;
+#elif defined(HAVE_MEMALIGN)
+ memalign;
+#elif defined(HAVE_POSIX_MEMALIGN)
+ fake_posix_memalign;
+#else
+ fake_aligned_alloc;
+#endif
+ __span_alloc = (custom_alloc) ? custom_alloc : malloc;
+ __span_realloc = (custom_realloc) ? custom_realloc : realloc;
+ __span_free = (custom_free) ? custom_free : free;
return 0;
}
/*- End of function --------------------------------------------------------*/
#include <stdlib.h>
#include <string.h>
#include <assert.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "spandsp/telephony.h"
#include "spandsp/alloc.h"
int data_bits,
int parity,
int stop_bits,
- int use_v14,
+ bool use_v14,
put_byte_func_t put_byte,
void *user_data)
{
int data_bits,
int parity,
int stop_bits,
- int use_v14,
+ bool use_v14,
get_byte_func_t get_byte,
void *user_data)
{
#include <memory.h>
#include <string.h>
#include <ctype.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include <assert.h>
#include "spandsp/telephony.h"
{
{
#if defined(_MSC_VER) || defined(__sunos) || defined(__solaris) || defined(__sun)
- /*.echo =*/ TRUE,
- /*.verbose =*/ TRUE,
+ /*.echo =*/ true,
+ /*.verbose =*/ true,
/*.result_code_format =*/ ASCII_RESULT_CODES,
- /*.pulse_dial =*/ FALSE,
- /*.double_escape =*/ FALSE,
- /*.adaptive_receive =*/ FALSE,
+ /*.pulse_dial =*/ false,
+ /*.double_escape =*/ false,
+ /*.adaptive_receive =*/ false,
/*.s_regs[100] =*/ {0, 0, 0, '\r', '\n', '\b', 1, 60, 5, 0, 0}
#else
- .echo = TRUE,
- .verbose = TRUE,
+ .echo = true,
+ .verbose = true,
.result_code_format = ASCII_RESULT_CODES,
- .pulse_dial = FALSE,
- .double_escape = FALSE,
- .adaptive_receive = FALSE,
+ .pulse_dial = false,
+ .double_escape = false,
+ .adaptive_receive = false,
.s_regs[0] = 0,
.s_regs[3] = '\r',
.s_regs[4] = '\n',
static int answer_call(at_state_t *s)
{
if (at_modem_control(s, AT_MODEM_CONTROL_ANSWER, NULL) < 0)
- return FALSE;
+ return false;
/* Answering should now be in progress. No AT response should be
issued at this point. */
- s->do_hangup = FALSE;
- return TRUE;
+ s->do_hangup = false;
+ return true;
}
/*- End of function --------------------------------------------------------*/
at_modem_control(s, AT_MODEM_CONTROL_RESTART, (void *) FAX_MODEM_NOCNG_TONE_TX);
else
at_modem_control(s, AT_MODEM_CONTROL_RESTART, (void *) FAX_MODEM_CNG_TONE_TX);
- s->dte_is_waiting = TRUE;
+ s->dte_is_waiting = true;
}
}
break;
if (s->ok_is_pending)
{
at_put_response_code(s, AT_RESPONSE_CODE_OK);
- s->ok_is_pending = FALSE;
+ s->ok_is_pending = false;
}
else
{
at_put_response_code(s, AT_RESPONSE_CODE_NO_CARRIER);
}
- s->dte_is_waiting = FALSE;
+ s->dte_is_waiting = false;
at_set_at_rx_mode(s, AT_MODE_ONHOOK_COMMAND);
}
else if (s->fclass_mode && s->rx_signal_present)
}
if (s->at_rx_mode != AT_MODE_OFFHOOK_COMMAND && s->at_rx_mode != AT_MODE_ONHOOK_COMMAND)
at_put_response_code(s, AT_RESPONSE_CODE_NO_CARRIER);
- s->rx_signal_present = FALSE;
+ s->rx_signal_present = false;
at_modem_control(s, AT_MODEM_CONTROL_RNG, (void *) 0);
at_set_at_rx_mode(s, AT_MODE_ONHOOK_COMMAND);
break;
}
s->call_id = NULL;
s->rings_indicated = 0;
- s->call_info_displayed = FALSE;
+ s->call_info_displayed = false;
}
/*- End of function --------------------------------------------------------*/
at_put_response(s, buf);
call_id = call_id->next;
}
- s->call_info_displayed = TRUE;
+ s->call_info_displayed = true;
}
/*- End of function --------------------------------------------------------*/
default:
/* Set value */
if ((val = parse_num(t, max_value)) < 0)
- return FALSE;
+ return false;
if (target)
*target = val;
break;
at_put_response(s, buf);
break;
default:
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
/*- End of function --------------------------------------------------------*/
default:
/* Set value */
if ((val1 = parse_num(t, max_value1)) < 0)
- return FALSE;
+ return false;
if (target1)
*target1 = val1;
if (**t == ',')
{
(*t)++;
if ((val2 = parse_num(t, max_value2)) < 0)
- return FALSE;
+ return false;
if (target2)
*target2 = val2;
}
at_put_response(s, buf);
break;
default:
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
/*- End of function --------------------------------------------------------*/
for (i = 0; i < entries; i++)
{
if ((val = parse_num(t, max_values[i])) < 0)
- return FALSE;
+ return false;
if (targets[i])
*targets[i] = val;
if (**t != ',')
at_put_response(s, buf);
break;
default:
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
/*- End of function --------------------------------------------------------*/
default:
/* Set value */
if ((val = parse_hex_num(t, max_value)) < 0)
- return FALSE;
+ return false;
if (target)
*target = val;
break;
at_put_response(s, buf);
break;
default:
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
/*- End of function --------------------------------------------------------*/
default:
/* Set value */
if ((val = match_element(t, def)) < 0)
- return FALSE;
+ return false;
if (target)
*target = val;
break;
at_put_response(s, buf);
break;
default:
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
/*- End of function --------------------------------------------------------*/
at_put_response(s, (*target) ? *target : "");
break;
default:
- return FALSE;
+ return false;
}
while (*t)
t++;
- return TRUE;
+ return true;
}
/*- End of function --------------------------------------------------------*/
val = -1;
if (!parse_out(s, t, &val, 255, NULL, allowed))
- return TRUE;
+ return true;
if (val < 0)
{
/* It was just a query */
- return TRUE;
+ return true;
}
/* All class 1 FAX commands are supposed to give an ERROR response, if the phone
is on-hook. */
if (s->at_rx_mode == AT_MODE_ONHOOK_COMMAND)
- return FALSE;
+ return false;
- result = TRUE;
+ result = true;
if (s->class1_handler)
result = s->class1_handler(s, s->class1_user_data, direction, operation, val);
switch (result)
case 0:
/* Inhibit an immediate response. (These commands should not be part of a multi-command entry.) */
*t = (const char *) -1;
- return TRUE;
+ return true;
case -1:
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
/*- End of function --------------------------------------------------------*/
/* V.250 6.3.1 - Dial (abortable) */
at_reset_call_info(s);
- s->do_hangup = FALSE;
- s->silent_dial = FALSE;
- s->command_dial = FALSE;
+ s->do_hangup = false;
+ s->silent_dial = false;
+ s->command_dial = false;
t += 1;
- ok = FALSE;
+ ok = false;
/* There are a numbers of options in a dial command string.
Many are completely irrelevant in this application. */
u = num;
break;
case 'T':
/* V.250 6.3.1.3 Tone dial */
- s->p.pulse_dial = FALSE;
+ s->p.pulse_dial = false;
break;
case 'P':
/* V.250 6.3.1.4 Pulse dial */
- s->p.pulse_dial = TRUE;
+ s->p.pulse_dial = true;
break;
case '!':
/* V.250 6.3.1.5 Hook flash, register recall */
break;
case '@':
/* V.250 6.3.1.7 Wait for quiet answer */
- s->silent_dial = TRUE;
+ s->silent_dial = true;
break;
case 'S':
/* V.250 6.3.1.8 Invoke stored string */
break;
case ';':
/* V.250 6.3.1 - Dial string terminator - make voice call and remain in command mode */
- s->command_dial = TRUE;
+ s->command_dial = true;
break;
case '>':
/* GSM07.07 6.2 - Direct dialling from phone book supplementary service subscription
{
/* Push out the last of the audio (probably by sending a short silence). */
at_modem_control(s, AT_MODEM_CONTROL_RESTART, (void *) FAX_MODEM_FLUSH);
- s->do_hangup = TRUE;
+ s->do_hangup = true;
at_set_at_rx_mode(s, AT_MODE_CONNECTED);
return (const char *) -1;
}
{
/* V.250 6.3.3 - Select pulse dialling (command) */
t += 1;
- s->p.pulse_dial = TRUE;
+ s->p.pulse_dial = true;
return t;
}
/*- End of function --------------------------------------------------------*/
{
/* V.250 6.3.2 - Select tone dialling (command) */
t += 1;
- s->p.pulse_dial = FALSE;
+ s->p.pulse_dial = false;
return t;
}
/*- End of function --------------------------------------------------------*/
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include "spandsp/telephony.h"
uint8_t off_time; /* Minimum post tone silence (ms) */
} mf_digit_tones_t;
-int bell_mf_gen_inited = FALSE;
+int bell_mf_gen_inited = false;
tone_gen_descriptor_t bell_mf_digit_tones[15];
-int r2_mf_gen_inited = FALSE;
+int r2_mf_gen_inited = false;
tone_gen_descriptor_t r2_mf_fwd_digit_tones[15];
tone_gen_descriptor_t r2_mf_back_digit_tones[15];
tones->off_time,
0,
0,
- FALSE);
+ false);
tones++;
}
- bell_mf_gen_inited = TRUE;
+ bell_mf_gen_inited = true;
}
/*- End of function --------------------------------------------------------*/
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(r2_mf_tx_state_t *) r2_mf_tx_init(r2_mf_tx_state_t *s, int fwd)
+SPAN_DECLARE(r2_mf_tx_state_t *) r2_mf_tx_init(r2_mf_tx_state_t *s, bool fwd)
{
int i;
const mf_digit_tones_t *tones;
(tones->off_time == 0));
tones++;
}
- r2_mf_gen_inited = TRUE;
+ r2_mf_gen_inited = true;
}
s->fwd = fwd;
return s;
void *user_data)
{
int i;
- static int initialised = FALSE;
+ static int initialised = false;
if (s == NULL)
{
{
for (i = 0; i < 6; i++)
make_goertzel_descriptor(&bell_mf_detect_desc[i], (float) bell_mf_frequencies[i], BELL_MF_SAMPLES_PER_BLOCK);
- initialised = TRUE;
+ initialised = true;
}
s->digits_callback = callback;
s->digits_callback_data = user_data;
}
}
/* Basic signal level and twist tests */
- hit = FALSE;
+ hit = false;
if (energy[best] >= R2_MF_THRESHOLD
&&
energy[second_best] >= R2_MF_THRESHOLD
energy[best]*R2_MF_TWIST > energy[second_best])
{
/* Relative peak test */
- hit = TRUE;
+ hit = true;
for (i = 0; i < 6; i++)
{
if (i != best && i != second_best)
if (energy[i]*R2_MF_RELATIVE_PEAK >= energy[second_best])
{
/* The best two are not clearly the best */
- hit = FALSE;
+ hit = false;
break;
}
}
/*- End of function --------------------------------------------------------*/
SPAN_DECLARE(r2_mf_rx_state_t *) r2_mf_rx_init(r2_mf_rx_state_t *s,
- int fwd,
+ bool fwd,
tone_report_func_t callback,
void *user_data)
{
int i;
- static int initialised = FALSE;
+ static int initialised = false;
if (s == NULL)
{
make_goertzel_descriptor(&mf_fwd_detect_desc[i], (float) r2_mf_fwd_frequencies[i], R2_MF_SAMPLES_PER_BLOCK);
make_goertzel_descriptor(&mf_back_detect_desc[i], (float) r2_mf_back_frequencies[i], R2_MF_SAMPLES_PER_BLOCK);
}
- initialised = TRUE;
+ initialised = true;
}
if (fwd)
{
#include <string.h>
#include <assert.h>
#include <time.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "spandsp/telephony.h"
#include "spandsp/alloc.h"
int i;
int j;
int sum;
- int test;
+ bool test;
/* We assess the error rate in decadic steps. For each decade we assess the error over 10 times
the number of bits, to smooth the result. This means we assess the 1 in 100 rate based on 1000 bits
(i.e. we look for >=10 errors in 1000 bits). We make an assessment every 100 bits, using a sliding
window over the last 1000 bits. We assess the 1 in 1000 rate over 10000 bits in a similar way, and
so on for the lower error rates. */
- test = TRUE;
+ test = false;
for (i = 2; i <= 7; i++)
{
if (++s->decade_ptr[i] < 10)
if (test && sum > 10)
{
/* We overflow into the next decade */
- test = FALSE;
+ test = false;
if (s->error_rate != i && s->reporter)
s->reporter(s->user_data, BERT_REPORT_GT_10_2 + i - 2, &s->results);
s->error_rate = i;
#include <stdlib.h>
#include <string.h>
#include <assert.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "spandsp/telephony.h"
#include "spandsp/alloc.h"
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include <assert.h>
#include "floating_fudge.h"
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include <assert.h>
#include "floating_fudge.h"
#include <inttypes.h>
#include <stdio.h>
#include <string.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "spandsp/telephony.h"
#include "spandsp/crc.h"
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(int) crc_itu32_check(const uint8_t *buf, int len)
+SPAN_DECLARE(bool) crc_itu32_check(const uint8_t *buf, int len)
{
uint32_t crc;
int i;
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(int) crc_itu16_check(const uint8_t *buf, int len)
+SPAN_DECLARE(bool) crc_itu16_check(const uint8_t *buf, int len)
{
uint16_t crc;
int i;
#include <stdlib.h>
#include <inttypes.h>
+#include <memory.h>
+#include <string.h>
+#include <limits.h>
#if defined(HAVE_TGMATH_H)
#include <tgmath.h>
#endif
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
-#include <memory.h>
-#include <string.h>
-#include <limits.h>
#include "spandsp/telephony.h"
#include "spandsp/alloc.h"
static const char dtmf_positions[] = "123A" "456B" "789C" "*0#D";
-static int dtmf_rx_inited = FALSE;
+static bool dtmf_rx_inited = false;
static goertzel_descriptor_t dtmf_detect_row[4];
static goertzel_descriptor_t dtmf_detect_col[4];
-static int dtmf_tx_inited = FALSE;
+static bool dtmf_tx_inited = false;
static tone_gen_descriptor_t dtmf_digit_tones[16];
SPAN_DECLARE(int) dtmf_rx(dtmf_rx_state_t *s, const int16_t amp[], int samples)
s->digits_callback_data = user_data;
s->realtime_callback = NULL;
s->realtime_callback_data = NULL;
- s->filter_dialtone = FALSE;
+ s->filter_dialtone = false;
s->normal_twist = DTMF_NORMAL_TWIST;
s->reverse_twist = DTMF_REVERSE_TWIST;
s->threshold = DTMF_THRESHOLD;
make_goertzel_descriptor(&dtmf_detect_row[i], dtmf_row[i], DTMF_SAMPLES_PER_BLOCK);
make_goertzel_descriptor(&dtmf_detect_col[i], dtmf_col[i], DTMF_SAMPLES_PER_BLOCK);
}
- dtmf_rx_inited = TRUE;
+ dtmf_rx_inited = true;
}
for (i = 0; i < 4; i++)
{
DEFAULT_DTMF_TX_OFF_TIME,
0,
0,
- FALSE);
+ false);
}
}
- dtmf_tx_inited = TRUE;
+ dtmf_tx_inited = true;
}
/*- End of function --------------------------------------------------------*/
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include <string.h>
#include <stdio.h>
#if !defined(NULL)
#define NULL (void *) 0
#endif
-#if !defined(FALSE)
-#define FALSE 0
-#endif
-#if !defined(TRUE)
-#define TRUE (!FALSE)
-#endif
#define NONUPDATE_DWELL_TIME 600 /* 600 samples, or 75ms */
ec->rx_power_threshold = 10000000;
ec->geigel_max = 0;
ec->geigel_lag = 0;
- ec->dtd_onset = FALSE;
+ ec->dtd_onset = false;
ec->tap_set = 0;
ec->tap_rotate_counter = 1600;
ec->cng_level = 1000;
ec->geigel_max = 0;
ec->geigel_lag = 0;
- ec->dtd_onset = FALSE;
+ ec->dtd_onset = false;
ec->tap_set = 0;
ec->tap_rotate_counter = 1600;
ec->narrowband_score = 0;
}
}
- ec->dtd_onset = FALSE;
+ ec->dtd_onset = false;
if (--ec->tap_rotate_counter <= 0)
{
printf("Rotate to %d at %d\n", ec->tap_set, sample_no);
for (i = 0; i < ec->taps; i++)
ec->fir_taps32[i] = ec->fir_taps16[(ec->tap_set + 1)%3][i] << 15;
ec->tap_rotate_counter = 1600;
- ec->dtd_onset = TRUE;
+ ec->dtd_onset = true;
}
ec->nonupdate_dwell = NONUPDATE_DWELL_TIME;
}
if (!ec->cng)
{
ec->cng_level = ec->clean_rx_power;
- ec->cng = TRUE;
+ ec->cng = true;
}
if ((ec->adaption_mode & ECHO_CAN_USE_CNG))
{
}
else
{
- ec->cng = FALSE;
+ ec->cng = false;
}
}
else
{
- ec->cng = FALSE;
+ ec->cng = false;
}
printf("Narrowband score %4d %5d at %d\n", ec->narrowband_score, score, sample_no);
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include <assert.h>
#include <fcntl.h>
#include "spandsp/private/logging.h"
#include "spandsp/private/silence_gen.h"
+#include "spandsp/private/power_meter.h"
#include "spandsp/private/fsk.h"
#include "spandsp/private/modem_connect_tones.h"
#include "spandsp/private/v8.h"
silence_gen_alter(&t->silence_gen, 0);
fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
fax_modems_set_next_tx_handler(t, (span_tx_handler_t) NULL, NULL);
- t->transmit = FALSE;
+ t->transmit = false;
return -1;
}
/*- End of function --------------------------------------------------------*/
t->current_rx_type = type;
t->rx_bit_rate = bit_rate;
if (use_hdlc)
- hdlc_rx_init(&t->hdlc_rx, FALSE, TRUE, HDLC_FRAMING_OK_THRESHOLD, t30_hdlc_accept, &s->t30);
+ hdlc_rx_init(&t->hdlc_rx, false, true, HDLC_FRAMING_OK_THRESHOLD, t30_hdlc_accept, &s->t30);
switch (type)
{
silence_gen_alter(&t->silence_gen, ms_to_samples(short_train));
fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
fax_modems_set_next_tx_handler(t, (span_tx_handler_t) NULL, NULL);
- t->transmit = TRUE;
+ t->transmit = true;
break;
case T30_MODEM_CED:
case T30_MODEM_CNG:
tone = (type == T30_MODEM_CED) ? FAX_MODEM_CED_TONE_TX : FAX_MODEM_CNG_TONE_TX;
fax_modems_start_slow_modem(t, tone);
fax_modems_set_next_tx_handler(t, (span_tx_handler_t) NULL, NULL);
- t->transmit = TRUE;
+ t->transmit = true;
break;
case T30_MODEM_V21:
fax_modems_start_slow_modem(t, FAX_MODEM_V21_TX);
silence_gen_alter(&t->silence_gen, ms_to_samples(75));
fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
fax_modems_set_next_tx_handler(t, (span_tx_handler_t) &fsk_tx, &t->v21_tx);
- t->transmit = TRUE;
+ t->transmit = true;
break;
case T30_MODEM_V17:
silence_gen_alter(&t->silence_gen, ms_to_samples(75));
fax_modems_start_fast_modem(t, FAX_MODEM_V17_TX, bit_rate, short_train, use_hdlc);
fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
fax_modems_set_next_tx_handler(t, (span_tx_handler_t) &v17_tx, &t->fast_modems.v17_tx);
- t->transmit = TRUE;
+ t->transmit = true;
break;
case T30_MODEM_V27TER:
silence_gen_alter(&t->silence_gen, ms_to_samples(75));
fax_modems_start_fast_modem(t, FAX_MODEM_V27TER_TX, bit_rate, short_train, use_hdlc);
fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
fax_modems_set_next_tx_handler(t, (span_tx_handler_t) &v27ter_tx, &t->fast_modems.v27ter_tx);
- t->transmit = TRUE;
+ t->transmit = true;
break;
case T30_MODEM_V29:
silence_gen_alter(&t->silence_gen, ms_to_samples(75));
fax_modems_start_fast_modem(t, FAX_MODEM_V29_TX, bit_rate, short_train, use_hdlc);
fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
fax_modems_set_next_tx_handler(t, (span_tx_handler_t) &v29_tx, &t->fast_modems.v29_tx);
- t->transmit = TRUE;
+ t->transmit = true;
break;
case T30_MODEM_DONE:
span_log(&s->logging, SPAN_LOG_FLOW, "FAX exchange complete\n");
silence_gen_alter(&t->silence_gen, 0);
fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
fax_modems_set_next_tx_handler(t, (span_tx_handler_t) NULL, NULL);
- t->transmit = FALSE;
+ t->transmit = false;
break;
}
t->tx_bit_rate = bit_rate;
span_log_init(&s->logging, SPAN_LOG_NONE, NULL);
span_log_set_protocol(&s->logging, "FAX");
fax_modems_init(&s->modems,
- FALSE,
+ false,
t30_hdlc_accept,
hdlc_underflow_handler,
t30_non_ecm_put_bit,
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include <assert.h>
#include <fcntl.h>
#include "spandsp/private/logging.h"
#include "spandsp/private/silence_gen.h"
+#include "spandsp/private/power_meter.h"
#include "spandsp/private/fsk.h"
#include "spandsp/private/v17tx.h"
#include "spandsp/private/v17rx.h"
s = (fax_modems_state_t *) user_data;
if (ok)
- s->rx_frame_received = TRUE;
+ s->rx_frame_received = false;
if (s->hdlc_accept)
s->hdlc_accept(s->hdlc_accept_user_data, msg, len, ok);
}
fsk_rx_init(&s->v21_rx, &preset_fsk_specs[FSK_V21CH2], FSK_FRAME_MODE_SYNC, (put_bit_func_t) hdlc_rx_put_bit, &s->hdlc_rx);
fax_modems_set_rx_handler(s, (span_rx_handler_t) &fsk_rx, &s->v21_rx, (span_rx_fillin_handler_t) &fsk_rx_fillin, &s->v21_rx);
fsk_rx_signal_cutoff(&s->v21_rx, -39.09f);
- s->rx_frame_received = FALSE;
+ s->rx_frame_received = false;
break;
case FAX_MODEM_CED_TONE_RX:
modem_connect_tones_rx_init(&s->connect_rx, MODEM_CONNECT_TONES_FAX_CED, s->tone_callback, s->tone_callback_user_data);
if (s->fast_modem != which)
{
s->current_rx_type = which;
- s->short_train = FALSE;
+ s->short_train = false;
s->fast_modem = which;
if (hdlc_mode)
- s->rx_frame_received = FALSE;
+ s->rx_frame_received = false;
switch (s->fast_modem)
{
case FAX_MODEM_V27TER_RX:
switch (s->fast_modem)
{
case FAX_MODEM_V27TER_RX:
- v27ter_rx_restart(&s->fast_modems.v27ter_rx, s->bit_rate, FALSE);
+ v27ter_rx_restart(&s->fast_modems.v27ter_rx, s->bit_rate, false);
v27ter_rx_set_put_bit(&s->fast_modems.v27ter_rx, put_bit, put_bit_user_data);
v27ter_rx_set_modem_status_handler(&s->fast_modems.v27ter_rx, v27ter_rx_status_handler, s);
fax_modems_set_rx_handler(s, (span_rx_handler_t) &fax_modems_v27ter_v21_rx, s, (span_rx_fillin_handler_t) &fax_modems_v27ter_v21_rx_fillin, s);
break;
case FAX_MODEM_V29_RX:
- v29_rx_restart(&s->fast_modems.v29_rx, s->bit_rate, FALSE);
+ v29_rx_restart(&s->fast_modems.v29_rx, s->bit_rate, false);
v29_rx_set_put_bit(&s->fast_modems.v29_rx, put_bit, put_bit_user_data);
v29_rx_set_modem_status_handler(&s->fast_modems.v29_rx, v29_rx_status_handler, s);
fax_modems_set_rx_handler(s, (span_rx_handler_t) &fax_modems_v29_v21_rx, s, (span_rx_fillin_handler_t) &fax_modems_v29_v21_rx_fillin, s);
s->hdlc_accept = hdlc_accept;
s->hdlc_accept_user_data = user_data;
- hdlc_rx_init(&s->hdlc_rx, FALSE, FALSE, HDLC_FRAMING_OK_THRESHOLD, fax_modems_hdlc_accept, s);
- hdlc_tx_init(&s->hdlc_tx, FALSE, 2, FALSE, hdlc_tx_underflow, user_data);
+ hdlc_rx_init(&s->hdlc_rx, false, false, HDLC_FRAMING_OK_THRESHOLD, fax_modems_hdlc_accept, s);
+ hdlc_tx_init(&s->hdlc_tx, false, 2, false, hdlc_tx_underflow, user_data);
fax_modems_start_slow_modem(s, FAX_MODEM_V21_RX);
fsk_tx_init(&s->v21_tx, &preset_fsk_specs[FSK_V21CH2], (get_bit_func_t) hdlc_tx_get_bit, &s->hdlc_tx);
silence_gen_init(&s->silence_gen, 0);
- s->rx_signal_present = FALSE;
+ s->rx_signal_present = false;
s->rx_handler = (span_rx_handler_t) &span_dummy_rx;
s->rx_fillin_handler = (span_rx_fillin_handler_t) &span_dummy_rx;
s->rx_user_data = NULL;
#include <inttypes.h>
#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <time.h>
+#include <fcntl.h>
#if defined(HAVE_TGMATH_H)
#include <tgmath.h>
#endif
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
-#include <string.h>
-#include <stdio.h>
-#include <time.h>
-#include <fcntl.h>
#include "spandsp/telephony.h"
#include "spandsp/complex.h"
#include "filter_tools.h"
-#if !defined(FALSE)
-#define FALSE 0
-#endif
-#if !defined(TRUE)
-#define TRUE (!FALSE)
-#endif
-
#define MAXPZ 8192
#define SEQ_LEN 8192
#define MAX_FFT_LEN SEQ_LEN
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include <assert.h>
#include "spandsp/async.h"
#include "spandsp/fsk.h"
+#include "spandsp/private/power_meter.h"
#include "spandsp/private/fsk.h"
const fsk_spec_t preset_fsk_specs[] =
s->baud_frac = 0;
s->current_phase_rate = s->phase_rates[1];
- s->shutdown = FALSE;
+ s->shutdown = false;
return 0;
}
/*- End of function --------------------------------------------------------*/
s->status_handler(s->status_user_data, SIG_STATUS_END_OF_DATA);
if (s->status_handler)
s->status_handler(s->status_user_data, SIG_STATUS_SHUTDOWN_COMPLETE);
- s->shutdown = TRUE;
+ s->shutdown = true;
break;
}
s->current_phase_rate = s->phase_rates[bit & 1];
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include "spandsp/telephony.h"
else
s->bits_per_sample = 8;
if ((options & G722_SAMPLE_RATE_8000))
- s->eight_k = TRUE;
+ s->eight_k = true;
if ((options & G722_PACKED) && s->bits_per_sample != 8)
- s->packed = TRUE;
+ s->packed = true;
else
- s->packed = FALSE;
+ s->packed = false;
s->band[0].det = 32;
s->band[1].det = 8;
return s;
else
s->bits_per_sample = 8;
if ((options & G722_SAMPLE_RATE_8000))
- s->eight_k = TRUE;
+ s->eight_k = true;
if ((options & G722_PACKED) && s->bits_per_sample != 8)
- s->packed = TRUE;
+ s->packed = true;
else
- s->packed = FALSE;
+ s->packed = false;
s->band[0].det = 32;
s->band[1].det = 8;
return s;
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include "spandsp/telephony.h"
int16_t thr;
int16_t pk0;
int i;
- int tr;
+ bool tr;
a2p = 0;
/* Needed in updating predictor poles */
thr = (ylint > 9) ? (31 << 10) : ((32 + ylfrac) << ylint);
dqthr = (thr + (thr >> 1)) >> 1; /* dqthr = 0.75 * thr */
if (!s->td) /* signal supposed voice */
- tr = FALSE;
+ tr = false;
else if (mag <= dqthr) /* supposed data, but small mag */
- tr = FALSE; /* treated as voice */
+ tr = false; /* treated as voice */
else /* signal is data (modem) */
- tr = TRUE;
+ tr = true;
/*
* Quantizer scale factor adaptation.
/* TONE */
if (tr) /* this sample has been treated as data */
- s->td = FALSE; /* next one will be treated as voice */
+ s->td = false; /* next one will be treated as voice */
else if (a2p < -11776) /* small sample-to-sample correlation */
- s->td = TRUE; /* signal may be data */
+ s->td = true; /* signal may be data */
else /* signal is voice */
- s->td = FALSE;
+ s->td = false;
/* Adaptation speed control. */
/* FILTA */
s->b[i] = 0;
s->dq[i] = 32;
}
- s->td = FALSE;
+ s->td = false;
switch (bit_rate)
{
case 16000:
static void weighting_filter(int16_t x[40],
const int16_t *e) // signal [-5..0.39.44] IN)
{
-#if defined(__GNUC__) && defined(SPANDSP_USE_MMX) && defined(__x86_64__) && !(defined(__APPLE_CC__) && __APPLE_CC__ >= 5448)
+#if defined(__GNUC__) && defined(SPANDSP_USE_MMX) && defined(__x86_64__)
/* Table 4.4 Coefficients of the weighting filter */
/* This must be padded to a multiple of 4 for MMX to work */
static const union
#include <inttypes.h>
#include <string.h>
#include <stdio.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "spandsp/telephony.h"
#include "spandsp/alloc.h"
if (s->status_handler)
s->status_handler(s->status_user_data, status);
else if (s->frame_handler)
- s->frame_handler(s->frame_user_data, NULL, status, TRUE);
+ s->frame_handler(s->frame_user_data, NULL, status, true);
}
/*- End of function --------------------------------------------------------*/
s->len = 0;
s->num_bits = 0;
s->flags_seen = 0;
- s->framing_ok_announced = FALSE;
+ s->framing_ok_announced = false;
/* Fall through */
case SIG_STATUS_TRAINING_IN_PROGRESS:
case SIG_STATUS_TRAINING_FAILED:
}
else
{
- s->octet_counting_mode = TRUE;
+ s->octet_counting_mode = true;
s->octet_count = s->octet_count_report_interval;
}
}
{
/* Hit HDLC flag */
/* A flag clears octet counting */
- s->octet_counting_mode = FALSE;
+ s->octet_counting_mode = false;
if (s->flags_seen >= s->framing_ok_threshold)
{
/* We may have a frame, or we may have back to back flags */
s->rx_bytes += s->len - s->crc_bytes;
s->len -= s->crc_bytes;
if (s->frame_handler)
- s->frame_handler(s->frame_user_data, s->buffer, s->len, TRUE);
+ s->frame_handler(s->frame_user_data, s->buffer, s->len, true);
}
else
{
{
s->len -= s->crc_bytes;
if (s->frame_handler)
- s->frame_handler(s->frame_user_data, s->buffer, s->len, FALSE);
+ s->frame_handler(s->frame_user_data, s->buffer, s->len, false);
}
}
}
else
s->len = 0;
if (s->frame_handler)
- s->frame_handler(s->frame_user_data, s->buffer, s->len, FALSE);
+ s->frame_handler(s->frame_user_data, s->buffer, s->len, false);
}
s->rx_length_errors++;
}
if (++s->flags_seen >= s->framing_ok_threshold && !s->framing_ok_announced)
{
report_status_change(s, SIG_STATUS_FRAMING_OK);
- s->framing_ok_announced = TRUE;
+ s->framing_ok_announced = true;
}
}
}
/*- End of function --------------------------------------------------------*/
SPAN_DECLARE(hdlc_rx_state_t *) hdlc_rx_init(hdlc_rx_state_t *s,
- int crc32,
- int report_bad_frames,
+ bool crc32,
+ bool report_bad_frames,
int framing_ok_threshold,
hdlc_frame_handler_t handler,
void *user_data)
{
if (len <= 0)
{
- s->tx_end = TRUE;
+ s->tx_end = true;
return 0;
}
if (s->len + len > s->max_frame_len)
s->len += len;
else
s->len = len;
- s->tx_end = FALSE;
+ s->tx_end = false;
return 0;
}
/*- End of function --------------------------------------------------------*/
s->flag_octets += -len;
else
s->flag_octets = len;
- s->report_flag_underflow = TRUE;
- s->tx_end = FALSE;
+ s->report_flag_underflow = true;
+ s->tx_end = false;
return 0;
}
/*- End of function --------------------------------------------------------*/
/* We are in a timed flag section (preamble, inter frame gap, etc.) */
if (--s->flag_octets <= 0 && s->report_flag_underflow)
{
- s->report_flag_underflow = FALSE;
+ s->report_flag_underflow = false;
if (s->len == 0)
{
/* The timed flags have finished, there is nothing else queued to go,
s->crc = 0xFFFFFFFF;
/* Report the underflow now. If there are timed flags still in progress, loading the
next frame right now will be harmless. */
- s->report_flag_underflow = FALSE;
+ s->report_flag_underflow = false;
if (s->underflow_handler)
s->underflow_handler(s->user_data);
/* Make sure we finish off with at least one flag octet, if the underflow report did not result
/* Untimed idling on flags */
if (s->tx_end)
{
- s->tx_end = FALSE;
+ s->tx_end = false;
return SIG_STATUS_END_OF_DATA;
}
return s->idle_octet;
/*- End of function --------------------------------------------------------*/
SPAN_DECLARE(hdlc_tx_state_t *) hdlc_tx_init(hdlc_tx_state_t *s,
- int crc32,
+ bool crc32,
int inter_frame_flags,
- int progressive,
+ bool progressive,
hdlc_underflow_handler_t handler,
void *user_data)
{
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include <tiffio.h>
#include <assert.h>
#include <signal.h>
#include <sys/time.h>
#include <time.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "spandsp/telephony.h"
#include "spandsp/alloc.h"
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(int) span_log_test(logging_state_t *s, int level)
+SPAN_DECLARE(bool) span_log_test(logging_state_t *s, int level)
{
if (s && (s->level & SPAN_LOG_SEVERITY_MASK) >= (level & SPAN_LOG_SEVERITY_MASK))
- return TRUE;
- return FALSE;
+ return true;
+ return false;
}
/*- End of function --------------------------------------------------------*/
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include "spandsp/telephony.h"
osbuf[*osptr - 1] = i - 9;
(*osptr)++;
}
- s->hyst = TRUE;
+ s->hyst = true;
}
s->lasti = i;
/* After one onset detection, at least OSHYST sample times must go */
}
else if (s->hyst && i - s->lasti >= 10)
{
- s->hyst = FALSE;
+ s->hyst = false;
}
}
}
#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>
+#include <memory.h>
#if defined(HAVE_TGMATH_H)
#include <tgmath.h>
#endif
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
-#include <memory.h>
#include "spandsp/telephony.h"
#include "spandsp/alloc.h"
ipiti[i] = *pitch;
rmsi[i] = *rms;
}
- s->first_pitsyn = FALSE;
+ s->first_pitsyn = false;
}
else
{
/* NOUT | -- -- -- -- ?? ?? */
/* IVOICE | -- -- -- -- 0 0 */
- /* UVPIT is always 0.0 on the first pass through the DO WHILE (TRUE)
+ /* UVPIT is always 0.0 on the first pass through the DO WHILE (true)
loop below. */
/* The only possible non-0 value of SLOPE (in column 111) is
/* Skip decoding on first frame because present data not yet available */
if (s->first)
{
- s->first = FALSE;
+ s->first = false;
/* Assign PITCH a "default" value on the first call, since */
/* otherwise it would be left uninitialized. The two lines */
/* below were copied from above, since it seemed like a */
/* State used by function decode */
s->iptold = 60;
- s->first = TRUE;
+ s->first = true;
s->ivp2h = 0;
s->iovoic = 0;
s->iavgp = 60;
/* State used by function pitsyn */
s->rmso = 1.0f;
- s->first_pitsyn = TRUE;
+ s->first_pitsyn = true;
/* State used by function bsynz */
s->ipo = 0;
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include "spandsp/telephony.h"
s->l2sum1 = 0.0f;
s->l2ptr1 = 1;
s->l2ptr2 = 9;
- s->hyst = FALSE;
+ s->hyst = false;
/* State used by function lpc10_voicing */
s->dither = 20.0f;
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include "spandsp/telephony.h"
int32_t k;
int32_t l;
int32_t hrange;
- int ephase;
+ bool ephase;
int32_t lrange;
lrange = (af - 2)*lframe + 1;
awin[af - 1][1] += *ipitch;
}
/* Make energy window be phase-synchronous. */
- ephase = TRUE;
+ ephase = true;
}
else
{
/* Case 3 */
awin[af - 1][0] = vwin[af - 1][0];
awin[af - 1][1] = vwin[af - 1][1];
- ephase = FALSE;
+ ephase = false;
}
/* RMS is computed over an integer number of pitch periods in the analysis
window. When it is not placed phase-synchronously, it is placed as close
{
int32_t i1;
int32_t i2;
- int crit;
+ bool crit;
int32_t q;
int32_t osptr1;
int32_t hrange;
q++;
/* Check for case 2 (placement before onset): */
/* Check for critical region exception: */
- crit = FALSE;
+ crit = false;
for (i = q + 1; i < osptr1; i++)
{
if (osbuf[i - 1] - osbuf[q - 1] >= minwin)
{
- crit = TRUE;
+ crit = true;
break;
}
}
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include "spandsp/telephony.h"
#include <inttypes.h>
#include <stdlib.h>
#include <unistd.h>
+#include <string.h>
+#include <stdio.h>
+#include <time.h>
+#include <fcntl.h>
#if defined(HAVE_TGMATH_H)
#include <tgmath.h>
#endif
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
-#include <string.h>
-#include <stdio.h>
-#include <time.h>
-#include <fcntl.h>
#if defined(__sunos) || defined(__solaris) || defined(__sun)
#include <getopt.h>
#endif
#include "spandsp/complex.h"
#include "filter_tools.h"
-#if !defined(FALSE)
-#define FALSE 0
-#endif
-#if !defined(TRUE)
-#define TRUE (!FALSE)
-#endif
-
//#define SAMPLE_RATE 8000.0
#define MAX_COEFFS_PER_FILTER 128
#define MAX_COEFF_SETS 384
alpha = baud_rate/(2.0*(double) (coeff_sets*baud_rate));
beta = excess_bandwidth;
- compute_raised_cosine_filter(coeffs, total_coeffs, TRUE, FALSE, alpha, beta);
+ compute_raised_cosine_filter(coeffs, total_coeffs, true, false, alpha, beta);
/* Find the DC gain of the filter, and adjust the filter to unity gain. */
floating_gain = 0.0;
beta = excess_bandwidth;
carrier *= 2.0*3.1415926535/SAMPLE_RATE;
- compute_raised_cosine_filter(coeffs, total_coeffs, TRUE, FALSE, alpha, beta);
+ compute_raised_cosine_filter(coeffs, total_coeffs, true, false, alpha, beta);
/* Find the DC gain of the filter, and adjust the filter to unity gain. */
floating_gain = 0.0;
const char *tx_tag;
const char *modem;
- transmit_modem = FALSE;
+ transmit_modem = false;
modem = "";
while ((opt = getopt(argc, argv, "m:rt")) != -1)
{
modem = optarg;
break;
case 'r':
- transmit_modem = FALSE;
+ transmit_modem = false;
break;
case 't':
- transmit_modem = TRUE;
+ transmit_modem = true;
break;
default:
usage();
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include <stdio.h>
#include "spandsp/fsk.h"
#include "spandsp/modem_connect_tones.h"
+#include "spandsp/private/power_meter.h"
#include "spandsp/private/fsk.h"
#include "spandsp/private/modem_connect_tones.h"
{
int alloced;
- alloced = FALSE;
+ alloced = false;
if (s == NULL)
{
if ((s = (modem_connect_tones_tx_state_t *) span_alloc(sizeof(*s))) == NULL)
return NULL;
- alloced = TRUE;
+ alloced = true;
}
s->tone_type = tone_type;
switch (s->tone_type)
s->raw_bit_stream = 0;
s->num_bits = 0;
s->flags_seen = 0;
- s->framing_ok_announced = FALSE;
+ s->framing_ok_announced = false;
break;
}
return;
if (++s->flags_seen >= HDLC_FRAMING_OK_THRESHOLD && !s->framing_ok_announced)
{
report_tone_state(s, MODEM_CONNECT_TONES_FAX_PREAMBLE, lfastrintf(fsk_rx_signal_power(&(s->v21rx))));
- s->framing_ok_announced = TRUE;
+ s->framing_ok_announced = true;
}
}
}
{
if (s->num_bits == 8)
{
- s->framing_ok_announced = FALSE;
+ s->framing_ok_announced = false;
s->flags_seen = 0;
}
}
report_tone_state(s, MODEM_CONNECT_TONES_NONE, -99);
s->tone_cycle_duration = 0;
s->good_cycles = 0;
- s->tone_on = FALSE;
+ s->tone_on = false;
continue;
}
/* There is adequate energy in the channel. Is it mostly at 2100Hz? */
s->tone_cycle_duration = ms_to_samples(450 + 100);
}
}
- s->tone_on = TRUE;
+ s->tone_on = true;
}
else if (s->notch_level*5 > s->channel_level)
{
s->good_cycles = 0;
}
}
- s->tone_on = FALSE;
+ s->tone_on = false;
}
}
break;
s->tone_cycle_duration = 0;
s->good_cycles = 0;
s->hit = MODEM_CONNECT_TONES_NONE;
- s->tone_on = FALSE;
+ s->tone_on = false;
s->tone_callback = tone_callback;
s->callback_data = user_data;
s->znotch_1 = 0.0f;
s->z15hz_2 = 0.0f;
s->num_bits = 0;
s->flags_seen = 0;
- s->framing_ok_announced = FALSE;
+ s->framing_ok_announced = false;
s->raw_bit_stream = 0;
return s;
}
#include <stdlib.h>
#include <string.h>
#include <limits.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "spandsp/telephony.h"
#include "spandsp/alloc.h"
#include "spandsp/playout.h"
+#include "spandsp/private/playout.h"
+
static playout_frame_t *queue_get(playout_state_t *s, timestamp_t sender_stamp)
{
playout_frame_t *frame;
if (!s->not_first)
{
/* Prime things the first time through */
- s->not_first = TRUE;
+ s->not_first = true;
s->latest_expected = frame->receiver_stamp + s->min_length;
}
/* Leaky integrate the rate of occurance of frames received just in time and late */
{
s->last_speech_sender_stamp = sender_stamp - sender_len - s->min_length;
s->last_speech_sender_len = sender_len;
- s->start = FALSE;
+ s->start = false;
}
return PLAYOUT_OK;
s->min_length = min_length;
s->max_length = (max_length > min_length) ? max_length : min_length;
s->dropable_threshold = 1*0x10000000/100;
- s->start = TRUE;
+ s->start = true;
s->since_last_step = 0x7FFFFFFF;
/* Start with the minimum buffer length allowed, and work from there */
s->actual_buffer_length =
#include "spandsp/saturated.h"
#include "spandsp/plc.h"
+#include "spandsp/private/plc.h"
+
/* We do a straight line fade to zero volume in 50ms when we are filling in for missing data. */
#define ATTENUATION_INCREMENT 0.0025f /* Attenuation per sample */
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include <assert.h>
#include "spandsp/alloc.h"
#include "spandsp/power_meter.h"
+#include "spandsp/private/power_meter.h"
+
SPAN_DECLARE(power_meter_t *) power_meter_init(power_meter_t *s, int shift)
{
if (s == NULL)
{
if (pow_short <= s->surge*(pow_medium >> 10))
return 0;
- s->signal_present = TRUE;
+ s->signal_present = true;
s->medium_term.reading = s->short_term.reading;
}
else
{
if (pow_short < s->sag*(pow_medium >> 10))
{
- s->signal_present = FALSE;
+ s->signal_present = false;
s->medium_term.reading = s->short_term.reading;
return 0;
}
#include <ctype.h>
#include <stdlib.h>
#include <inttypes.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
+#if defined(HAVE_STDATOMIC_H)
+#include <stdatomic.h>
+#endif
#include <sys/types.h>
#define SPANDSP_FULLY_DEFINE_QUEUE_STATE_T
#include "spandsp/private/queue.h"
-SPAN_DECLARE(int) queue_empty(queue_state_t *s)
+SPAN_DECLARE(bool) queue_empty(queue_state_t *s)
{
return (s->iptr == s->optr);
}
#include <inttypes.h>
#include <stdlib.h>
#include <memory.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "spandsp/telephony.h"
#include "spandsp/alloc.h"
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include <memory.h>
#include <string.h>
#include "spandsp/super_tone_rx.h"
#include "spandsp/sig_tone.h"
+#include "spandsp/private/power_meter.h"
#include "spandsp/private/sig_tone.h"
/*! PI */
int k;
int n;
int16_t tone;
- int need_update;
+ bool need_update;
int high_low;
for (i = 0; i < len; i += n)
if (s->current_tx_timeout <= len - i)
{
n = s->current_tx_timeout;
- need_update = TRUE;
+ need_update = true;
}
else
{
n = len - i;
- need_update = FALSE;
+ need_update = false;
}
s->current_tx_timeout -= n;
}
else
{
n = len - i;
- need_update = FALSE;
+ need_update = false;
}
if (!(s->current_tx_tone & SIG_TONE_TX_PASSTHROUGH))
vec_zeroi16(&[i], n);
if ((s->signalling_state & (SIG_TONE_1_PRESENT | SIG_TONE_2_PRESENT)))
{
if (s->flat_mode_timeout && --s->flat_mode_timeout == 0)
- s->flat_mode = TRUE;
+ s->flat_mode = true;
/*endif*/
}
else
{
s->flat_mode_timeout = s->desc->sharp_flat_timeout;
- s->flat_mode = FALSE;
+ s->flat_mode = false;
}
/*endif*/
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include <assert.h>
#include <limits.h>
#include <limits.h>
#include <time.h>
@INSERT_MATH_HEADER@
+@INSERT_STDBOOL_HEADER@
#include <tiffio.h>
#include <spandsp/telephony.h>
#if !defined(_SPANDSP_ALLOC_H_)
#define _SPANDSP_ALLOC_H_
-typedef void *(*span_alloc_t)(size_t size);
typedef void *(*span_aligned_alloc_t)(size_t alignment, size_t size);
+typedef void *(*span_alloc_t)(size_t size);
typedef void *(*span_realloc_t)(void *ptr, size_t size);
typedef void (*span_free_t)(void *ptr);
{
#endif
-/* Allocate size bytes of memory. */
-SPAN_DECLARE(void *) span_alloc(size_t size);
-
/* Allocate size bytes allocated to ALIGNMENT bytes. */
SPAN_DECLARE(void *) span_aligned_alloc(size_t alignment, size_t size);
+/* Allocate size bytes of memory. */
+SPAN_DECLARE(void *) span_alloc(size_t size);
+
/* Re-allocate the previously allocated block in ptr, making the new block size bytes long. */
SPAN_DECLARE(void *) span_realloc(void *ptr, size_t size);
/* Free a block allocated by span_alloc, span_aligned_alloc, or span_realloc. */
SPAN_DECLARE(void) span_free(void *ptr);
-SPAN_DECLARE(int) span_mem_allocators(span_alloc_t custom_alloc,
- span_aligned_alloc_t custom_aligned_alloc,
+SPAN_DECLARE(int) span_mem_allocators(span_aligned_alloc_t custom_aligned_alloc,
+ span_alloc_t custom_alloc,
span_realloc_t custom_realloc,
span_free_t custom_free);
\param data_bits The number of data bits.
\param parity_bits The type of parity.
\param stop_bits The number of stop bits.
- \param use_v14 TRUE if V.14 rate adaption processing should be used.
+ \param use_v14 True if V.14 rate adaption processing should be used.
\param put_byte The callback routine used to put the received data.
\param user_data An opaque pointer.
\return A pointer to the initialised context, or NULL if there was a problem. */
int data_bits,
int parity_bits,
int stop_bits,
- int use_v14,
+ bool use_v14,
put_byte_func_t put_byte,
void *user_data);
\param data_bits The number of data bit.
\param parity_bits The type of parity.
\param stop_bits The number of stop bits.
- \param use_v14 TRUE if V.14 rate adaption processing should be used.
+ \param use_v14 True if V.14 rate adaption processing should be used.
\param get_byte The callback routine used to get the data to be transmitted.
\param user_data An opaque pointer.
\return A pointer to the initialised context, or NULL if there was a problem. */
int data_bits,
int parity_bits,
int stop_bits,
- int use_v14,
+ bool use_v14,
get_byte_func_t get_byte,
void *user_data);
*/
typedef struct
{
- /*! TRUE if character echo is enabled */
- int echo;
- /*! TRUE if verbose reporting is enabled */
- int verbose;
- /*! TRUE if result codes are verbose */
+ /*! True if character echo is enabled */
+ bool echo;
+ /*! True if verbose reporting is enabled */
+ bool verbose;
+ /*! Result code format code - numeic or verbose */
int result_code_format;
- /*! TRUE if pulse dialling is the default */
- int pulse_dial;
+ /*! True if pulse dialling is the default */
+ bool pulse_dial;
/*! ??? */
int double_escape;
/*! ??? */
/*! \brief Initialise an R2 MF tone generator context.
\param s The R2 MF generator context.
- \param fwd TRUE if the context is for forward signals. FALSE if the
+ \param fwd True if the context is for forward signals. False if the
context is for backward signals.
\return A pointer to the MFC/R2 generator context.*/
-SPAN_DECLARE(r2_mf_tx_state_t *) r2_mf_tx_init(r2_mf_tx_state_t *s, int fwd);
+SPAN_DECLARE(r2_mf_tx_state_t *) r2_mf_tx_init(r2_mf_tx_state_t *s, bool fwd);
/*! \brief Release an R2 MF tone generator context.
\param s The R2 MF tone generator context.
/*! \brief Initialise an R2 MF receiver context.
\param s The R2 MF receiver context.
- \param fwd TRUE if the context is for forward signals. FALSE if the
+ \param fwd True if the context is for forward signals. False if the
context is for backward signals.
\param callback An optional callback routine, used to report received digits. If
no callback routine is set, digits may be collected, using the r2_mf_rx_get()
and supplied in callbacks.
\return A pointer to the R2 MF receiver context. */
SPAN_DECLARE(r2_mf_rx_state_t *) r2_mf_rx_init(r2_mf_rx_state_t *s,
- int fwd,
+ bool fwd,
tone_report_func_t callback,
void *user_data);
/*! \brief Initialise a bitstream context.
\param s A pointer to the bitstream context.
- \param lsb_first TRUE if the bit stream is LSB first, else its MSB first.
+ \param lsb_first True if the bit stream is LSB first, else its MSB first.
\return A pointer to the bitstream context. */
SPAN_DECLARE(bitstream_state_t *) bitstream_init(bitstream_state_t *s, int direction);
/*! \brief Check the ITU/CCITT CRC-32 value in a frame.
\param buf The buffer containing the frame.
\param len The length of the frame.
- \return TRUE if the CRC is OK, else FALSE.
+ \return True if the CRC is OK, else false.
*/
-SPAN_DECLARE(int) crc_itu32_check(const uint8_t *buf, int len);
+SPAN_DECLARE(bool) crc_itu32_check(const uint8_t *buf, int len);
/*! \brief Calculate the ITU/CCITT CRC-16 value in buffer by whole bytes.
\param buf The buffer containing the data.
/*! \brief Check the ITU/CCITT CRC-16 value in a frame.
\param buf The buffer containing the frame.
\param len The length of the frame.
- \return TRUE if the CRC is OK, else FALSE.
+ \return True if the CRC is OK, else false.
*/
-SPAN_DECLARE(int) crc_itu16_check(const uint8_t *buf, int len);
+SPAN_DECLARE(bool) crc_itu16_check(const uint8_t *buf, int len);
#if defined(__cplusplus)
}
/*! \brief Adjust a DTMF receiver context.
\param s The DTMF receiver context.
- \param filter_dialtone TRUE to enable filtering of dialtone, FALSE
+ \param filter_dialtone True to enable filtering of dialtone, false
to disable, < 0 to leave unchanged.
\param twist Acceptable twist, in dB. < 0.0 to leave unchanged.
\param reverse_twist Acceptable reverse twist, in dB. < 0.0 to leave unchanged.
#include <spandsp/private/awgn.h>
#include <spandsp/private/noise.h>
#include <spandsp/private/bert.h>
+#include <spandsp/private/power_meter.h>
#include <spandsp/private/tone_generate.h>
#include <spandsp/private/bell_r2_mf.h>
#include <spandsp/private/sig_tone.h>
#include <spandsp/private/g726.h>
#include <spandsp/private/lpc10.h>
#include <spandsp/private/gsm0610.h>
+#include <spandsp/private/plc.h>
+#include <spandsp/private/playout.h>
#include <spandsp/private/oki_adpcm.h>
#include <spandsp/private/ima_adpcm.h>
#include <spandsp/private/hdlc.h>
#include <spandsp/private/v27ter_tx.h>
#include <spandsp/private/v29rx.h>
#include <spandsp/private/v29tx.h>
-/*#include <spandsp/private/v32bis.h>*/
-/*#include <spandsp/private/v34.h>*/
#include <spandsp/private/v42.h>
#include <spandsp/private/v42bis.h>
#include <spandsp/private/at_interpreter.h>
+#include <spandsp/private/data_modems.h>
#include <spandsp/private/fax_modems.h>
#include <spandsp/private/timezone.h>
#include <spandsp/private/image_translate.h>
/*! Select whether silent audio will be sent when FAX transmit is idle.
\brief Select whether silent audio will be sent when FAX transmit is idle.
\param s The FAX context.
- \param transmit_on_idle TRUE if silent audio should be output when the FAX transmitter is
- idle. FALSE to transmit zero length audio when the FAX transmitter is idle. The default
- behaviour is FALSE.
+ \param transmit_on_idle True if silent audio should be output when the FAX transmitter is
+ idle. False to transmit zero length audio when the FAX transmitter is idle. The default
+ behaviour is false.
*/
SPAN_DECLARE(void) fax_set_transmit_on_idle(fax_state_t *s, int transmit_on_idle);
/*! Select whether talker echo protection tone will be sent for the image modems.
\brief Select whether TEP will be sent for the image modems.
\param s The FAX context.
- \param use_tep TRUE if TEP should be sent.
+ \param use_tep True if TEP should be sent.
*/
SPAN_DECLARE(void) fax_set_tep_mode(fax_state_t *s, int use_tep);
/*! Restart a FAX context.
\brief Restart a FAX context.
\param s The FAX context.
- \param calling_party TRUE if the context is for a calling party. FALSE if the
+ \param calling_party True if the context is for a calling party. False if the
context is for an answering party.
\return 0 for OK, else -1. */
SPAN_DECLARE(int) fax_restart(fax_state_t *s, int calling_party);
/*! Initialise a FAX context.
\brief Initialise a FAX context.
\param s The FAX context.
- \param calling_party TRUE if the context is for a calling party. FALSE if the
+ \param calling_party True if the context is for a calling party. False if the
context is for an answering party.
\return A pointer to the FAX context, or NULL if there was a problem.
*/
/*! \brief Initialise an HDLC receiver context.
\param s A pointer to an HDLC receiver context.
- \param crc32 TRUE to use ITU CRC32. FALSE to use ITU CRC16.
- \param report_bad_frames TRUE to request the reporting of bad frames.
+ \param crc32 True to use ITU CRC32. False to use ITU CRC16.
+ \param report_bad_frames True to request the reporting of bad frames.
\param framing_ok_threshold The number of back-to-back flags needed to
start the framing OK condition. This may be used where a series of
flag octets is used as a preamble, such as in the T.30 protocol.
\return A pointer to the HDLC receiver context.
*/
SPAN_DECLARE(hdlc_rx_state_t *) hdlc_rx_init(hdlc_rx_state_t *s,
- int crc32,
- int report_bad_frames,
+ bool crc32,
+ bool report_bad_frames,
int framing_ok_threshold,
hdlc_frame_handler_t handler,
void *user_data);
/*! \brief Initialise an HDLC transmitter context.
\param s A pointer to an HDLC transmitter context.
- \param crc32 TRUE to use ITU CRC32. FALSE to use ITU CRC16.
+ \param crc32 True to use ITU CRC32. False to use ITU CRC16.
\param inter_frame_flags The minimum flag octets to insert between frames (usually one).
- \param progressive TRUE if frame creation works in progressive mode.
+ \param progressive True if frame creation works in progressive mode.
\param handler The callback function called when the HDLC transmitter underflows.
\param user_data An opaque parameter for the callback routine.
\return A pointer to the HDLC transmitter context.
*/
SPAN_DECLARE(hdlc_tx_state_t *) hdlc_tx_init(hdlc_tx_state_t *s,
- int crc32,
+ bool crc32,
int inter_frame_flags,
- int progressive,
+ bool progressive,
hdlc_underflow_handler_t handler,
void *user_data);
\brief Test if logging of a specified severity level is enabled.
\param s The logging context.
\param level The severity level to be tested.
- \return TRUE if logging is enable, else FALSE.
+ \return True if logging is enable.
*/
-SPAN_DECLARE(int) span_log_test(logging_state_t *s, int level);
+SPAN_DECLARE(bool) span_log_test(logging_state_t *s, int level);
/*! Generate a log entry.
\brief Generate a log entry.
/*! \brief Test if a modem_connect tone has been detected.
\param s The context.
- \return TRUE if tone is detected, else FALSE.
+ \return The code for the detected tone.
*/
SPAN_DECLARE(int) modem_connect_tones_rx_get(modem_connect_tones_rx_state_t *s);
typedef int timestamp_t;
-typedef struct playout_frame_s
-{
- /*! The actual frame data */
- void *data;
- /*! The type of frame */
- int type;
- /*! The timestamp assigned by the sending end */
- timestamp_t sender_stamp;
- /*! The timespan covered by the data in this frame */
- timestamp_t sender_len;
- /*! The timestamp assigned by the receiving end */
- timestamp_t receiver_stamp;
- /*! Pointer to the next earlier frame */
- struct playout_frame_s *earlier;
- /*! Pointer to the next later frame */
- struct playout_frame_s *later;
-} playout_frame_t;
+typedef struct playout_frame_s playout_frame_t;
/*!
Playout (jitter buffer) descriptor. This defines the working state
for a single instance of playout buffering.
*/
-typedef struct
-{
- /*! TRUE if the buffer is dynamically sized */
- int dynamic;
- /*! The minimum length (dynamic) or fixed length (static) of the buffer */
- int min_length;
- /*! The maximum length (dynamic) or fixed length (static) of the buffer */
- int max_length;
- /*! The target filter threshold for adjusting dynamic buffering. */
- int dropable_threshold;
-
- int start;
-
- /*! The queued frame list */
- playout_frame_t *first_frame;
- playout_frame_t *last_frame;
- /*! The free frame pool */
- playout_frame_t *free_frames;
-
- /*! The total frames input to the buffer, to date. */
- int frames_in;
- /*! The total frames output from the buffer, to date. */
- int frames_out;
- /*! The number of frames received out of sequence. */
- int frames_oos;
- /*! The number of frames which were discarded, due to late arrival. */
- int frames_late;
- /*! The number of frames which were never received. */
- int frames_missing;
- /*! The number of frames trimmed from the stream, due to buffer shrinkage. */
- int frames_trimmed;
-
- timestamp_t latest_expected;
- /*! The present jitter adjustment */
- timestamp_t current;
- /*! The sender_stamp of the last speech frame */
- timestamp_t last_speech_sender_stamp;
- /*! The duration of the last speech frame */
- timestamp_t last_speech_sender_len;
-
- int not_first;
- /*! The time since the target buffer length was last changed. */
- timestamp_t since_last_step;
- /*! Filter state for tracking the packets arriving just in time */
- int32_t state_just_in_time;
- /*! Filter state for tracking the packets arriving late */
- int32_t state_late;
- /*! The current target length of the buffer */
- int target_buffer_length;
- /*! The current actual length of the buffer, which may lag behind the target value */
- int actual_buffer_length;
-} playout_state_t;
+typedef struct playout_state_s playout_state_t;
#if defined(__cplusplus)
extern "C"
/*!
The generic packet loss concealer context.
*/
-typedef struct
-{
- /*! Consecutive erased samples */
- int missing_samples;
- /*! Current offset into pitch period */
- int pitch_offset;
- /*! Pitch estimate */
- int pitch;
- /*! Buffer for a cycle of speech */
- float pitchbuf[PLC_PITCH_MIN];
- /*! History buffer */
- int16_t history[PLC_HISTORY_LEN];
- /*! Current pointer into the history buffer */
- int buf_ptr;
-} plc_state_t;
+typedef struct plc_state_s plc_state_t;
#if defined(__cplusplus)
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#if !defined(_POWER_METER_H_)
-#define _POWER_METER_H_
+#if !defined(_SPANDSP_POWER_METER_H_)
+#define _SPANDSP_POWER_METER_H_
/*! \page power_meter_page Power metering
Power meter descriptor. This defines the working state for a
single instance of a power measurement device.
*/
-typedef struct
-{
- /*! The shift factor, which controls the damping of the power meter. */
- int shift;
-
- /*! The current power reading. */
- int32_t reading;
-} power_meter_t;
+typedef struct power_meter_s power_meter_t;
-typedef struct
-{
- power_meter_t short_term;
- power_meter_t medium_term;
- int signal_present;
- int32_t surge;
- int32_t sag;
- int32_t min;
-} power_surge_detector_state_t;
+typedef struct power_surge_detector_state_s power_surge_detector_state_t;
#if defined(__cplusplus)
extern "C"
int parity;
/*! \brief The number of stop bits per character. */
int stop_bits;
- /*! \brief TRUE if V.14 rate adaption processing should be performed. */
- int use_v14;
+ /*! \brief True if V.14 rate adaption processing should be performed. */
+ bool use_v14;
/*! \brief A pointer to the callback routine used to handle received characters. */
put_byte_func_t put_byte;
/*! \brief An opaque pointer passed when calling put_byte. */
int command_dial;
int ok_is_pending;
int dte_is_waiting;
- /*! \brief TRUE if a carrier is presnt. Otherwise FALSE. */
- int rx_signal_present;
- /*! \brief TRUE if a modem has trained, Otherwise FALSE. */
- int rx_trained;
+ /*! \brief True if a carrier is presnt. Otherwise false. */
+ bool rx_signal_present;
+ /*! \brief True if a modem has trained, Otherwise false. */
+ bool rx_trained;
int transmit;
char line[256];
{
/*! The tone generator. */
tone_gen_state_t tone;
- /*! TRUE if generating forward tones, otherwise generating reverse tones. */
- int fwd;
+ /*! True if generating forward tones, otherwise generating reverse tones. */
+ bool fwd;
/*! The current digit being generated. */
int digit;
};
tone_report_func_t callback;
/*! An opaque pointer passed to the callback function. */
void *callback_data;
- /*! TRUE is we are detecting forward tones. FALSE if we are detecting backward tones */
- int fwd;
+ /*! Tue is we are detecting forward tones. False if we are detecting backward tones */
+ bool fwd;
/*! Tone detector working states */
goertzel_state_t out[6];
/*! The current sample number within a processing block. */
uint32_t bitstream;
/*! The residual bits in bitstream. */
int residue;
- /*! TRUE if the stream is LSB first, else MSB first */
- int lsb_first;
+ /*! True if the stream is LSB first, else MSB first */
+ bool lsb_first;
};
tone_report_func_t realtime_callback;
/*! An opaque pointer passed to the real time callback function. */
void *realtime_callback_data;
- /*! TRUE if dialtone should be filtered before processing */
- int filter_dialtone;
+ /*! True if dialtone should be filtered before processing */
+ bool filter_dialtone;
#if defined(SPANDSP_USE_FIXED_POINT)
/*! 350Hz filter state for the optional dialtone filter. */
float z350[2];
*/
struct fax_modems_state_s
{
- /*! TRUE is talker echo protection should be sent for the image modems */
- int use_tep;
+ /*! True is talker echo protection should be sent for the image modems */
+ bool use_tep;
/*! \brief The callback function used to report detected tones. */
tone_report_func_t tone_callback;
/*! \brief A user specified opaque pointer passed to the tone_callback function. */
void *tone_callback_user_data;
- /*! If TRUE, transmit silence when there is nothing else to transmit. If FALSE return only
+ /*! If true, transmit silence when there is nothing else to transmit. If false return only
the actual generated audio. Note that this only affects untimed silences. Timed silences
(e.g. the 75ms silence between V.21 and a high speed modem) will alway be transmitted as
silent audio. */
hdlc_frame_handler_t hdlc_accept;
void *hdlc_accept_user_data;
- /*! \brief TRUE if a carrier is present. Otherwise FALSE. */
- int rx_signal_present;
- /*! \brief TRUE if a modem has trained correctly. */
- int rx_trained;
- /*! \brief TRUE if an HDLC frame has been received correctly. */
- int rx_frame_received;
+ /*! \brief True if a carrier is present. Otherwise false. */
+ bool rx_signal_present;
+ /*! \brief True if a modem has trained correctly. */
+ bool rx_trained;
+ /*! \brief True if an HDLC frame has been received correctly. */
+ bool rx_frame_received;
int deferred_rx_handler_updates;
/*! \brief The current receive signal handler */
/*! \brief The current bit rate of the receiver. */
int rx_bit_rate;
- /*! \brief If TRUE, transmission is in progress */
- int transmit;
+ /*! \brief If True, transmission is in progress */
+ bool transmit;
/*! \brief Audio logging file handle for received audio. */
int audio_rx_log;
/*! \brief Audio logging file handle for transmitted audio. */
*/
struct g722_encode_state_s
{
- /*! TRUE if the operating in the special ITU test mode, with the band split filters
+ /*! True if the operating in the special ITU test mode, with the band split filters
disabled. */
- int itu_test_mode;
- /*! TRUE if the G.722 data is packed */
- int packed;
- /*! TRUE if encode from 8k samples/second */
- int eight_k;
+ bool itu_test_mode;
+ /*! True if the G.722 data is packed */
+ bool packed;
+ /*! True if encode from 8k samples/second */
+ bool eight_k;
/*! 6 for 48000kbps, 7 for 56000kbps, or 8 for 64000kbps. */
int bits_per_sample;
*/
struct g722_decode_state_s
{
- /*! TRUE if the operating in the special ITU test mode, with the band split filters
+ /*! True if the operating in the special ITU test mode, with the band split filters
disabled. */
- int itu_test_mode;
- /*! TRUE if the G.722 data is packed */
- int packed;
- /*! TRUE if decode to 8k samples/second */
- int eight_k;
+ bool itu_test_mode;
+ /*! True if the G.722 data is packed */
+ bool packed;
+ /*! True if decode to 8k samples/second */
+ bool eight_k;
/*! 6 for 48000kbps, 7 for 56000kbps, or 8 for 64000kbps. */
int bits_per_sample;
modem_status_func_t status_handler;
/*! \brief An opaque parameter passed to the status callback routine. */
void *status_user_data;
- /*! \brief TRUE if bad frames are to be reported. */
- int report_bad_frames;
+ /*! \brief True if bad frames are to be reported. */
+ bool report_bad_frames;
/*! \brief The number of consecutive flags which must be seen before framing is
declared OK. */
int framing_ok_threshold;
- /*! \brief TRUE if framing OK has been announced. */
- int framing_ok_announced;
+ /*! \brief True if framing OK has been announced. */
+ bool framing_ok_announced;
/*! \brief Number of consecutive flags seen so far. */
int flags_seen;
/*! \brief The raw (stuffed) bit stream buffer. */
- unsigned int raw_bit_stream;
+ uint32_t raw_bit_stream;
/*! \brief The destuffed bit stream buffer. */
- unsigned int byte_in_progress;
+ uint32_t byte_in_progress;
/*! \brief The current number of bits in byte_in_progress. */
int num_bits;
- /*! \brief TRUE if in octet counting mode (e.g. for MTP). */
- int octet_counting_mode;
+ /*! \brief True if in octet counting mode (e.g. for MTP). */
+ bool octet_counting_mode;
/*! \brief Octet count, to achieve the functionality needed for things
like MTP. */
int octet_count;
void *user_data;
/*! \brief The minimum flag octets to insert between frames. */
int inter_frame_flags;
- /*! \brief TRUE if frame creation works in progressive mode. */
- int progressive;
+ /*! \brief True if frame creation works in progressive mode. */
+ bool progressive;
/*! \brief Maximum permitted frame length. */
size_t max_frame_len;
int flag_octets;
/*! \brief The number of abort octets to send for a timed burst of aborts. */
int abort_octets;
- /*! \brief TRUE if the next underflow of timed flag octets should be reported */
- int report_flag_underflow;
+ /*! \brief True if the next underflow of timed flag octets should be reported */
+ bool report_flag_underflow;
/*! \brief The current message being transmitted, with its CRC attached. */
uint8_t buffer[HDLC_MAXFRAME_LEN + 4];
/*! \brief The number of bits remaining in byte. */
int bits;
- /*! \brief TRUE if transmission should end on buffer underflow .*/
- int tx_end;
+ /*! \brief True if transmission should end on buffer underflow .*/
+ bool tx_end;
};
#endif
int32_t l2ptr2;
/*! \brief No initial value necessary */
int32_t lasti;
- /*! \brief Initial value FALSE */
- int hyst;
+ /*! \brief Initial value false */
+ bool hyst;
/* State used by function lpc10_voicing */
/*! \brief Initial value 20.0f */
/* State used by function decode */
/*! \brief Initial value 60 */
int32_t iptold;
- /*! \brief Initial value TRUE */
- int first;
+ /*! \brief Initial value true */
+ bool first;
/*! \brief ??? */
int32_t ivp2h;
/*! \brief ??? */
int32_t buflen;
/* State used by function pitsyn */
- /*! \brief No initial value necessary as long as first_pitsyn is initially TRUE */
+ /*! \brief No initial value necessary as long as first_pitsyn is initially true */
int32_t ivoico;
- /*! \brief No initial value necessary as long as first_pitsyn is initially TRUE */
+ /*! \brief No initial value necessary as long as first_pitsyn is initially true */
int32_t ipito;
/*! \brief Initial value 1.0f */
float rmso;
- /*! \brief No initial value necessary as long as first_pitsyn is initially TRUE */
+ /*! \brief No initial value necessary as long as first_pitsyn is initially true */
float rco[10];
- /*! \brief No initial value necessary as long as first_pitsyn is initially TRUE */
+ /*! \brief No initial value necessary as long as first_pitsyn is initially true */
int32_t jsamp;
- /*! \brief Initial value TRUE */
- int first_pitsyn;
+ /*! \brief Initial value true */
+ bool first_pitsyn;
/* State used by function bsynz */
/*! \brief ??? */
int32_t am_level;
/*! \brief Sample counter for the small chunks of samples, after which a test is conducted. */
int chunk_remainder;
- /*! \brief TRUE is the tone is currently confirmed present in the audio. */
+ /*! \brief The code for the tone currently confirmed present in the audio. */
int tone_present;
/*! \brief */
int tone_on;
int tone_cycle_duration;
/*! \brief A count of the number of good cycles of tone reversal seen. */
int good_cycles;
- /*! \brief TRUE if the tone has been seen since the last time the user tested for it */
+ /*! \brief The confirmed tone code. */
int hit;
/*! \brief A V.21 FSK modem context used when searching for FAX preamble. */
fsk_rx_state_t v21rx;
int num_bits;
/*! \brief Number of consecutive flags seen so far. */
int flags_seen;
- /*! \brief TRUE if framing OK has been announced. */
- int framing_ok_announced;
+ /*! \brief True if framing OK has been announced. */
+ bool framing_ok_announced;
};
#endif
--- /dev/null
+/*
+ * SpanDSP - a series of DSP components for telephony
+ *
+ * private/playout.h
+ *
+ * Written by Steve Underwood <steveu@coppice.org>
+ *
+ * Copyright (C) 2005 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.
+ */
+
+#if !defined(_SPANDSP_PRIVATE_PLAYOUT_H_)
+#define _SPANDSP_PRIVATE_PLAYOUT_H_
+
+struct playout_frame_s
+{
+ /*! The actual frame data */
+ void *data;
+ /*! The type of frame */
+ int type;
+ /*! The timestamp assigned by the sending end */
+ timestamp_t sender_stamp;
+ /*! The timespan covered by the data in this frame */
+ timestamp_t sender_len;
+ /*! The timestamp assigned by the receiving end */
+ timestamp_t receiver_stamp;
+ /*! Pointer to the next earlier frame */
+ struct playout_frame_s *earlier;
+ /*! Pointer to the next later frame */
+ struct playout_frame_s *later;
+};
+
+/*!
+ Playout (jitter buffer) descriptor. This defines the working state
+ for a single instance of playout buffering.
+*/
+struct playout_state_s
+{
+ /*! True if the buffer is dynamically sized */
+ bool dynamic;
+ /*! The minimum length (dynamic) or fixed length (static) of the buffer */
+ int min_length;
+ /*! The maximum length (dynamic) or fixed length (static) of the buffer */
+ int max_length;
+ /*! The target filter threshold for adjusting dynamic buffering. */
+ int dropable_threshold;
+
+ int start;
+
+ /*! The queued frame list */
+ playout_frame_t *first_frame;
+ playout_frame_t *last_frame;
+ /*! The free frame pool */
+ playout_frame_t *free_frames;
+
+ /*! The total frames input to the buffer, to date. */
+ int frames_in;
+ /*! The total frames output from the buffer, to date. */
+ int frames_out;
+ /*! The number of frames received out of sequence. */
+ int frames_oos;
+ /*! The number of frames which were discarded, due to late arrival. */
+ int frames_late;
+ /*! The number of frames which were never received. */
+ int frames_missing;
+ /*! The number of frames trimmed from the stream, due to buffer shrinkage. */
+ int frames_trimmed;
+
+ timestamp_t latest_expected;
+ /*! The present jitter adjustment */
+ timestamp_t current;
+ /*! The sender_stamp of the last speech frame */
+ timestamp_t last_speech_sender_stamp;
+ /*! The duration of the last speech frame */
+ timestamp_t last_speech_sender_len;
+
+ int not_first;
+ /*! The time since the target buffer length was last changed. */
+ timestamp_t since_last_step;
+ /*! Filter state for tracking the packets arriving just in time */
+ int32_t state_just_in_time;
+ /*! Filter state for tracking the packets arriving late */
+ int32_t state_late;
+ /*! The current target length of the buffer */
+ int target_buffer_length;
+ /*! The current actual length of the buffer, which may lag behind the target value */
+ int actual_buffer_length;
+};
+
+#endif
+/*- End of file ------------------------------------------------------------*/
--- /dev/null
+/*
+ * SpanDSP - a series of DSP components for telephony
+ *
+ * private/plc.h
+ *
+ * Written by Steve Underwood <steveu@coppice.org>
+ *
+ * Copyright (C) 2004 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(_SPANDSP_PRIVATE_PLC_H_)
+#define _SPANDSP_PRIVATE_PLC_H_
+
+/*! Minimum allowed pitch (66 Hz) */
+#define PLC_PITCH_MIN 120
+/*! Maximum allowed pitch (200 Hz) */
+#define PLC_PITCH_MAX 40
+/*! Maximum pitch OLA window */
+#define PLC_PITCH_OVERLAP_MAX (PLC_PITCH_MIN >> 2)
+/*! The length over which the AMDF function looks for similarity (20 ms) */
+#define CORRELATION_SPAN 160
+/*! History buffer length. The buffer much also be at leat 1.25 times
+ PLC_PITCH_MIN, but that is much smaller than the buffer needs to be for
+ the pitch assessment. */
+#define PLC_HISTORY_LEN (CORRELATION_SPAN + PLC_PITCH_MIN)
+
+/*!
+ The generic packet loss concealer context.
+*/
+struct plc_state_s
+{
+ /*! Consecutive erased samples */
+ int missing_samples;
+ /*! Current offset into pitch period */
+ int pitch_offset;
+ /*! Pitch estimate */
+ int pitch;
+ /*! Buffer for a cycle of speech */
+ float pitchbuf[PLC_PITCH_MIN];
+ /*! History buffer */
+ int16_t history[PLC_HISTORY_LEN];
+ /*! Current pointer into the history buffer */
+ int buf_ptr;
+};
+
+#endif
+/*- End of file ------------------------------------------------------------*/
--- /dev/null
+/*
+ * SpanDSP - a series of DSP components for telephony
+ *
+ * private/power_meter.h
+ *
+ * Written by Steve Underwood <steveu@coppice.org>
+ *
+ * Copyright (C) 2003 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.
+ */
+
+#if !defined(_SPANDSP_PRIVATE_POWER_METER_H_)
+#define _SPANDSP_PRIVATE_POWER_METER_H_
+
+/*!
+ Power meter descriptor. This defines the working state for a
+ single instance of a power measurement device.
+*/
+struct power_meter_s
+{
+ /*! The shift factor, which controls the damping of the power meter. */
+ int shift;
+
+ /*! The current power reading. */
+ int32_t reading;
+};
+
+struct power_surge_detector_state_s
+{
+ power_meter_t short_term;
+ power_meter_t medium_term;
+ int signal_present;
+ int32_t surge;
+ int32_t sag;
+ int32_t min;
+};
+
+#endif
+/*- End of file ------------------------------------------------------------*/
/*! \brief The minimum ratio between notched power and total power for detection */
int32_t detection_ratio;
- /*! \brief TRUE if in flat mode. FALSE if in sharp mode. */
- int flat_mode;
- /*! \brief TRUE if the notch filter is enabled in the media path */
- int notch_enabled;
+ /*! \brief True if in flat mode. False if in sharp mode. */
+ bool flat_mode;
+ /*! \brief True if the notch filter is enabled in the media path */
+ bool notch_enabled;
/*! \brief ??? */
int flat_mode_timeout;
/*! \brief ??? */
/*! \brief The type of FAX operation currently in progress */
int operation_in_progress;
- /*! \brief TRUE if behaving as the calling party */
- int calling_party;
+ /*! \brief True if behaving as the calling party */
+ bool calling_party;
/*! \brief Internet aware FAX mode bit mask. */
int iaf;
int supported_image_sizes;
/*! \brief A bit mask of the currently supported T.30 special features. */
int supported_t30_features;
- /*! \brief TRUE is ECM mode handling is enabled. */
- int ecm_allowed;
- /*! \brief TRUE if we are capable of retransmitting pages */
- int retransmit_capable;
+ /*! \brief True is ECM mode handling is enabled. */
+ bool ecm_allowed;
+ /*! \brief True if we are capable of retransmitting pages */
+ bool retransmit_capable;
/*! \brief The received DCS, formatted as an ASCII string, for inclusion
in the TIFF file. */
/*! \brief The text which will be used in FAX page header. No text results
in no header line. */
char header_info[T30_MAX_PAGE_HEADER_INFO + 1];
- /*! \brief TRUE for FAX page headers to overlay (i.e. replace) the beginning of the
- page image. FALSE for FAX page headers to add to the overall length of
+ /*! \brief True for FAX page headers to overlay (i.e. replace) the beginning of the
+ page image. False for FAX page headers to add to the overall length of
the page. */
- int header_overlays_image;
- /*! \brief Use private timezone if TRUE */
- int use_own_tz;
+ bool header_overlays_image;
+ /*! \brief Use private timezone if true */
+ bool use_own_tz;
/*! \brief Optional per instance time zone for the FAX page header timestamp. */
tz_t tz;
- /*! \brief TRUE if remote T.30 procedural interrupts are allowed. */
- int remote_interrupts_allowed;
+ /*! \brief True if remote T.30 procedural interrupts are allowed. */
+ bool remote_interrupts_allowed;
/*! \brief The information fields received. */
t30_exchanged_info_t rx_info;
int local_dis_dtc_len;
/*! \brief The last DIS or DTC message received form the far end. */
uint8_t far_dis_dtc_frame[T30_MAX_DIS_DTC_DCS_LEN];
- /*! \brief TRUE if a valid DIS has been received from the far end. */
- int dis_received;
+ /*! \brief True if a valid DIS has been received from the far end. */
+ bool dis_received;
- /*! \brief TRUE if the short training sequence should be used. */
- int short_train;
+ /*! \brief True if the short training sequence should be used. */
+ bool short_train;
/*! \brief A count of the number of bits in the trainability test. This counts down to zero when
sending TCF, and counts up when receiving it. */
int current_fallback;
/*! \brief The subset of supported modems allowed at the current time, allowing for negotiation. */
int current_permitted_modems;
- /*! \brief TRUE if a carrier is present. Otherwise FALSE. */
- int rx_signal_present;
- /*! \brief TRUE if a modem has trained correctly. */
- int rx_trained;
- /*! \brief TRUE if a valid HDLC frame has been received in the current reception period. */
- int rx_frame_received;
+ /*! \brief True if a carrier is present. Otherwise false. */
+ bool rx_signal_present;
+ /*! \brief True if a modem has trained correctly. */
+ bool rx_trained;
+ /*! \brief True if a valid HDLC frame has been received in the current reception period. */
+ bool rx_frame_received;
/*! \brief Current reception mode. */
int current_rx_type;
/*! \brief This is only used in full duplex (e.g. ISDN) modes. */
int timer_t8;
- /*! \brief TRUE once the far end FAX entity has been detected. */
- int far_end_detected;
+ /*! \brief True once the far end FAX entity has been detected. */
+ bool far_end_detected;
- /*! \brief TRUE once the end of procedure condition has been detected. */
- int end_of_procedure_detected;
+ /*! \brief True once the end of procedure condition has been detected. */
+ bool end_of_procedure_detected;
- /*! \brief TRUE if a local T.30 interrupt is pending. */
- int local_interrupt_pending;
+ /*! \brief True if a local T.30 interrupt is pending. */
+ bool local_interrupt_pending;
/*! \brief The common ground in compression schemes between the local and far ends. */
int mutual_compressions;
/*! \brief The common group of supported bi-level image resolutions. */
t4_image_width_t image_width;
/*! \brief Current number of retries of the action in progress. */
int retries;
- /*! \brief TRUE if error correcting mode is used. */
- int error_correcting_mode;
+ /*! \brief True if error correcting mode is used. */
+ bool error_correcting_mode;
/*! \brief The number of HDLC frame retries, if error correcting mode is used. */
int error_correcting_mode_retries;
/*! \brief The current count of consecutive T30_PPR messages. */
int ecm_frames_this_tx_burst;
/*! \brief The current ECM frame, during ECM transmission. */
int ecm_current_tx_frame;
- /*! \brief TRUE if we are at the end of an ECM page to se sent - i.e. there are no more
+ /*! \brief True if we are at the end of an ECM page to se sent - i.e. there are no more
partial pages still to come. */
- int ecm_at_page_end;
+ bool ecm_at_page_end;
/*! \brief The transmission step queued to follow the one in progress. */
int next_tx_step;
/*! \brief the FCF2 field of the last PPS message we received. */
uint8_t last_pps_fcf2;
- /*! \brief TRUE if all frames of the current received ECM block are now OK */
- int rx_ecm_block_ok;
+ /*! \brief True if all frames of the current received ECM block are now OK */
+ bool rx_ecm_block_ok;
/*! \brief A count of successfully received ECM frames, to assess progress as a basis for
deciding whether to continue error correction when PPRs keep repeating. */
int ecm_progress;
/*! \brief The current transmit step being timed */
int timed_step;
- /*! \brief TRUE is there has been some T.38 data missed */
- int rx_data_missing;
+ /*! \brief True is there has been some T.38 data missed */
+ bool rx_data_missing;
/*! \brief The number of octets to send in each image packet (non-ECM or ECM) at the current
rate and the current specified packet interval. */
t31_hdlc_state_t hdlc_from_t31;
- /*! \brief TRUE if we are using ECM mode. This is used to select HDLC faking, necessary
+ /*! \brief True if we are using ECM mode. This is used to select HDLC faking, necessary
with clunky class 1 modems. */
- int ecm_mode;
+ bool ecm_mode;
/*! \brief Counter for trailing non-ECM bytes, used to flush out the far end's modem. */
int non_ecm_trailer_bytes;
t31_audio_front_end_state_t audio;
t31_t38_front_end_state_t t38_fe;
- /*! TRUE if working in T.38 mode. */
- int t38_mode;
+ /*! True if working in T.38 mode. */
+ bool t38_mode;
/*! HDLC buffer, for composing an HDLC frame from the computer to the channel. */
struct
uint8_t buf[T31_MAX_HDLC_LEN];
int len;
int ptr;
- /*! \brief TRUE when the end of HDLC data from the computer has been detected. */
- int final;
+ /*! \brief True when the end of HDLC data from the computer has been detected. */
+ bool final;
} hdlc_tx;
/*! Buffer for data from the computer to the channel. */
struct
int in_bytes;
/*! \brief The number of bytes sent from the transmit buffer. */
int out_bytes;
- /*! \brief TRUE if the flow of real data has started. */
- int data_started;
- /*! \brief TRUE if holding up further data into the buffer, for flow control. */
- int holding;
- /*! \brief TRUE when the end of non-ECM data from the computer has been detected. */
- int final;
+ /*! \brief True if the flow of real data has started. */
+ bool data_started;
+ /*! \brief True if holding up further data into the buffer, for flow control. */
+ bool holding;
+ /*! \brief True when the end of non-ECM data from the computer has been detected. */
+ bool final;
} non_ecm_tx;
- /*! TRUE if DLE prefix just used */
- int dled;
+ /*! True if DLE prefix just used */
+ bool dled;
/*! \brief Samples of silence awaited, as specified in a "wait for silence" command */
int silence_awaited;
/*! \brief The current bit rate for the FAX fast message transfer modem. */
int bit_rate;
- /*! \brief TRUE if a valid HDLC frame has been received in the current reception period. */
- int rx_frame_received;
+ /*! \brief True if a valid HDLC frame has been received in the current reception period. */
+ bool rx_frame_received;
/*! \brief Samples elapsed in the current call */
int64_t call_samples;
/*! \brief The currently queued modem type. */
int modem;
- /*! \brief TRUE when short training mode has been selected by the computer. */
- int short_train;
+ /*! \brief True when short training mode has been selected by the computer. */
+ bool short_train;
queue_state_t *rx_queue;
/*! \brief Error and flow logging control */
/*! \brief Pace transmission */
int pace_transmission;
- /*! \brief TRUE if IFP packet sequence numbers are relevant. For some transports, like TPKT
+ /*! \brief True if IFP packet sequence numbers are relevant. For some transports, like TPKT
over TCP they are not relevent. */
- int check_sequence_numbers;
+ bool check_sequence_numbers;
/*! \brief The number of times each packet type will be sent (low byte). The
depth of redundancy (2nd byte). Higher numbers may increase reliability
/*! \brief Core T.38 IFP support */
t38_core_state_t t38;
- /*! \brief TRUE if the NSF, NSC, and NSS are to be suppressed by altering
- their contents to something the far end will not recognise. */
+ /*! \brief If NSF, NSC, and NSS are to be suppressed by altering their contents to
+ something the far end will not recognise, this is the amount to overwrite. */
int suppress_nsx_len[2];
- /*! \brief TRUE if we need to corrupt the HDLC frame in progress, so the receiver cannot
+ /*! \brief True if we need to corrupt the HDLC frame in progress, so the receiver cannot
interpret it. The two values are for the two directions. */
- int corrupt_current_frame[2];
+ bool corrupt_current_frame[2];
/*! \brief the current class of field being received - i.e. none, non-ECM or HDLC */
int current_rx_field_class;
int bit_no;
/*! \brief Progressively calculated CRC for HDLC messages received from a modem. */
uint16_t crc;
- /*! \brief TRUE if non-ECM fill bits are to be stripped when sending image data. */
- int fill_bit_removal;
+ /*! \brief True if non-ECM fill bits are to be stripped when sending image data. */
+ bool fill_bit_removal;
/*! \brief The number of octets to send in each image packet (non-ECM or ECM) at
the current rate and the current specified packet interval. */
int octets_per_data_packet;
{
/*! \brief A bit mask of the currently supported modem types. */
int supported_modems;
- /*! \brief TRUE if ECM FAX mode is allowed through the gateway. */
- int ecm_allowed;
+ /*! \brief True if ECM FAX mode is allowed through the gateway. */
+ bool ecm_allowed;
/*! \brief Required time between T.38 transmissions, in ms. */
int ms_per_tx_chunk;
- /*! \brief TRUE if in image data modem is to use short training. This usually
+ /*! \brief True if in image data modem is to use short training. This usually
follows image_data_mode, but in ECM mode T.30 defines recovery
conditions in which long training is used for image data. */
- int short_train;
- /*! \brief TRUE if in image data mode, as opposed to TCF mode. */
- int image_data_mode;
+ bool short_train;
+ /*! \brief True if in image data mode, as opposed to TCF mode. */
+ bool image_data_mode;
/*! \brief The minimum permitted bits per FAX scan line row. */
int min_row_bits;
- /*! \brief TRUE if we should count the next MCF as a page end, else FALSE */
- int count_page_on_mcf;
+ /*! \brief True if we should count the next MCF as a page end, else false */
+ bool count_page_on_mcf;
/*! \brief The number of pages for which a confirm (MCF) message was returned. */
int pages_confirmed;
- /*! \brief TRUE if we are in error correcting (ECM) mode */
- int ecm_mode;
+ /*! \brief True if we are in error correcting (ECM) mode */
+ bool ecm_mode;
/*! \brief The current bit rate for the fast modem. */
int fast_bit_rate;
/*! \brief The current fast receive modem type. */
uint8_t flow_control_fill_octet;
/*! \brief A code for the phase of input buffering, from initial all ones to completion. */
int input_phase;
- /*! \brief TRUE is the end of non-ECM data indication has been received. */
- int data_finished;
+ /*! \brief True is the end of non-ECM data indication has been received. */
+ bool data_finished;
/*! \brief The current octet being transmitted from the buffer. */
unsigned int octet;
/*! \brief The current bit number in the current non-ECM octet. */
int bit_no;
- /*! \brief TRUE if in image data mode, as opposed to TCF mode. */
- int image_data_mode;
+ /*! \brief True if in image data mode, as opposed to TCF mode. */
+ bool image_data_mode;
/*! \brief The number of octets input to the buffer. */
int in_octets;
/*! \brief The timed step to go to when we reach idle from the current timed step */
int queued_timed_step;
- /*! \brief TRUE is there has been some T.38 data missed (i.e. lost packets) in the current
+ /*! \brief True is there has been some T.38 data missed (i.e. lost packets) in the current
reception period. */
- int rx_data_missing;
+ bool rx_data_missing;
/*! \brief The number of octets to send in each image packet (non-ECM or ECM) at the current
rate and the current specified packet interval. */
/*! \brief The current T.38 data type being transmitted. */
int current_tx_data_type;
- /*! \brief TRUE if a carrier is present. Otherwise FALSE. */
- int rx_signal_present;
+ /*! \brief True if a carrier is present. Otherwise false. */
+ bool rx_signal_present;
/*! \brief The current operating mode of the receiver. */
int current_rx_type;
int run_length;
/*! \brief 2D horizontal mode control. */
int black_white;
- /*! \brief TRUE if the current run is black */
- int in_black;
+ /*! \brief True if the current run is black */
+ bool in_black;
/*! \brief The current step into the current row run-lengths buffer. */
int a_cursor;
/*! \brief This variable is set if we are treating the current row as a 2D encoded
one. */
- int row_is_2d;
+ bool row_is_2d;
/*! \brief Encoded data bits buffer. */
uint32_t tx_bitstream;
/*! \brief The last page to transfer. -1 to continue to the end of the file. */
int stop_page;
- /*! \brief TRUE for FAX page headers to overlay (i.e. replace) the beginning of the
- page image. FALSE for FAX page headers to add to the overall length of
+ /*! \brief True for FAX page headers to overlay (i.e. replace) the beginning of the
+ page image. False for FAX page headers to add to the overall length of
the page. */
- int header_overlays_image;
+ bool header_overlays_image;
/*! \brief The text which will be used in FAX page header. No text results
in no header line. */
const char *header_info;
uint32_t c[128];
/*! New TX value, or <0 for analysis in progress */
int32_t new_tx;
- /*! TRUE if previous row was typical */
- int prev_ltp;
+ /*! True if previous row was typical */
+ bool prev_ltp;
/*! Pointers to the 3 row buffers */
uint8_t *prev_row[3];
/*! Pointer to a block of allocated memory 3 rows long, which
int32_t gmtoff; /* UTC offset in seconds */
int isdst; /* Used to set tm_isdst */
int abbrind; /* Abbreviation list index */
- int ttisstd; /* TRUE if transition is std time */
- int ttisgmt; /* TRUE if transition is UTC */
+ bool ttisstd; /* True if transition is std time */
+ bool ttisgmt; /* True if transition is UTC */
};
/* Leap second information */
/*! \brief Scrambler tap */
int scrambler_tap;
- /*! \brief TRUE if the short training sequence is to be used. */
- int short_train;
+ /*! \brief True if the short training sequence is to be used. */
+ bool short_train;
/*! \brief The section of the training data we are currently in. */
int training_stage;
/*! \brief A count of how far through the current training step we are. */
uint32_t scramble_reg;
/*! \brief Scrambler tap */
int scrambler_tap;
- /*! \brief TRUE if transmitting the training sequence. FALSE if transmitting user data. */
- int in_training;
- /*! \brief TRUE if the short training sequence is to be used. */
- int short_train;
+ /*! \brief True if transmitting the training sequence. False if transmitting user data. */
+ bool in_training;
+ /*! \brief True if the short training sequence is to be used. */
+ bool short_train;
/*! \brief A counter used to track progress through sending the training sequence. */
int training_step;
struct v18_state_s
{
- /*! \brief TRUE if we are the calling modem */
- int calling_party;
+ /*! \brief True if we are the calling modem */
+ bool calling_party;
int mode;
int nation;
put_msg_func_t put_msg;
{
/*! \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 calling_party;
+ /*! \brief True is this is the calling side modem. */
+ bool calling_party;
/*! \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 get_bit callback routine. */
int scrambler_pattern_count;
/*! \brief The current step in the table of BC constellation positions. */
int training_bc;
- /*! \brief TRUE if the previous trained values are to be reused. */
- int old_train;
+ /*! \brief True if the previous trained values are to be reused. */
+ bool old_train;
/*! \brief The section of the training data we are currently in. */
int training_stage;
/*! \brief A count of how far through the current training step we are. */
/*! \brief A counter for the number of consecutive bits of repeating pattern through
the scrambler. */
int scrambler_pattern_count;
- /*! \brief TRUE if transmitting the training sequence, or shutting down transmission.
- FALSE if transmitting user data. */
- int in_training;
+ /*! \brief True if transmitting the training sequence, or shutting down transmission.
+ False if transmitting user data. */
+ bool in_training;
/*! \brief A counter used to track progress through sending the training sequence. */
int training_step;
uint8_t training_scramble_reg;
/*! \brief The current step in the table of CD constellation positions. */
int training_cd;
- /*! \brief TRUE if the previous trained values are to be reused. */
- int old_train;
+ /*! \brief True if the previous trained values are to be reused. */
+ bool old_train;
/*! \brief The section of the training data we are currently in. */
int training_stage;
/*! \brief A count of how far through the current training step we are. */
uint32_t scramble_reg;
/*! \brief The register for the training scrambler. */
uint8_t training_scramble_reg;
- /*! \brief TRUE if transmitting the training sequence, or shutting down transmission.
- FALSE if transmitting user data. */
- int in_training;
+ /*! \brief True if transmitting the training sequence, or shutting down transmission.
+ False if transmitting user data. */
+ bool in_training;
/*! \brief A counter used to track progress through sending the training sequence. */
int training_step;
/*! \brief An offset value into the table of training parameters, used to match the
uint8_t vr;
int state;
int configuring;
- int local_busy;
- int far_busy;
- int rejected;
+ bool local_busy;
+ bool far_busy;
+ bool rejected;
int retry_count;
/* The control frame buffer, and its pointers */
*/
struct v42_state_s
{
- /*! TRUE if we are the calling party, otherwise FALSE. */
- int calling_party;
- /*! TRUE if we should detect whether the far end is V.42 capable. FALSE if we go
+ /*! True if we are the calling party, otherwise false. */
+ bool calling_party;
+ /*! True if we should detect whether the far end is V.42 capable. false if we go
directly to protocol establishment. */
- int detect;
+ bool detect;
/*! The bit rate, used to time events */
int tx_bit_rate;
/*! \brief The maximum amount to be passed to the data handler. */
int max_output_len;
- /*! \brief TRUE if we are in transparent (i.e. uncompressable) mode */
- int transparent;
+ /*! \brief True if we are in transparent (i.e. uncompressable) mode */
+ bool transparent;
/*! \brief Next empty dictionary entry */
uint16_t v42bis_parm_c1;
/*! \brief Current codeword size */
/*! \brief The current value of the escape code */
uint8_t escape_code;
- /*! \brief TRUE if we just hit an escape code, and are waiting for the following octet */
- int escaped;
+ /*! \brief True if we just hit an escape code, and are waiting for the following octet */
+ bool escaped;
} v42bis_comp_state_t;
/*!
struct v8_state_s
{
- /*! \brief TRUE if we are the calling party */
- int calling_party;
+ /*! \brief True if we are the calling party */
+ bool calling_party;
/*! \brief A handler to process the V.8 signals */
v8_result_handler_t result_handler;
/*! \brief The current state of the V.8 protocol */
int state;
- int fsk_tx_on;
+ bool fsk_tx_on;
int modem_connect_tone_tx_on;
int negotiation_timer;
int ci_timer;
testing for matches. */
uint8_t cm_jm_data[64];
int cm_jm_len;
- int got_cm_jm;
- int got_cj;
+ bool got_cm_jm;
+ bool got_cj;
int zero_byte_count;
/*! \brief Error and flow logging control */
logging_state_t logging;
/*! Check if a queue is empty.
\brief Check if a queue is empty.
\param s The queue context.
- \return TRUE if empty, else FALSE. */
-SPAN_DECLARE(int) queue_empty(queue_state_t *s);
+ \return True if empty, else false. */
+SPAN_DECLARE(bool) queue_empty(queue_state_t *s);
/*! Check the available free space in a queue's buffer.
\brief Check available free space.
--- /dev/null
+/*
+ * SpanDSP - a series of DSP components for telephony
+ *
+ * stdbool.h - A version for systems which lack their own stdbool.h
+ *
+ * Written by Steve Underwood <steveu@coppice.org>
+ *
+ * Copyright (C) 2003 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 */
+
+
+/*
+ * ISO C Standard: 7.16 Boolean type and values <stdbool.h>
+ */
+
+#if !defined(_STDBOOL_H)
+#define _STDBOOL_H
+
+#if !defined(__cplusplus)
+
+#define _Bool int
+#define bool int
+#define false 0
+#define true (!false)
+
+#else
+
+#define _Bool bool
+#define bool bool
+#define false false
+#define true true
+
+#endif
+
+/* Signal that all the definitions are present. */
+#define __bool_true_false_are_defined 1
+
+#endif
\section t30_page_sec_1 What does it do?
The T.30 protocol is the core protocol used for FAX transmission. This module
-implements most of its key featrues. It does not interface to the outside work.
+implements most of its key features. It does not interface to the outside work.
Seperate modules do that for T.38, analogue line, and other forms of FAX
communication.
\brief T.30 real time frame handler.
\param s The T.30 context.
\param user_data An opaque pointer.
- \param direction TRUE for incoming, FALSE for outgoing.
+ \param incoming True for incoming, false for outgoing.
\param msg The HDLC message.
\param len The length of the message.
*/
typedef void (*t30_real_time_frame_handler_t)(t30_state_t *s,
void *user_data,
- int direction,
+ bool direction,
const uint8_t msg[],
int len);
\param user_data An opaque pointer.
\param type The modem, tone or silence to be sent or received.
\param bit_rate The bit rate of the modem to be sent or received.
- \param short_train TRUE if the short training sequence should be used (where one exists).
- \param use_hdlc FALSE for bit stream, TRUE for HDLC framing.
+ \param short_train True if the short training sequence should be used (where one exists).
+ \param use_hdlc False for bit stream, true for HDLC framing.
*/
typedef void (*t30_set_handler_t)(void *user_data, int type, int bit_rate, int short_train, int use_hdlc);
{
/*! \brief The current bit rate for image transfer. */
int bit_rate;
- /*! \brief TRUE if error correcting mode is used. */
+ /*! \brief True if error correcting mode is used. */
int error_correcting_mode;
/*! \brief The number of pages sent so far. */
int pages_tx;
/*! Initialise a T.30 context.
\brief Initialise a T.30 context.
\param s The T.30 context.
- \param calling_party TRUE if the context is for a calling party. FALSE if the
+ \param calling_party True if the context is for a calling party. False if the
context is for an answering party.
\param set_rx_type_handler
\param set_rx_type_user_data
if the job has finished.
\brief Check if a T.30 call is still active.
\param s The T.30 context.
- \return TRUE for call still active, or FALSE for call completed. */
+ \return True for call still active, or false for call completed. */
SPAN_DECLARE(int) t30_call_active(t30_state_t *s);
/*! Cleanup a T.30 context if the call terminates.
\param user_data The T.30 context.
\param msg The HDLC message.
\param len The length of the message, in octets.
- \param ok TRUE if the frame was received without error. */
+ \param ok True if the frame was received without error. */
SPAN_DECLARE_NONSTD(void) t30_hdlc_accept(void *user_data, const uint8_t msg[], int len, int ok);
/*! Report the passage of time to the T.30 engine.
/*! Request a local interrupt of FAX exchange.
\brief Request a local interrupt of FAX exchange.
\param s The T.30 context.
- \param state TRUE to enable interrupt request, else FALSE. */
+ \param state True to enable interrupt request, else false. */
SPAN_DECLARE(void) t30_local_interrupt_request(t30_state_t *s, int state);
/*! Allow remote interrupts of FAX exchange.
\brief Allow remote interrupts of FAX exchange.
\param s The T.30 context.
- \param state TRUE to allow interruptd, else FALSE. */
+ \param state True to allow interruptd, else false. */
SPAN_DECLARE(void) t30_remote_interrupts_allowed(t30_state_t *s, int state);
#if defined(__cplusplus)
/*! Set page header extends or overlays the image mode.
\brief Set page header overlay mode.
\param s The T.30 context.
- \param header_overlays_image TRUE for overlay, or FALSE for extend the page. */
-SPAN_DECLARE(int) t30_set_tx_page_header_overlays_image(t30_state_t *s, int header_overlays_image);
+ \param header_overlays_image True for overlay, or false for extend the page. */
+SPAN_DECLARE(int) t30_set_tx_page_header_overlays_image(t30_state_t *s, bool header_overlays_image);
/*! Set the transmitted header information associated with a T.30 context.
\brief Set the transmitted header information associated with a T.30 context.
/*! Set Internet aware FAX (IAF) mode.
\brief Set Internet aware FAX (IAF) mode.
\param s The T.30 context.
- \param iaf TRUE for IAF, or FALSE for non-IAF. */
-SPAN_DECLARE(void) t30_set_iaf_mode(t30_state_t *s, int iaf);
+ \param iaf True for IAF, or false for non-IAF. */
+SPAN_DECLARE(void) t30_set_iaf_mode(t30_state_t *s, bool iaf);
/*! Specify if error correction mode (ECM) is allowed by a T.30 context.
\brief Select ECM capability.
\param s The T.30 context.
- \param enabled TRUE for ECM capable, FALSE for not ECM capable.
+ \param enabled True for ECM capable, or false for not ECM capable.
\return 0 if OK, else -1. */
-SPAN_DECLARE(int) t30_set_ecm_capability(t30_state_t *s, int enabled);
+SPAN_DECLARE(int) t30_set_ecm_capability(t30_state_t *s, bool enabled);
/*! Specify the output encoding for TIFF files created during FAX reception.
\brief Specify the output encoding for TIFF files created during FAX reception.
/*! Select whether silent audio will be sent when transmit is idle.
\brief Select whether silent audio will be sent when transmit is idle.
\param s The T.31 modem context.
- \param transmit_on_idle TRUE if silent audio should be output when the transmitter is
- idle. FALSE to transmit zero length audio when the transmitter is idle. The default
- behaviour is FALSE.
+ \param transmit_on_idle True if silent audio should be output when the transmitter is
+ idle. False to transmit zero length audio when the transmitter is idle. The default
+ behaviour is false.
*/
-SPAN_DECLARE(void) t31_set_transmit_on_idle(t31_state_t *s, int transmit_on_idle);
+SPAN_DECLARE(void) t31_set_transmit_on_idle(t31_state_t *s, bool transmit_on_idle);
/*! Select whether TEP mode will be used (or time allowed for it (when transmitting).
\brief Select whether TEP mode will be used.
\param s The T.31 modem context.
- \param use_tep TRUE if TEP is to be ised.
+ \param use_tep True if TEP is to be used.
*/
-SPAN_DECLARE(void) t31_set_tep_mode(t31_state_t *s, int use_tep);
+SPAN_DECLARE(void) t31_set_tep_mode(t31_state_t *s, bool use_tep);
/*! Select whether T.38 data will be paced as it is transmitted.
\brief Select whether T.38 data will be paced.
\param s The T.31 modem context.
- \param without_pacing TRUE if data is to be sent as fast as possible. FALSE if it is
+ \param without_pacing True if data is to be sent as fast as possible. False if it is
to be paced.
*/
-SPAN_DECLARE(void) t31_set_t38_config(t31_state_t *s, int without_pacing);
+SPAN_DECLARE(void) t31_set_t38_config(t31_state_t *s, bool without_pacing);
/*! Set audio or T.38 mode.
\brief Set audio or T.38 mode.
\param s The T.31 modem context.
- \param t38_mode TRUE for T.38 mode operation. FALSE for audio mode operation.
+ \param t38_mode True for T.38 mode operation. False for audio mode operation.
*/
-SPAN_DECLARE(void) t31_set_mode(t31_state_t *s, int t38_mode);
+SPAN_DECLARE(void) t31_set_mode(t31_state_t *s, bool t38_mode);
/*! Get a pointer to the logging context associated with a T.31 context.
\brief Get a pointer to the logging context associated with a T.31 context.
\param model A pointer which will be pointed to the identified model.
If a NULL pointer is given, the model will not be returned.
If the model is not identified, NULL will be returned.
- \return TRUE if the machine was identified, otherwise FALSE.
+ \return True if the machine was identified.
*/
-SPAN_DECLARE(int) t35_decode(const uint8_t *msg, int len, const char **country, const char **vendor, const char **model);
+SPAN_DECLARE(bool) t35_decode(const uint8_t *msg, int len, const char **country, const char **vendor, const char **model);
#if defined(__cplusplus)
}
/*! Set the non-ECM fill bit removal mode.
\param s The T.38 context.
- \param fill_bit_removal TRUE to remove fill bits across the T.38 link, else FALSE.
+ \param fill_bit_removal True to remove fill bits across the T.38 link.
*/
-SPAN_DECLARE(void) t38_set_fill_bit_removal(t38_core_state_t *s, int fill_bit_removal);
+SPAN_DECLARE(void) t38_set_fill_bit_removal(t38_core_state_t *s, bool fill_bit_removal);
/*! Set the MMR transcoding mode.
\param s The T.38 context.
- \param mmr_transcoding TRUE to transcode to MMR across the T.38 link, else FALSE.
+ \param mmr_transcoding True to transcode to MMR across the T.38 link.
*/
-SPAN_DECLARE(void) t38_set_mmr_transcoding(t38_core_state_t *s, int mmr_transcoding);
+SPAN_DECLARE(void) t38_set_mmr_transcoding(t38_core_state_t *s, bool mmr_transcoding);
/*! Set the JBIG transcoding mode.
\param s The T.38 context.
- \param jbig_transcoding TRUE to transcode to JBIG across the T.38 link, else FALSE.
+ \param jbig_transcoding True to transcode to JBIG across the T.38 link.
*/
-SPAN_DECLARE(void) t38_set_jbig_transcoding(t38_core_state_t *s, int jbig_transcoding);
+SPAN_DECLARE(void) t38_set_jbig_transcoding(t38_core_state_t *s, bool jbig_transcoding);
/*! Set the maximum buffer size for received data at the far end.
\param s The T.38 context.
/*! Set the sequence number handling option.
\param s The T.38 context.
- \param check TRUE to check sequence numbers, and handle gaps reasonably. FALSE
+ \param check True to check sequence numbers, and handle gaps reasonably. False
for no sequence number processing (e.g. for TPKT over TCP transport).
*/
-SPAN_DECLARE(void) t38_set_sequence_number_handling(t38_core_state_t *s, int check);
+SPAN_DECLARE(void) t38_set_sequence_number_handling(t38_core_state_t *s, bool check);
/*! Set the TEP handling option.
\param s The T.38 context.
- \param allow_for_tep TRUE to allow for TEP playout, else FALSE.
+ \param allow_for_tep True to allow for TEP playout.
*/
-SPAN_DECLARE(void) t38_set_tep_handling(t38_core_state_t *s, int allow_for_tep);
+SPAN_DECLARE(void) t38_set_tep_handling(t38_core_state_t *s, bool allow_for_tep);
/*! Get a pointer to the logging context associated with a T.38 context.
\brief Get a pointer to the logging context associated with a T.38 context.
\brief T.30 real time frame handler.
\param s The T.30 context.
\param user_data An opaque pointer.
- \param direction TRUE for incoming, FALSE for outgoing.
+ \param incoming True for incoming, false for outgoing.
\param msg The HDLC message.
\param len The length of the message.
*/
typedef void (*t38_gateway_real_time_frame_handler_t)(t38_gateway_state_t *s,
void *user_data,
- int direction,
+ bool incoming,
const uint8_t *msg,
int len);
{
/*! \brief The current bit rate for image transfer. */
int bit_rate;
- /*! \brief TRUE if error correcting mode is used. */
- int error_correcting_mode;
+ /*! \brief True if error correcting mode is used. */
+ bool error_correcting_mode;
/*! \brief The number of pages transferred so far. */
int pages_transferred;
} t38_stats_t;
/*! Control whether error correcting mode (ECM) is allowed.
\brief Control whether error correcting mode (ECM) is allowed.
\param s The T.38 context.
- \param ecm_allowed TRUE is ECM is to be allowed.
+ \param ecm_allowed True is ECM is to be allowed.
*/
-SPAN_DECLARE(void) t38_gateway_set_ecm_capability(t38_gateway_state_t *s, int ecm_allowed);
+SPAN_DECLARE(void) t38_gateway_set_ecm_capability(t38_gateway_state_t *s, bool ecm_allowed);
/*! Select whether silent audio will be sent when transmit is idle.
\brief Select whether silent audio will be sent when transmit is idle.
\param s The T.38 context.
- \param transmit_on_idle TRUE if silent audio should be output when the FAX transmitter is
- idle. FALSE to transmit zero length audio when the FAX transmitter is idle. The default
- behaviour is FALSE.
+ \param transmit_on_idle True if silent audio should be output when the FAX transmitter is
+ idle. False to transmit zero length audio when the FAX transmitter is idle. The default
+ behaviour is false.
*/
-SPAN_DECLARE(void) t38_gateway_set_transmit_on_idle(t38_gateway_state_t *s, int transmit_on_idle);
+SPAN_DECLARE(void) t38_gateway_set_transmit_on_idle(t38_gateway_state_t *s, bool transmit_on_idle);
/*! Specify which modem types are supported by a T.30 context.
\brief Specify supported modems.
/*! Select whether talker echo protection tone will be sent for the image modems.
\brief Select whether TEP will be sent for the image modems.
\param s The T.38 context.
- \param use_tep TRUE if TEP should be sent.
+ \param use_tep True if TEP should be sent.
*/
-SPAN_DECLARE(void) t38_gateway_set_tep_mode(t38_gateway_state_t *s, int use_tep);
+SPAN_DECLARE(void) t38_gateway_set_tep_mode(t38_gateway_state_t *s, bool use_tep);
/*! Select whether non-ECM fill bits are to be removed during transmission.
\brief Select whether non-ECM fill bits are to be removed during transmission.
\param s The T.38 context.
- \param remove TRUE if fill bits are to be removed.
+ \param remove True if fill bits are to be removed.
*/
-SPAN_DECLARE(void) t38_gateway_set_fill_bit_removal(t38_gateway_state_t *s, int remove);
+SPAN_DECLARE(void) t38_gateway_set_fill_bit_removal(t38_gateway_state_t *s, bool remove);
/*! Get the current transfer statistics for the current T.38 session.
\brief Get the current transfer statistics.
/*! \brief Initialise a T.38 rate adapting non-ECM buffer context.
\param s The buffer context.
- \param mode TRUE for image data mode, or FALSE for TCF mode.
+ \param image_mode True for image data mode, or false for TCF mode.
\param bits The minimum number of bits per FAX image row.
\return A pointer to the buffer context, or NULL if there was a problem. */
-SPAN_DECLARE(t38_non_ecm_buffer_state_t *) t38_non_ecm_buffer_init(t38_non_ecm_buffer_state_t *s, int mode, int min_row_bits);
+SPAN_DECLARE(t38_non_ecm_buffer_state_t *) t38_non_ecm_buffer_init(t38_non_ecm_buffer_state_t *s, bool image_mode, int min_row_bits);
SPAN_DECLARE(int) t38_non_ecm_buffer_release(t38_non_ecm_buffer_state_t *s);
/*! \brief Set the mode of a T.38 rate adapting non-ECM buffer context.
\param s The buffer context.
- \param mode TRUE for image data mode, or FALSE for TCF mode.
+ \param mode True for image data mode, or false for TCF mode.
\param bits The minimum number of bits per FAX image row. */
-SPAN_DECLARE(void) t38_non_ecm_buffer_set_mode(t38_non_ecm_buffer_state_t *s, int mode, int min_row_bits);
+SPAN_DECLARE(void) t38_non_ecm_buffer_set_mode(t38_non_ecm_buffer_state_t *s, bool image_mode, int min_row_bits);
/*! \brief Inject data to T.38 rate adapting non-ECM buffer context.
\param s The buffer context.
/*! Select whether the time for talker echo protection tone will be allowed for when sending.
\brief Select whether TEP time will be allowed for.
\param s The T.38 context.
- \param use_tep TRUE if TEP should be allowed for.
+ \param use_tep True if TEP should be allowed for.
*/
-SPAN_DECLARE(void) t38_terminal_set_tep_mode(t38_terminal_state_t *s, int use_tep);
+SPAN_DECLARE(void) t38_terminal_set_tep_mode(t38_terminal_state_t *s, bool use_tep);
/*! Select whether non-ECM fill bits are to be removed during transmission.
\brief Select whether non-ECM fill bits are to be removed during transmission.
\param s The T.38 context.
- \param remove TRUE if fill bits are to be removed.
+ \param remove True if fill bits are to be removed.
*/
-SPAN_DECLARE(void) t38_terminal_set_fill_bit_removal(t38_terminal_state_t *s, int remove);
+SPAN_DECLARE(void) t38_terminal_set_fill_bit_removal(t38_terminal_state_t *s, bool remove);
/*! Get a pointer to the T.30 engine associated with a termination mode T.38 context.
\brief Get a pointer to the T.30 engine associated with a T.38 context.
/*! \brief Reinitialise a termination mode T.38 context.
\param s The T.38 context.
- \param calling_party TRUE if the context is for a calling party. FALSE if the
+ \param calling_party True if the context is for a calling party. False if the
context is for an answering party.
\return 0 for OK, else -1. */
SPAN_DECLARE(int) t38_terminal_restart(t38_terminal_state_t *s,
- int calling_party);
+ bool calling_party);
/*! \brief Initialise a termination mode T.38 context.
\param s The T.38 context.
- \param calling_party TRUE if the context is for a calling party. FALSE if the
+ \param calling_party True if the context is for a calling party. False if the
context is for an answering party.
\param tx_packet_handler A callback routine to encapsulate and transmit T.38 packets.
\param tx_packet_user_data An opaque pointer passed to the tx_packet_handler routine.
\return A pointer to the termination mode T.38 context, or NULL if there was a problem. */
SPAN_DECLARE(t38_terminal_state_t *) t38_terminal_init(t38_terminal_state_t *s,
- int calling_party,
+ bool calling_party,
t38_tx_packet_handler_t tx_packet_handler,
void *tx_packet_user_data);
/*! \brief Put a bit of the current document page.
\param s The T.4 context.
\param bit The data bit.
- \return TRUE when the bit ends the document page, otherwise FALSE. */
+ \return Decode status. */
SPAN_DECLARE(int) t4_rx_put_bit(t4_rx_state_t *s, int bit);
/*! \brief Put a byte of the current document page.
\param s The T.4 context.
\param buf The buffer containing the chunk.
\param len The length of the chunk.
- \return TRUE when the byte ends the document page, otherwise FALSE. */
+ \return Decode status. */
SPAN_DECLARE(int) t4_rx_put(t4_rx_state_t *s, const uint8_t buf[], size_t len);
/*! \brief Complete the reception of a page.
/*! \brief Put a bit of the current document page.
\param s The T.4/T.6 context.
\param bit The data bit.
- \return TRUE when the bit ends the document page, otherwise FALSE. */
+ \return Decode status. */
SPAN_DECLARE(int) t4_t6_decode_put_bit(t4_t6_decode_state_t *s, int bit);
/*! \brief Put a byte of the current document page.
/*! Set page header extends or overlays the image mode.
\brief Set page header overlay mode.
\param s The T.4 context.
- \param header_overlays_image TRUE for overlay, or FALSE for extend the page. */
-SPAN_DECLARE(void) t4_tx_set_header_overlays_image(t4_tx_state_t *s, int header_overlays_image);
+ \param header_overlays_image True for overlay, or false to extend the page. */
+SPAN_DECLARE(void) t4_tx_set_header_overlays_image(t4_tx_state_t *s, bool header_overlays_image);
/*! \brief Set the row read handler for a T.4 transmit context.
\param s The T.4 transmit context.
#define ms_to_samples(t) ((t)*(SAMPLE_RATE/1000))
#define us_to_samples(t) ((t)/(1000000/SAMPLE_RATE))
-#if !defined(FALSE)
-#define FALSE 0
-#endif
-#if !defined(TRUE)
-#define TRUE (!FALSE)
-#endif
-
/* Fixed point constant macros */
#define FP_Q_9_7(x) ((int16_t) (128.0*x + ((x >= 0.0) ? 0.5 : -0.5)))
#define FP_Q_8_8(x) ((int16_t) (256.0*x + ((x >= 0.0) ? 0.5 : -0.5)))
\brief Reinitialise an existing V.17 modem receive context.
\param s The modem context.
\param bit_rate The bit rate of the modem. Valid values are 7200, 9600, 12000 and 14400.
- \param short_train TRUE if a short training sequence is expected.
+ \param short_train True if a short training sequence is expected.
\return 0 for OK, -1 for bad parameter */
-SPAN_DECLARE(int) v17_rx_restart(v17_rx_state_t *s, int bit_rate, int short_train);
+SPAN_DECLARE(int) v17_rx_restart(v17_rx_state_t *s, int bit_rate, bool short_train);
/*! Release a V.17 modem receive context.
\brief Release a V.17 modem receive context.
\brief Initialise a V.17 modem transmit context.
\param s The modem context.
\param bit_rate The bit rate of the modem. Valid values are 7200, 9600, 12000 and 14400.
- \param tep TRUE is the optional TEP tone is to be transmitted.
+ \param tep True is the optional TEP tone is to be transmitted.
\param get_bit The callback routine used to get the data to be transmitted.
\param user_data An opaque pointer.
\return A pointer to the modem context, or NULL if there was a problem. */
-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);
+SPAN_DECLARE(v17_tx_state_t *) v17_tx_init(v17_tx_state_t *s, int bit_rate, bool tep, get_bit_func_t get_bit, void *user_data);
/*! Reinitialise an existing V.17 modem transmit context, so it may be reused.
\brief Reinitialise an existing V.17 modem transmit context.
\param s The modem context.
\param bit_rate The bit rate of the modem. Valid values are 7200, 9600, 12000 and 14400.
- \param tep TRUE is the optional TEP tone is to be transmitted.
- \param short_train TRUE if the short training sequence should be used.
+ \param tep True is the optional TEP tone is to be transmitted.
+ \param short_train True if the short training sequence should be used.
\return 0 for OK, -1 for parameter error. */
-SPAN_DECLARE(int) v17_tx_restart(v17_tx_state_t *s, int bit_rate, int tep, int short_train);
+SPAN_DECLARE(int) v17_tx_restart(v17_tx_state_t *s, int bit_rate, bool tep, bool short_train);
/*! Release a V.17 modem transmit context.
\brief Release a V.17 modem transmit context.
/*! Initialise a V.18 context.
\brief Initialise a V.18 context.
\param s The V.18 context.
- \param calling_party TRUE if caller mode, else answerer mode.
+ \param calling_party True if caller mode, else answerer mode.
\param mode Mode of operation.
\param nation National variant for automoding.
\param put_msg A callback routine called to deliver the received text
\param user_data An opaque pointer for the callback routine.
\return A pointer to the V.18 context, or NULL if there was a problem. */
SPAN_DECLARE(v18_state_t *) v18_init(v18_state_t *s,
- int calling_party,
+ bool calling_party,
int mode,
int nation,
put_msg_func_t put_msg,
/*! Request a loopback 2 for a V.22bis modem context.
\brief Request a loopback 2 for a V.22bis modem context.
\param s The modem context.
- \param enable TRUE to enable loopback, or FALSE to disable it.
+ \param enable True to enable loopback, or false to disable it.
\return 0 for OK, -1 for request reject. */
-SPAN_DECLARE(int) v22bis_remote_loopback(v22bis_state_t *s, int enable);
+SPAN_DECLARE(int) v22bis_remote_loopback(v22bis_state_t *s, bool enable);
/*! 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.
\param bit_rate The bit rate of the modem. Valid values are 1200 and 2400.
\param guard The guard tone option. 0 = none, 1 = 550Hz, 2 = 1800Hz.
- \param calling_party TRUE if this is the calling modem.
+ \param calling_party True if this is the calling modem.
\param get_bit The callback routine used to get the data to be transmitted.
\param put_bit The callback routine used to get the data to be transmitted.
\param user_data An opaque pointer, passed in calls to the get and put routines.
SPAN_DECLARE(v22bis_state_t *) v22bis_init(v22bis_state_t *s,
int bit_rate,
int guard,
- int calling_party,
+ bool calling_party,
get_bit_func_t get_bit,
void *get_bit_user_data,
put_bit_func_t put_bit,
\brief Reinitialise an existing V.27ter modem receive context.
\param s The modem context.
\param bit_rate The bit rate of the modem. Valid values are 2400 and 4800.
- \param old_train TRUE if a previous trained values are to be reused.
+ \param old_train True if a previous trained values are to be reused.
\return 0 for OK, -1 for bad parameter */
-SPAN_DECLARE(int) v27ter_rx_restart(v27ter_rx_state_t *s, int bit_rate, int old_train);
+SPAN_DECLARE(int) v27ter_rx_restart(v27ter_rx_state_t *s, int bit_rate, bool old_train);
/*! Release a V.27ter modem receive context.
\brief Release a V.27ter modem receive context.
\brief Initialise a V.27ter modem transmit context.
\param s The modem context.
\param bit_rate The bit rate of the modem. Valid values are 2400 and 4800.
- \param tep TRUE is the optional TEP tone is to be transmitted.
+ \param tep True is the optional TEP tone is to be transmitted.
\param get_bit The callback routine used to get the data to be transmitted.
\param user_data An opaque pointer.
\return A pointer to the modem context, or NULL if there was a problem. */
-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);
+SPAN_DECLARE(v27ter_tx_state_t *) v27ter_tx_init(v27ter_tx_state_t *s, int bit_rate, bool tep, get_bit_func_t get_bit, void *user_data);
/*! Reinitialise an existing V.27ter modem transmit context, so it may be reused.
\brief Reinitialise an existing V.27ter modem transmit context.
\param s The modem context.
\param bit_rate The bit rate of the modem. Valid values are 2400 and 4800.
- \param tep TRUE is the optional TEP tone is to be transmitted.
+ \param tep True is the optional TEP tone is to be transmitted.
\return 0 for OK, -1 for bad parameter */
-SPAN_DECLARE(int) v27ter_tx_restart(v27ter_tx_state_t *s, int bit_rate, int tep);
+SPAN_DECLARE(int) v27ter_tx_restart(v27ter_tx_state_t *s, int bit_rate, bool tep);
/*! Release a V.27ter modem transmit context.
\brief Release a V.27ter modem transmit context.
\brief Reinitialise an existing V.29 modem receive context.
\param s The modem context.
\param bit_rate The bit rate of the modem. Valid values are 4800, 7200 and 9600.
- \param old_train TRUE if a previous trained values are to be reused.
+ \param old_train True if a previous trained values are to be reused.
\return 0 for OK, -1 for bad parameter */
-SPAN_DECLARE(int) v29_rx_restart(v29_rx_state_t *s, int bit_rate, int old_train);
+SPAN_DECLARE(int) v29_rx_restart(v29_rx_state_t *s, int bit_rate, bool old_train);
/*! Release a V.29 modem receive context.
\brief Release a V.29 modem receive context.
\brief Initialise a V.29 modem transmit context.
\param s The modem context.
\param bit_rate The bit rate of the modem. Valid values are 4800, 7200 and 9600.
- \param tep TRUE is the optional TEP tone is to be transmitted.
+ \param tep True is the optional TEP tone is to be transmitted.
\param get_bit The callback routine used to get the data to be transmitted.
\param user_data An opaque pointer.
\return A pointer to the modem context, or NULL if there was a problem. */
-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);
+SPAN_DECLARE(v29_tx_state_t *) v29_tx_init(v29_tx_state_t *s, int bit_rate, bool tep, get_bit_func_t get_bit, void *user_data);
/*! Reinitialise an existing V.29 modem transmit context, so it may be reused.
\brief Reinitialise an existing V.29 modem transmit context.
\param s The modem context.
\param bit_rate The bit rate of the modem. Valid values are 4800, 7200 and 9600.
- \param tep TRUE is the optional TEP tone is to be transmitted.
+ \param tep True is the optional TEP tone is to be transmitted.
\return 0 for OK, -1 for bad parameter */
-SPAN_DECLARE(int) v29_tx_restart(v29_tx_state_t *s, int bit_rate, int tep);
+SPAN_DECLARE(int) v29_tx_restart(v29_tx_state_t *s, int bit_rate, bool tep);
/*! Release a V.29 modem transmit context.
\brief Release a V.29 modem transmit context.
/*! Initialise a V.42 context.
\param s The V.42 context.
- \param calling_party TRUE if caller mode, else answerer mode.
- \param detect TRUE to perform the V.42 detection, else go straight into LAP.M
+ \param calling_party True if caller mode, else answerer mode.
+ \param detect True to perform the V.42 detection, else go straight into LAP.M
\param iframe_get A callback function to handle received frames of data.
\param iframe_put A callback function to get frames of data for transmission.
\param user_data An opaque pointer passed to the frame handler routines.
\return ???
*/
SPAN_DECLARE(v42_state_t *) v42_init(v42_state_t *s,
- int calling_party,
- int detect,
+ bool calling_party,
+ bool detect,
get_msg_func_t iframe_get,
put_msg_func_t iframe_put,
void *user_data);
#endif
SPAN_DECLARE(int) v8_restart(v8_state_t *s,
- int calling_party,
+ bool calling_party,
v8_parms_t *parms);
/*! Initialise a V.8 context.
\brief Initialise a V.8 context.
\param s The V.8 context.
- \param calling_party TRUE if caller mode, else answerer mode.
+ \param calling_party True if caller mode, else answerer mode.
\param parms The allowed parameters for the call.
\param result_handler The callback routine used to handle the results of negotiation.
\param user_data An opaque pointer passed to the result_handler routine.
\return A pointer to the V.8 context, or NULL if there was a problem. */
SPAN_DECLARE(v8_state_t *) v8_init(v8_state_t *s,
- int calling_party,
+ bool calling_party,
v8_parms_t *parms,
v8_result_handler_t result_handler,
void *user_data);
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include "spandsp/telephony.h"
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include <tiffio.h>
if (s->document_handler)
more = s->document_handler(s, s->document_user_data, 0);
else
- more = FALSE;
+ more = false;
if (more)
{
span_log(&s->logging, SPAN_LOG_FLOW, "Another document to send\n");
}
s->ecm_frames = i;
span_log(&s->logging, SPAN_LOG_FLOW, "Partial page buffer contains %d frames (%d per frame)\n", i, s->octets_per_ecm_frame);
- s->ecm_at_page_end = TRUE;
+ s->ecm_at_page_end = true;
return i;
}
s->ecm_len[i] = (int16_t) (4 + len);
send_frame(s, frame, 3);
/* In case we are just after a CTC/CTR exchange, which kicked us back
to long training */
- s->short_train = TRUE;
+ s->short_train = true;
return 0;
}
return -1;
print_frame(s, "Tx: ", msg, len);
if (s->real_time_frame_handler)
- s->real_time_frame_handler(s, s->real_time_frame_user_data, FALSE, msg, len);
+ s->real_time_frame_handler(s, s->real_time_frame_user_data, false, msg, len);
if (s->send_hdlc_handler)
s->send_hdlc_handler(s->send_hdlc_user_data, msg, len);
}
s->tx_info.nsf[1] = CONTROL_FIELD_NON_FINAL_FRAME;
s->tx_info.nsf[2] = (uint8_t) (T30_NSF | s->dis_received);
send_frame(s, s->tx_info.nsf, s->tx_info.nsf_len + 3);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
/*- End of function --------------------------------------------------------*/
s->tx_info.nss[1] = CONTROL_FIELD_NON_FINAL_FRAME;
s->tx_info.nss[2] = (uint8_t) (T30_NSS | s->dis_received);
send_frame(s, s->tx_info.nss, s->tx_info.nss_len + 3);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
/*- End of function --------------------------------------------------------*/
s->tx_info.nsc[1] = CONTROL_FIELD_NON_FINAL_FRAME;
s->tx_info.nsc[2] = (uint8_t) (T30_NSC | s->dis_received);
send_frame(s, s->tx_info.nsc, s->tx_info.nsc_len + 3);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
/*- End of function --------------------------------------------------------*/
span_log(&s->logging, SPAN_LOG_FLOW, "Sending ident '%s'\n", s->tx_info.ident);
/* 'cmd' should be T30_TSI, T30_CIG or T30_CSI */
send_20digit_msg_frame(s, cmd, s->tx_info.ident);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
/*- End of function --------------------------------------------------------*/
span_log(&s->logging, SPAN_LOG_FLOW, "Sending polled sub-address '%s'\n", s->tx_info.polled_sub_address);
send_20digit_msg_frame(s, T30_PSA, s->tx_info.polled_sub_address);
set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_POLLED_SUBADDRESSING_CAPABLE);
- return TRUE;
+ return true;
}
clr_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_POLLED_SUBADDRESSING_CAPABLE);
- return FALSE;
+ return false;
}
/*- End of function --------------------------------------------------------*/
span_log(&s->logging, SPAN_LOG_FLOW, "Sending selective polling address '%s'\n", s->tx_info.selective_polling_address);
send_20digit_msg_frame(s, T30_SEP, s->tx_info.selective_polling_address);
set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_SELECTIVE_POLLING_CAPABLE);
- return TRUE;
+ return true;
}
clr_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_SELECTIVE_POLLING_CAPABLE);
- return FALSE;
+ return false;
}
/*- End of function --------------------------------------------------------*/
span_log(&s->logging, SPAN_LOG_FLOW, "Sending sender identification '%s'\n", s->tx_info.sender_ident);
send_20digit_msg_frame(s, T30_SID, s->tx_info.sender_ident);
set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_SENDER_ID_TRANSMISSION);
- return TRUE;
+ return true;
}
clr_ctrl_bit(s->dcs_frame, T30_DCS_BIT_SENDER_ID_TRANSMISSION);
- return FALSE;
+ return false;
}
/*- End of function --------------------------------------------------------*/
span_log(&s->logging, SPAN_LOG_FLOW, "Sending password '%s'\n", s->tx_info.password);
send_20digit_msg_frame(s, T30_PWD, s->tx_info.password);
set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_PASSWORD);
- return TRUE;
+ return true;
}
clr_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_PASSWORD);
- return FALSE;
+ return false;
}
/*- End of function --------------------------------------------------------*/
span_log(&s->logging, SPAN_LOG_FLOW, "Sending sub-address '%s'\n", s->tx_info.sub_address);
send_20digit_msg_frame(s, T30_SUB, s->tx_info.sub_address);
set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_SUBADDRESS_TRANSMISSION);
- return TRUE;
+ return true;
}
clr_ctrl_bit(s->dcs_frame, T30_DCS_BIT_SUBADDRESS_TRANSMISSION);
- return FALSE;
+ return false;
}
/*- End of function --------------------------------------------------------*/
if ((test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_T37) || test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_T38)) && 0)
{
span_log(&s->logging, SPAN_LOG_FLOW, "Sending transmitting subscriber internet address '%s'\n", "");
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
/*- End of function --------------------------------------------------------*/
{
span_log(&s->logging, SPAN_LOG_FLOW, "Sending internet routing address '%s'\n", "");
set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_INTERNET_ROUTING_ADDRESS_TRANSMISSION);
- return TRUE;
+ return true;
}
clr_ctrl_bit(s->dcs_frame, T30_DCS_BIT_INTERNET_ROUTING_ADDRESS_TRANSMISSION);
- return FALSE;
+ return false;
}
/*- End of function --------------------------------------------------------*/
if ((test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_T37) || test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_T38)) && 0)
{
span_log(&s->logging, SPAN_LOG_FLOW, "Sending calling subscriber internet address '%s'\n", "");
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
/*- End of function --------------------------------------------------------*/
{
span_log(&s->logging, SPAN_LOG_FLOW, "Sending internet selective polling address '%s'\n", "");
set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_INTERNET_SELECTIVE_POLLING_ADDRESS);
- return TRUE;
+ return true;
}
clr_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_INTERNET_SELECTIVE_POLLING_ADDRESS);
- return FALSE;
+ return false;
}
/*- End of function --------------------------------------------------------*/
if (("in T.37 mode" || "in T.38 mode") && 0)
{
span_log(&s->logging, SPAN_LOG_FLOW, "Sending called subscriber internet address '%s'\n", "");
- return TRUE;
+ return true;
}
#endif
- return FALSE;
+ return false;
}
/*- End of function --------------------------------------------------------*/
s->dcs_frame[4] |= fallback_sequence[s->current_fallback].dcs_code;
/* Select the compression to use. */
- use_bilevel = TRUE;
+ use_bilevel = true;
set_ctrl_bits(s->dcs_frame, s->min_scan_time_code, T30_DCS_BIT_MIN_SCAN_LINE_TIME_1);
switch (s->line_compression)
{
//if (???????? & T4_COMPRESSION_?????))
// set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_PREFERRED_HUFFMAN_TABLES);
set_ctrl_bits(s->dcs_frame, T30_MIN_SCAN_0MS, T30_DCS_BIT_MIN_SCAN_LINE_TIME_1);
- use_bilevel = FALSE;
+ use_bilevel = false;
break;
#if defined(SPANDSP_SUPPORT_T43)
case T4_COMPRESSION_T43:
//if (???????? & T4_COMPRESSION_NO_SUBSAMPLING))
// set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_NO_SUBSAMPLING);
set_ctrl_bits(s->dcs_frame, T30_MIN_SCAN_0MS, T30_DCS_BIT_MIN_SCAN_LINE_TIME_1);
- use_bilevel = FALSE;
+ use_bilevel = false;
break;
#endif
#if defined(SPANDSP_SUPPORT_T45)
case T4_COMPRESSION_T45:
- use_bilevel = FALSE;
+ use_bilevel = false;
break;
#endif
#if defined(SPANDSP_SUPPORT_SYCC_T81)
case T4_COMPRESSION_SYCC_T81:
- use_bilevel = FALSE;
+ use_bilevel = false;
break;
#endif
default:
}
if (msg[2] == T30_DIS)
- s->dis_received = TRUE;
+ s->dis_received = true;
/* Make a local copy of the message, padded to the maximum possible length with zeros. This allows
us to simply pick out the bits, without worrying about whether they were set from the remote side. */
t4_tx_restart_page(&s->t4.tx);
s->retries = 0;
s->ecm_block = 0;
- send_dcs_sequence(s, TRUE);
+ send_dcs_sequence(s, true);
return 0;
}
/*- End of function --------------------------------------------------------*/
span_log(&s->logging, SPAN_LOG_FLOW, "Start receiving document\n");
queue_phase(s, T30_PHASE_B_TX);
s->ecm_block = 0;
- send_dis_or_dtc_sequence(s, TRUE);
+ send_dis_or_dtc_sequence(s, true);
return 0;
}
/*- End of function --------------------------------------------------------*/
return -1;
}
s->retries = 0;
- send_dcs_sequence(s, TRUE);
+ send_dcs_sequence(s, true);
return 0;
}
span_log(&s->logging, SPAN_LOG_FLOW, "%s nothing to send\n", t30_frametype(msg[2]));
return -1;
}
s->retries = 0;
- send_dis_or_dtc_sequence(s, TRUE);
+ send_dis_or_dtc_sequence(s, true);
return 0;
}
span_log(&s->logging, SPAN_LOG_FLOW, "%s nothing to receive\n", t30_frametype(msg[2]));
if (!(s->iaf & T30_IAF_MODE_NO_TCF))
{
/* TCF is always sent with long training */
- s->short_train = FALSE;
+ s->short_train = false;
set_state(s, T30_STATE_F_TCF);
queue_phase(s, T30_PHASE_C_NON_ECM_RX);
timer_t2_start(s);
{
set_state(s, T30_STATE_F_POST_RCP_MCF);
send_simple_frame(s, T30_MCF);
- return TRUE;
+ return true;
}
/* We need to send the PPR frame we have created, to try to fill in the missing/bad data. */
set_state(s, T30_STATE_F_POST_RCP_PPR);
s->ecm_frame_map[1] = CONTROL_FIELD_FINAL_FRAME;
s->ecm_frame_map[2] = (uint8_t) (T30_PPR | s->dis_received);
send_frame(s, s->ecm_frame_map, 3 + 32);
- return FALSE;
+ return false;
}
/*- End of function --------------------------------------------------------*/
/* Build a bit map of which frames we now have stored OK */
first_bad_frame = 256;
- first = TRUE;
+ first = true;
expected_len = 256;
for (i = 0; i < 32; i++)
{
/* Use the length of the first frame as our model for what the length should be */
if (s->ecm_len[frame_no] == 64)
expected_len = 64;
- first = FALSE;
+ first = false;
}
/* Check the length is consistent with the first frame */
if (s->ecm_len[frame_no] != expected_len)
case T30_PRI_EOP:
case T30_EOP:
span_log(&s->logging, SPAN_LOG_FLOW, "End of procedure detected\n");
- s->end_of_procedure_detected = TRUE;
+ s->end_of_procedure_detected = true;
break;
}
}
memcpy(&s->ecm_data[frame_no][0], &msg[4], len - 4);
s->ecm_len[frame_no] = (int16_t) (len - 4);
/* In case we are just after a CTC/CTR exchange, which kicked us back to long training */
- s->short_train = TRUE;
+ s->short_train = true;
}
/* We have received something, so any missing carrier status is out of date */
if (s->current_status == T30_ERR_RX_NOCARRIER)
/* Trainability test succeeded. Send the document. */
span_log(&s->logging, SPAN_LOG_FLOW, "Trainability test succeeded\n");
s->retries = 0;
- s->short_train = TRUE;
+ s->short_train = true;
if (s->error_correcting_mode)
{
set_state(s, T30_STATE_IV);
/* Trainability test failed. Try again. */
span_log(&s->logging, SPAN_LOG_FLOW, "Trainability test failed\n");
s->retries = 0;
- s->short_train = FALSE;
+ s->short_train = false;
if (step_fallback_entry(s) < 0)
{
/* We have fallen back as far as we can go. Give up. */
break;
}
queue_phase(s, T30_PHASE_B_TX);
- send_dcs_sequence(s, TRUE);
+ send_dcs_sequence(s, true);
break;
case T30_DIS:
/* It appears they didn't see what we sent - retry the TCF */
span_log(&s->logging, SPAN_LOG_FLOW, "Retry number %d\n", s->retries);
queue_phase(s, T30_PHASE_B_TX);
/* TODO: should we reassess the new DIS message, and possibly adjust the DCS we use? */
- send_dcs_sequence(s, TRUE);
+ send_dcs_sequence(s, true);
break;
case T30_DCN:
t30_set_status(s, T30_ERR_TX_BADDCS);
/* Fall through */
case T30_EOP:
span_log(&s->logging, SPAN_LOG_FLOW, "End of procedure detected\n");
- s->end_of_procedure_detected = TRUE;
+ s->end_of_procedure_detected = true;
s->next_rx_step = fcf;
queue_phase(s, T30_PHASE_D_TX);
switch (copy_quality(s))
break;
case T30_CTC:
/* T.30 says we change back to long training here */
- s->short_train = FALSE;
+ s->short_train = false;
queue_phase(s, T30_PHASE_D_TX);
set_state(s, T30_STATE_F_DOC_ECM);
send_simple_frame(s, T30_CTR);
case T30_PRI_EOP:
case T30_EOP:
span_log(&s->logging, SPAN_LOG_FLOW, "End of procedure detected\n");
- s->end_of_procedure_detected = TRUE;
+ s->end_of_procedure_detected = true;
break;
}
}
if (s->phase_d_handler)
s->phase_d_handler(s, s->phase_d_user_data, fcf);
terminate_operation_in_progress(s);
- report_tx_result(s, TRUE);
- return_to_phase_b(s, FALSE);
+ report_tx_result(s, true);
+ return_to_phase_b(s, false);
break;
case T30_PRI_EOP:
case T30_EOP:
s->phase_d_handler(s, s->phase_d_user_data, fcf);
terminate_operation_in_progress(s);
send_dcn(s);
- report_tx_result(s, TRUE);
+ report_tx_result(s, true);
break;
}
break;
s->phase_d_handler(s, s->phase_d_user_data, fcf);
t4_tx_release(&s->t4.tx);
/* TODO: should go back to T, and resend */
- return_to_phase_b(s, TRUE);
+ return_to_phase_b(s, true);
break;
case T30_PRI_EOP:
case T30_EOP:
}
else
{
- return_to_phase_b(s, TRUE);
+ return_to_phase_b(s, true);
}
break;
case T30_PRI_EOP:
if (s->phase_d_handler)
s->phase_d_handler(s, s->phase_d_user_data, fcf);
terminate_operation_in_progress(s);
- report_tx_result(s, TRUE);
- return_to_phase_b(s, FALSE);
+ report_tx_result(s, true);
+ return_to_phase_b(s, false);
break;
case T30_PRI_EOP:
case T30_EOP:
s->phase_d_handler(s, s->phase_d_user_data, fcf);
terminate_operation_in_progress(s);
send_dcn(s);
- report_tx_result(s, TRUE);
+ report_tx_result(s, true);
break;
}
}
if (s->phase_d_handler)
s->phase_d_handler(s, s->phase_d_user_data, fcf);
terminate_operation_in_progress(s);
- report_tx_result(s, TRUE);
- return_to_phase_b(s, FALSE);
+ report_tx_result(s, true);
+ return_to_phase_b(s, false);
break;
case T30_PRI_EOP:
case T30_EOP:
s->phase_d_handler(s, s->phase_d_user_data, fcf);
terminate_operation_in_progress(s);
send_dcn(s);
- report_tx_result(s, TRUE);
+ report_tx_result(s, true);
break;
}
}
if (s->phase_d_handler)
s->phase_d_handler(s, s->phase_d_user_data, fcf);
terminate_operation_in_progress(s);
- report_tx_result(s, TRUE);
- return_to_phase_b(s, FALSE);
+ report_tx_result(s, true);
+ return_to_phase_b(s, false);
break;
case T30_PRI_EOP:
case T30_EOP:
s->phase_d_handler(s, s->phase_d_user_data, fcf);
terminate_operation_in_progress(s);
send_dcn(s);
- report_tx_result(s, TRUE);
+ report_tx_result(s, true);
break;
}
}
case T30_CTR:
/* Valid response to a CTC received */
/* T.30 says we change back to long training here */
- s->short_train = FALSE;
+ s->short_train = false;
/* Initiate resending of the remainder of the frames. */
set_state(s, T30_STATE_IV);
queue_phase(s, T30_PHASE_C_ECM_TX);
/* We should only get good frames here. */
print_frame(s, "Rx: ", msg, len);
if (s->real_time_frame_handler)
- s->real_time_frame_handler(s, s->real_time_frame_user_data, TRUE, msg, len);
+ s->real_time_frame_handler(s, s->real_time_frame_user_data, true, msg, len);
if ((msg[1] & 0x10) == 0)
{
signal. Force the signal present indicator to off, because the
receiver will never be able to. */
if (s->phase != T30_PHASE_A_CED && s->phase != T30_PHASE_A_CNG)
- s->rx_signal_present = FALSE;
- s->rx_trained = FALSE;
- s->rx_frame_received = FALSE;
+ s->rx_signal_present = false;
+ s->rx_trained = false;
+ s->rx_frame_received = false;
s->phase = phase;
switch (phase)
{
case T30_PHASE_A_CED:
if (s->set_rx_type_handler)
- s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_V21, 300, FALSE, TRUE);
+ s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_V21, 300, false, true);
if (s->set_tx_type_handler)
- s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_CED, 0, FALSE, FALSE);
+ s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_CED, 0, false, false);
break;
case T30_PHASE_A_CNG:
if (s->set_rx_type_handler)
- s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_V21, 300, FALSE, TRUE);
+ s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_V21, 300, false, true);
if (s->set_tx_type_handler)
- s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_CNG, 0, FALSE, FALSE);
+ s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_CNG, 0, false, false);
break;
case T30_PHASE_B_RX:
case T30_PHASE_D_RX:
if (s->set_rx_type_handler)
- s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_V21, 300, FALSE, TRUE);
+ s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_V21, 300, false, true);
if (s->set_tx_type_handler)
- s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_NONE, 0, FALSE, FALSE);
+ s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_NONE, 0, false, false);
break;
case T30_PHASE_B_TX:
case T30_PHASE_D_TX:
if (!s->far_end_detected && s->timer_t0_t1 > 0)
{
s->timer_t0_t1 = ms_to_samples(DEFAULT_TIMER_T1);
- s->far_end_detected = TRUE;
+ s->far_end_detected = true;
}
if (s->set_rx_type_handler)
- s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, FALSE, FALSE);
+ s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, false, false);
if (s->set_tx_type_handler)
- s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_V21, 300, FALSE, TRUE);
+ s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_V21, 300, false, true);
break;
case T30_PHASE_C_NON_ECM_RX:
if (s->set_rx_type_handler)
/* Momentarily stop the receive modem, so the next change is forced to happen. If we don't do this
an HDLC message on the slow modem, which has disabled the fast modem, will prevent the same
fast modem from restarting. */
- s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, FALSE, FALSE);
- s->set_rx_type_handler(s->set_rx_type_user_data, fallback_sequence[s->current_fallback].modem_type, fallback_sequence[s->current_fallback].bit_rate, s->short_train, FALSE);
+ s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, false, false);
+ s->set_rx_type_handler(s->set_rx_type_user_data, fallback_sequence[s->current_fallback].modem_type, fallback_sequence[s->current_fallback].bit_rate, s->short_train, false);
}
if (s->set_tx_type_handler)
- s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_NONE, 0, FALSE, FALSE);
+ s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_NONE, 0, false, false);
break;
case T30_PHASE_C_NON_ECM_TX:
/* Pause before switching from anything to phase C */
/* Momentarily stop the receive modem, so the next change is forced to happen. If we don't do this
an HDLC message on the slow modem, which has disabled the fast modem, will prevent the same
fast modem from restarting. */
- s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, FALSE, FALSE);
- s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, FALSE, FALSE);
+ s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, false, false);
+ s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, false, false);
}
if (s->set_tx_type_handler)
- s->set_tx_type_handler(s->set_tx_type_user_data, fallback_sequence[s->current_fallback].modem_type, fallback_sequence[s->current_fallback].bit_rate, s->short_train, FALSE);
+ s->set_tx_type_handler(s->set_tx_type_user_data, fallback_sequence[s->current_fallback].modem_type, fallback_sequence[s->current_fallback].bit_rate, s->short_train, false);
break;
case T30_PHASE_C_ECM_RX:
if (s->set_rx_type_handler)
- s->set_rx_type_handler(s->set_rx_type_user_data, fallback_sequence[s->current_fallback].modem_type, fallback_sequence[s->current_fallback].bit_rate, s->short_train, TRUE);
+ s->set_rx_type_handler(s->set_rx_type_user_data, fallback_sequence[s->current_fallback].modem_type, fallback_sequence[s->current_fallback].bit_rate, s->short_train, true);
if (s->set_tx_type_handler)
- s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_NONE, 0, FALSE, FALSE);
+ s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_NONE, 0, false, false);
break;
case T30_PHASE_C_ECM_TX:
/* Pause before switching from anything to phase C */
if (s->set_rx_type_handler)
- s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, FALSE, FALSE);
+ s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, false, false);
if (s->set_tx_type_handler)
- s->set_tx_type_handler(s->set_tx_type_user_data, fallback_sequence[s->current_fallback].modem_type, fallback_sequence[s->current_fallback].bit_rate, s->short_train, TRUE);
+ s->set_tx_type_handler(s->set_tx_type_user_data, fallback_sequence[s->current_fallback].modem_type, fallback_sequence[s->current_fallback].bit_rate, s->short_train, true);
break;
case T30_PHASE_E:
/* Send a little silence before ending things, to ensure the
s->tcf_current_zeros = 0;
s->tcf_most_zeros = 0;
if (s->set_rx_type_handler)
- s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, FALSE, FALSE);
+ s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, false, false);
if (s->set_tx_type_handler)
- s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_PAUSE, 0, FINAL_FLUSH_TIME, FALSE);
+ s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_PAUSE, 0, FINAL_FLUSH_TIME, false);
break;
case T30_PHASE_CALL_FINISHED:
if (s->set_rx_type_handler)
- s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_DONE, 0, FALSE, FALSE);
+ s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_DONE, 0, false, false);
if (s->set_tx_type_handler)
- s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_DONE, 0, FALSE, FALSE);
+ s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_DONE, 0, false, false);
break;
}
}
switch (s->state)
{
case T30_STATE_R:
- s->dis_received = FALSE;
+ s->dis_received = false;
queue_phase(s, T30_PHASE_B_TX);
- send_dis_or_dtc_sequence(s, TRUE);
+ send_dis_or_dtc_sequence(s, true);
break;
case T30_STATE_III_Q_MCF:
queue_phase(s, T30_PHASE_D_TX);
break;
case T30_STATE_D:
queue_phase(s, T30_PHASE_B_TX);
- send_dcs_sequence(s, TRUE);
+ send_dcs_sequence(s, true);
break;
case T30_STATE_F_FTT:
queue_phase(s, T30_PHASE_B_TX);
break;
case T30_STATE_F_CFR:
queue_phase(s, T30_PHASE_B_TX);
- send_cfr_sequence(s, TRUE);
+ send_cfr_sequence(s, true);
break;
case T30_STATE_D_POST_TCF:
/* Need to send the whole training thing again */
- s->short_train = FALSE;
+ s->short_train = false;
queue_phase(s, T30_PHASE_B_TX);
- send_dcs_sequence(s, TRUE);
+ send_dcs_sequence(s, true);
break;
case T30_STATE_F_POST_RCP_RNR:
/* Just ignore */
span_log(&s->logging, SPAN_LOG_FLOW, "Returning to phase B after %s\n", t30_frametype(s->next_rx_step));
set_phase(s, T30_PHASE_B_TX);
timer_t2_start(s);
- s->dis_received = FALSE;
- send_dis_or_dtc_sequence(s, TRUE);
+ s->dis_received = false;
+ send_dis_or_dtc_sequence(s, true);
return;
}
break;
case SIG_STATUS_TRAINING_IN_PROGRESS:
break;
case SIG_STATUS_TRAINING_FAILED:
- s->rx_trained = FALSE;
+ s->rx_trained = false;
break;
case SIG_STATUS_TRAINING_SUCCEEDED:
/* The modem is now trained */
s->tcf_test_bits = 0;
s->tcf_current_zeros = 0;
s->tcf_most_zeros = 0;
- s->rx_signal_present = TRUE;
- s->rx_trained = TRUE;
+ s->rx_signal_present = true;
+ s->rx_trained = true;
timer_t2_t4_stop(s);
break;
case SIG_STATUS_CARRIER_UP:
break;
case SIG_STATUS_CARRIER_DOWN:
was_trained = s->rx_trained;
- s->rx_signal_present = FALSE;
- s->rx_trained = FALSE;
+ s->rx_signal_present = false;
+ s->rx_trained = false;
switch (s->state)
{
case T30_STATE_F_TCF:
else
{
/* The training went OK */
- s->short_train = TRUE;
+ s->short_train = true;
rx_start_page(s);
set_phase(s, T30_PHASE_B_TX);
set_state(s, T30_STATE_F_CFR);
- send_cfr_sequence(s, TRUE);
+ send_cfr_sequence(s, true);
}
}
break;
case SIG_STATUS_TRAINING_IN_PROGRESS:
break;
case SIG_STATUS_TRAINING_FAILED:
- s->rx_trained = FALSE;
+ s->rx_trained = false;
break;
case SIG_STATUS_TRAINING_SUCCEEDED:
/* The modem is now trained */
- s->rx_signal_present = TRUE;
- s->rx_trained = TRUE;
+ s->rx_signal_present = true;
+ s->rx_trained = true;
break;
case SIG_STATUS_CARRIER_UP:
- s->rx_signal_present = TRUE;
+ s->rx_signal_present = true;
switch (s->timer_t2_t4_is)
{
case TIMER_IS_T2B:
break;
case SIG_STATUS_CARRIER_DOWN:
was_trained = s->rx_trained;
- s->rx_signal_present = FALSE;
- s->rx_trained = FALSE;
+ s->rx_signal_present = false;
+ s->rx_trained = false;
/* If a phase change has been queued to occur after the receive signal drops,
its time to change. */
if (s->state == T30_STATE_F_DOC_ECM)
if (!s->far_end_detected && s->timer_t0_t1 > 0)
{
s->timer_t0_t1 = ms_to_samples(DEFAULT_TIMER_T1);
- s->far_end_detected = TRUE;
+ s->far_end_detected = true;
if (s->phase == T30_PHASE_A_CED || s->phase == T30_PHASE_A_CNG)
set_phase(s, T30_PHASE_B_RX);
}
timer_t2_t4_stop(s);
return;
}
- s->rx_frame_received = TRUE;
+ s->rx_frame_received = true;
/* Cancel the command or response timer (if one is running) */
timer_t2_t4_stop(s);
process_rx_control_msg(s, msg, len);
span_log(&s->logging, SPAN_LOG_FLOW, "Starting answer mode\n");
set_phase(s, T30_PHASE_B_TX);
timer_t2_start(s);
- s->dis_received = FALSE;
- send_dis_or_dtc_sequence(s, TRUE);
+ s->dis_received = false;
+ send_dis_or_dtc_sequence(s, true);
break;
case T30_STATE_R:
- if (send_dis_or_dtc_sequence(s, FALSE))
+ if (send_dis_or_dtc_sequence(s, false))
{
/* Wait for an acknowledgement. */
set_phase(s, T30_PHASE_B_RX);
}
break;
case T30_STATE_F_CFR:
- if (send_cfr_sequence(s, FALSE))
+ if (send_cfr_sequence(s, false))
{
if (s->error_correcting_mode)
{
}
break;
case T30_STATE_D:
- if (send_dcs_sequence(s, FALSE))
+ if (send_dcs_sequence(s, false))
{
if ((s->iaf & T30_IAF_MODE_NO_TCF))
{
/* Skip the trainability test */
s->retries = 0;
- s->short_train = TRUE;
+ s->short_train = true;
if (s->error_correcting_mode)
{
set_state(s, T30_STATE_IV);
{
/* Do the trainability test */
/* TCF is always sent with long training */
- s->short_train = FALSE;
+ s->short_train = false;
set_state(s, T30_STATE_D_TCF);
set_phase(s, T30_PHASE_C_NON_ECM_TX);
}
default:
/* Cancel any receive timeout, and declare that a receive signal is present,
since the front end is explicitly telling us we have seen something. */
- s->rx_signal_present = TRUE;
+ s->rx_signal_present = true;
timer_t2_t4_stop(s);
break;
}
s->phase = T30_PHASE_IDLE;
s->next_phase = T30_PHASE_IDLE;
s->current_fallback = 0;
- s->rx_signal_present = FALSE;
- s->rx_trained = FALSE;
- s->rx_frame_received = FALSE;
+ s->rx_signal_present = false;
+ s->rx_trained = false;
+ s->rx_frame_received = false;
s->current_status = T30_ERR_OK;
s->ppr_count = 0;
s->ecm_progress = 0;
s->tx_page_number = 0;
s->rtn_events = 0;
s->rtp_events = 0;
- s->local_interrupt_pending = FALSE;
- s->far_end_detected = FALSE;
- s->end_of_procedure_detected = FALSE;
+ s->local_interrupt_pending = false;
+ s->far_end_detected = false;
+ s->end_of_procedure_detected = false;
s->timer_t0_t1 = ms_to_samples(DEFAULT_TIMER_T0);
if (s->calling_party)
{
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include <tiffio.h>
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(int) t30_set_tx_page_header_overlays_image(t30_state_t *s, int header_overlays_image)
+SPAN_DECLARE(int) t30_set_tx_page_header_overlays_image(t30_state_t *s, bool header_overlays_image)
{
s->header_overlays_image = header_overlays_image;
t4_tx_set_header_overlays_image(&s->t4.tx, s->header_overlays_image);
{
if (tz_init(&s->tz, tzstring))
{
- s->use_own_tz = TRUE;
+ s->use_own_tz = true;
t4_tx_set_header_tz(&s->t4.tx, &s->tz);
return 0;
}
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(void) t30_set_iaf_mode(t30_state_t *s, int iaf)
+SPAN_DECLARE(void) t30_set_iaf_mode(t30_state_t *s, bool iaf)
{
s->iaf = iaf;
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(int) t30_set_ecm_capability(t30_state_t *s, int enabled)
+SPAN_DECLARE(int) t30_set_ecm_capability(t30_state_t *s, bool enabled)
{
s->ecm_allowed = enabled;
t30_build_dis_or_dtc(s);
#if defined(SPANDSP_SUPPORT_T88)
| T4_COMPRESSION_T88
#endif
- //| T4_COMPRESSION_T42_T81
+ | T4_COMPRESSION_T42_T81
#if defined(SPANDSP_SUPPORT_SYCC_T81)
| T4_COMPRESSION_SYCC_T81
#endif
#if defined(SPANDSP_SUPPORT_T45)
| T4_COMPRESSION_T45
#endif
-#if 0
| T4_COMPRESSION_GRAYSCALE
| T4_COMPRESSION_COLOUR
| T4_COMPRESSION_12BIT
| T4_COMPRESSION_GRAY_TO_BILEVEL
| T4_COMPRESSION_COLOUR_TO_BILEVEL
| T4_COMPRESSION_RESCALING
-#endif
| 0;
+
s->supported_compressions = supported_compressions;
t30_build_dis_or_dtc(s);
return 0;
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include <tiffio.h>
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include <assert.h>
#include <tiffio.h>
#include "spandsp/private/bitstream.h"
#include "spandsp/private/t38_core.h"
#include "spandsp/private/silence_gen.h"
+#include "spandsp/private/power_meter.h"
#include "spandsp/private/fsk.h"
#include "spandsp/private/modem_connect_tones.h"
#include "spandsp/private/v8.h"
{
at_modem_control(&s->at_state, AT_MODEM_CONTROL_HANGUP, NULL);
t31_set_at_rx_mode(s, AT_MODE_ONHOOK_COMMAND);
- s->at_state.do_hangup = FALSE;
+ s->at_state.do_hangup = false;
}
else
{
t31_state_t *s;
s = (t31_state_t *) user_data;
- s->t38_fe.rx_data_missing = TRUE;
+ s->t38_fe.rx_data_missing = true;
return 0;
}
/*- End of function --------------------------------------------------------*/
}
/*endswitch*/
fe->hdlc_rx.len = 0;
- fe->rx_data_missing = FALSE;
+ fe->rx_data_missing = false;
return 0;
}
/*- End of function --------------------------------------------------------*/
}
else
{
- fe->rx_data_missing = TRUE;
+ fe->rx_data_missing = true;
}
/*endif*/
}
/* All real HDLC messages in the FAX world start with 0xFF. If this one is not starting
with 0xFF it would appear some octets must have been missed before this one. */
if (len <= 0 || buf[0] != 0xFF)
- fe->rx_data_missing = TRUE;
+ fe->rx_data_missing = true;
/*endif*/
}
/*endif*/
fe->hdlc_rx.len = 0;
}
/*endif*/
- fe->rx_data_missing = FALSE;
+ fe->rx_data_missing = false;
fe->timeout_rx_samples = fe->samples + ms_to_samples(MID_RX_TIMEOUT);
break;
case T38_FIELD_HDLC_FCS_BAD:
{
span_log(&s->logging, SPAN_LOG_FLOW, "Type %s - CRC bad (%s)\n", (fe->hdlc_rx.len >= 3) ? t30_frametype(fe->hdlc_rx.buf[2]) : "???", (fe->rx_data_missing) ? "missing octets" : "clean");
if (data_type == T38_DATA_V21)
- hdlc_accept_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, FALSE);
+ hdlc_accept_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, false);
else
- hdlc_accept_t38_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, FALSE);
+ hdlc_accept_t38_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, false);
/*endif*/
fe->hdlc_rx.len = 0;
}
/*endif*/
- fe->rx_data_missing = FALSE;
+ fe->rx_data_missing = false;
fe->timeout_rx_samples = fe->samples + ms_to_samples(MID_RX_TIMEOUT);
break;
case T38_FIELD_HDLC_FCS_OK_SIG_END:
fe->hdlc_rx.len = 0;
}
/*endif*/
- fe->rx_data_missing = FALSE;
+ fe->rx_data_missing = false;
if (t->current_rx_data_type != data_type || t->current_rx_field_type != field_type)
{
if (data_type == T38_DATA_V21)
{
span_log(&s->logging, SPAN_LOG_FLOW, "Type %s - CRC bad, sig end (%s)\n", (fe->hdlc_rx.len >= 3) ? t30_frametype(fe->hdlc_rx.buf[2]) : "???", (fe->rx_data_missing) ? "missing octets" : "clean");
if (data_type == T38_DATA_V21)
- hdlc_accept_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, FALSE);
+ hdlc_accept_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, false);
else
- hdlc_accept_t38_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, FALSE);
+ hdlc_accept_t38_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, false);
/*endif*/
fe->hdlc_rx.len = 0;
}
/*endif*/
- fe->rx_data_missing = FALSE;
+ fe->rx_data_missing = false;
if (t->current_rx_data_type != data_type || t->current_rx_field_type != field_type)
{
if (data_type == T38_DATA_V21)
i.e. they send T38_FIELD_HDLC_FCS_OK, and then T38_FIELD_HDLC_SIG_END when the carrier actually drops.
The other is because the HDLC signal drops unexpectedly - i.e. not just after a final frame. */
fe->hdlc_rx.len = 0;
- fe->rx_data_missing = FALSE;
+ fe->rx_data_missing = false;
fe->timeout_rx_samples = 0;
if (data_type == T38_DATA_V21)
hdlc_rx_status(s, SIG_STATUS_CARRIER_DOWN);
if (!s->at_state.rx_signal_present)
{
non_ecm_rx_status(s, SIG_STATUS_TRAINING_SUCCEEDED);
- s->at_state.rx_signal_present = TRUE;
+ s->at_state.rx_signal_present = true;
}
/*endif*/
bit_reverse(buf2, buf, len);
if (!s->at_state.rx_signal_present)
{
non_ecm_rx_status(s, SIG_STATUS_TRAINING_SUCCEEDED);
- s->at_state.rx_signal_present = TRUE;
+ s->at_state.rx_signal_present = true;
}
/*endif*/
bit_reverse(buf2, buf, len);
non_ecm_rx_status(s, SIG_STATUS_CARRIER_DOWN);
}
/*endif*/
- s->at_state.rx_signal_present = FALSE;
+ s->at_state.rx_signal_present = false;
fe->timeout_rx_samples = 0;
break;
case T38_FIELD_CM_MESSAGE:
else
{
/* End of transmission */
- s->hdlc_tx.final = FALSE;
+ s->hdlc_tx.final = false;
category = (fe->current_tx_data_type == T38_DATA_V21) ? T38_PACKET_CATEGORY_CONTROL_DATA_END : T38_PACKET_CATEGORY_IMAGE_DATA_END;
if ((res = t38_core_send_data(&fe->t38, previous, T38_FIELD_HDLC_FCS_OK_SIG_END, NULL, 0, category)) < 0)
return res;
fe = &s->t38_fe;
if (fe->current_rx_type == T30_MODEM_DONE || fe->current_tx_type == T30_MODEM_DONE)
- return TRUE;
+ return true;
/*endif*/
fe->samples += samples;
}
/*endif*/
if (fe->timed_step == T38_TIMED_STEP_NONE)
- return FALSE;
+ return false;
/*endif*/
/* Wait until the right time comes along, unless we are working in "no delays" mode, while talking to an
IAF terminal. */
if (fe->us_per_tx_chunk && fe->samples < fe->next_tx_samples)
- return FALSE;
+ return false;
/*endif*/
/* Its time to send something */
delay = 0;
}
/*endswitch*/
fe->next_tx_samples += us_to_samples(delay);
- return FALSE;
+ return false;
}
/*- End of function --------------------------------------------------------*/
case AT_MODEM_CONTROL_ONHOOK:
if (t->non_ecm_tx.holding)
{
- t->non_ecm_tx.holding = FALSE;
+ t->non_ecm_tx.holding = false;
/* Tell the application to release further data */
at_modem_control(&t->at_state, AT_MODEM_CONTROL_CTS, (void *) 1);
}
case SIG_STATUS_TRAINING_IN_PROGRESS:
break;
case SIG_STATUS_TRAINING_FAILED:
- s->at_state.rx_trained = FALSE;
- s->audio.modems.rx_trained = FALSE;
+ s->at_state.rx_trained = false;
+ s->audio.modems.rx_trained = false;
break;
case SIG_STATUS_TRAINING_SUCCEEDED:
/* The modem is now trained */
at_put_response_code(&s->at_state, AT_RESPONSE_CODE_CONNECT);
- s->at_state.rx_signal_present = TRUE;
- s->at_state.rx_trained = TRUE;
- s->audio.modems.rx_trained = TRUE;
+ s->at_state.rx_signal_present = true;
+ s->at_state.rx_trained = true;
+ s->audio.modems.rx_trained = true;
break;
case SIG_STATUS_CARRIER_UP:
break;
t31_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND);
}
/*endif*/
- s->at_state.rx_signal_present = FALSE;
- s->at_state.rx_trained = FALSE;
- s->audio.modems.rx_trained = FALSE;
+ s->at_state.rx_signal_present = false;
+ s->at_state.rx_trained = false;
+ s->audio.modems.rx_trained = false;
break;
default:
if (s->at_state.p.result_code_format)
if (!s->at_state.rx_signal_present)
{
non_ecm_rx_status(s, SIG_STATUS_TRAINING_SUCCEEDED);
- s->at_state.rx_signal_present = TRUE;
+ s->at_state.rx_signal_present = true;
}
/*endif*/
/* Ignore any fractional bytes which may have accumulated */
release flow control. */
if (s->non_ecm_tx.out_bytes > T31_TX_BUF_LOW_TIDE)
{
- s->non_ecm_tx.holding = FALSE;
+ s->non_ecm_tx.holding = false;
/* Tell the application to release further data */
at_modem_control(&s->at_state, AT_MODEM_CONTROL_CTS, (void *) 1);
}
/*endif*/
}
/*endif*/
- s->non_ecm_tx.data_started = TRUE;
+ s->non_ecm_tx.data_started = true;
}
else
{
if (s->non_ecm_tx.final)
{
- s->non_ecm_tx.final = FALSE;
+ s->non_ecm_tx.final = false;
/* This will put the modem into its shutdown sequence. When
it has finally shut down, an OK response will be sent. */
return SIG_STATUS_END_OF_DATA;
/* See if the buffer is approaching empty. It might be time to release flow control. */
if (s->non_ecm_tx.out_bytes > T31_TX_BUF_LOW_TIDE)
{
- s->non_ecm_tx.holding = FALSE;
+ s->non_ecm_tx.holding = false;
/* Tell the application to release further data */
at_modem_control(&s->at_state, AT_MODEM_CONTROL_CTS, (void *) 1);
}
/*endif*/
}
/*endif*/
- s->non_ecm_tx.data_started = TRUE;
+ s->non_ecm_tx.data_started = true;
}
else
{
if (s->non_ecm_tx.final)
{
- s->non_ecm_tx.final = FALSE;
+ s->non_ecm_tx.final = false;
/* This will put the modem into its shutdown sequence. When
it has finally shut down, an OK response will be sent. */
return i;
s = (t31_state_t *) user_data;
if (s->hdlc_tx.final)
{
- s->hdlc_tx.final = FALSE;
+ s->hdlc_tx.final = false;
/* Schedule an orderly shutdown of the modem */
hdlc_tx_frame(&s->audio.modems.hdlc_tx, NULL, 0);
}
case SIG_STATUS_TRAINING_IN_PROGRESS:
break;
case SIG_STATUS_TRAINING_FAILED:
- s->at_state.rx_trained = FALSE;
- s->audio.modems.rx_trained = FALSE;
+ s->at_state.rx_trained = false;
+ s->audio.modems.rx_trained = false;
break;
case SIG_STATUS_TRAINING_SUCCEEDED:
/* The modem is now trained */
- s->at_state.rx_signal_present = TRUE;
- s->at_state.rx_trained = TRUE;
- s->audio.modems.rx_trained = TRUE;
+ s->at_state.rx_signal_present = true;
+ s->at_state.rx_trained = true;
+ s->audio.modems.rx_trained = true;
break;
case SIG_STATUS_CARRIER_UP:
if (s->modem == FAX_MODEM_CNG_TONE_TX || s->modem == FAX_MODEM_NOCNG_TONE_TX || s->modem == FAX_MODEM_V21_RX)
{
- s->at_state.rx_signal_present = TRUE;
- s->rx_frame_received = FALSE;
- s->audio.modems.rx_frame_received = FALSE;
+ s->at_state.rx_signal_present = true;
+ s->rx_frame_received = false;
+ s->audio.modems.rx_frame_received = false;
}
/*endif*/
break;
if (s->at_state.ok_is_pending)
{
at_put_response_code(&s->at_state, AT_RESPONSE_CODE_OK);
- s->at_state.ok_is_pending = FALSE;
+ s->at_state.ok_is_pending = false;
}
else
{
at_put_response_code(&s->at_state, AT_RESPONSE_CODE_NO_CARRIER);
}
/*endif*/
- s->at_state.dte_is_waiting = FALSE;
+ s->at_state.dte_is_waiting = false;
t31_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND);
}
else
/*endif*/
}
/*endif*/
- s->at_state.rx_signal_present = FALSE;
- s->at_state.rx_trained = FALSE;
- s->audio.modems.rx_trained = FALSE;
+ s->at_state.rx_signal_present = false;
+ s->at_state.rx_trained = false;
+ s->audio.modems.rx_trained = false;
break;
case SIG_STATUS_FRAMING_OK:
if (s->modem == FAX_MODEM_CNG_TONE_TX || s->modem == FAX_MODEM_NOCNG_TONE_TX)
/* Once we get any valid HDLC the CNG tone stops, and we drop
to the V.21 receive modem on its own. */
s->modem = FAX_MODEM_V21_RX;
- s->at_state.transmit = FALSE;
+ s->at_state.transmit = false;
}
/*endif*/
if (s->modem == FAX_MODEM_V17_RX || s->modem == FAX_MODEM_V27TER_RX || s->modem == FAX_MODEM_V29_RX)
V.21 receive mode. */
if (s->at_state.p.adaptive_receive)
{
- s->at_state.rx_signal_present = TRUE;
- s->rx_frame_received = TRUE;
- s->audio.modems.rx_frame_received = TRUE;
+ s->at_state.rx_signal_present = true;
+ s->rx_frame_received = true;
+ s->audio.modems.rx_frame_received = true;
s->modem = FAX_MODEM_V21_RX;
- s->at_state.transmit = FALSE;
- s->at_state.dte_is_waiting = TRUE;
+ s->at_state.transmit = false;
+ s->at_state.dte_is_waiting = true;
at_put_response_code(&s->at_state, AT_RESPONSE_CODE_FRH3);
at_put_response_code(&s->at_state, AT_RESPONSE_CODE_CONNECT);
}
{
s->modem = FAX_MODEM_SILENCE_TX;
t31_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND);
- s->rx_frame_received = FALSE;
- s->audio.modems.rx_frame_received = FALSE;
+ s->rx_frame_received = false;
+ s->audio.modems.rx_frame_received = false;
at_put_response_code(&s->at_state, AT_RESPONSE_CODE_FCERROR);
}
/*endif*/
{
/* Report CONNECT as soon as possible to avoid a timeout. */
at_put_response_code(&s->at_state, AT_RESPONSE_CODE_CONNECT);
- s->rx_frame_received = TRUE;
- s->audio.modems.rx_frame_received = TRUE;
+ s->rx_frame_received = true;
+ s->audio.modems.rx_frame_received = true;
}
else
{
{
/* Report CONNECT as soon as possible to avoid a timeout. */
at_put_response_code(&s->at_state, AT_RESPONSE_CODE_CONNECT);
- s->rx_frame_received = TRUE;
- s->audio.modems.rx_frame_received = TRUE;
+ s->rx_frame_received = true;
+ s->audio.modems.rx_frame_received = true;
}
else
{
{
/* This is the last frame. We don't send OK until the carrier drops to avoid
redetecting it later. */
- s->at_state.ok_is_pending = TRUE;
+ s->at_state.ok_is_pending = true;
}
else
{
at_put_response_code(&s->at_state, (ok) ? AT_RESPONSE_CODE_OK : AT_RESPONSE_CODE_ERROR);
- s->at_state.dte_is_waiting = FALSE;
- s->rx_frame_received = FALSE;
- s->audio.modems.rx_frame_received = FALSE;
+ s->at_state.dte_is_waiting = false;
+ s->rx_frame_received = false;
+ s->audio.modems.rx_frame_received = false;
}
/*endif*/
}
static void t31_v21_rx(t31_state_t *s)
{
- s->at_state.ok_is_pending = FALSE;
+ s->at_state.ok_is_pending = false;
s->hdlc_tx.len = 0;
- s->hdlc_tx.final = FALSE;
- s->dled = FALSE;
- hdlc_rx_init(&s->audio.modems.hdlc_rx, FALSE, TRUE, HDLC_FRAMING_OK_THRESHOLD, hdlc_accept_frame, s);
+ s->hdlc_tx.final = false;
+ s->dled = false;
+ hdlc_rx_init(&s->audio.modems.hdlc_rx, false, true, HDLC_FRAMING_OK_THRESHOLD, hdlc_accept_frame, s);
fax_modems_start_slow_modem(&s->audio.modems, FAX_MODEM_V21_RX);
- s->at_state.transmit = TRUE;
+ s->at_state.transmit = true;
}
/*- End of function --------------------------------------------------------*/
/*endif*/
queue_flush(s->rx_queue);
s->modem = new_modem;
- s->non_ecm_tx.final = FALSE;
- s->at_state.rx_signal_present = FALSE;
- s->at_state.rx_trained = FALSE;
- s->audio.modems.rx_trained = FALSE;
- s->rx_frame_received = FALSE;
- s->audio.modems.rx_frame_received = FALSE;
+ s->non_ecm_tx.final = false;
+ s->at_state.rx_signal_present = false;
+ s->at_state.rx_trained = false;
+ s->audio.modems.rx_trained = false;
+ s->rx_frame_received = false;
+ s->audio.modems.rx_frame_received = false;
fax_modems_set_rx_handler(t, (span_rx_handler_t) &span_dummy_rx, NULL, (span_rx_fillin_handler_t) &span_dummy_rx_fillin, NULL);
- use_hdlc = FALSE;
+ use_hdlc = false;
switch (s->modem)
{
case FAX_MODEM_CNG_TONE_TX:
fax_modems_set_next_tx_handler(t, (span_tx_handler_t) NULL, NULL);
}
/*endif*/
- s->at_state.transmit = TRUE;
+ s->at_state.transmit = true;
break;
case FAX_MODEM_NOCNG_TONE_TX:
if (s->t38_mode)
fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
}
/*endif*/
- s->at_state.transmit = FALSE;
+ s->at_state.transmit = false;
break;
case FAX_MODEM_CED_TONE_TX:
if (s->t38_mode)
fax_modems_set_next_tx_handler(t, (span_tx_handler_t) NULL, NULL);
}
/*endif*/
- s->at_state.transmit = TRUE;
+ s->at_state.transmit = true;
break;
case FAX_MODEM_V21_RX:
if (s->t38_mode)
{
s->t38_fe.next_tx_indicator = T38_IND_V21_PREAMBLE;
s->t38_fe.current_tx_data_type = T38_DATA_V21;
- use_hdlc = TRUE;
+ use_hdlc = true;
s->t38_fe.timed_step = (use_hdlc) ? T38_TIMED_STEP_HDLC_MODEM : T38_TIMED_STEP_NON_ECM_MODEM;
set_octets_per_data_packet(s, 300);
}
else
{
- hdlc_tx_init(&t->hdlc_tx, FALSE, 2, FALSE, hdlc_tx_underflow, s);
+ hdlc_tx_init(&t->hdlc_tx, false, 2, false, hdlc_tx_underflow, s);
/* The spec says 1s +-15% of preamble. So, the minimum is 32 octets. */
hdlc_tx_flags(&t->hdlc_tx, 32);
fax_modems_start_slow_modem(t, FAX_MODEM_V21_TX);
}
/*endif*/
s->hdlc_tx.len = 0;
- s->hdlc_tx.final = FALSE;
- s->dled = FALSE;
- s->at_state.transmit = TRUE;
+ s->hdlc_tx.final = false;
+ s->dled = false;
+ s->at_state.transmit = true;
break;
case FAX_MODEM_V17_RX:
case FAX_MODEM_V27TER_RX:
fax_modems_start_fast_modem(t, s->modem, s->bit_rate, s->short_train, use_hdlc);
}
/*endif*/
- s->at_state.transmit = FALSE;
+ s->at_state.transmit = false;
break;
case FAX_MODEM_V17_TX:
if (s->t38_mode)
}
/*endif*/
s->non_ecm_tx.out_bytes = 0;
- s->non_ecm_tx.data_started = FALSE;
- s->at_state.transmit = TRUE;
+ s->non_ecm_tx.data_started = false;
+ s->at_state.transmit = true;
break;
case FAX_MODEM_V27TER_TX:
if (s->t38_mode)
}
/*endif*/
s->non_ecm_tx.out_bytes = 0;
- s->non_ecm_tx.data_started = FALSE;
- s->at_state.transmit = TRUE;
+ s->non_ecm_tx.data_started = false;
+ s->at_state.transmit = true;
break;
case FAX_MODEM_V29_TX:
if (s->t38_mode)
}
/*endif*/
s->non_ecm_tx.out_bytes = 0;
- s->non_ecm_tx.data_started = FALSE;
- s->at_state.transmit = TRUE;
+ s->non_ecm_tx.data_started = false;
+ s->at_state.transmit = true;
break;
case FAX_MODEM_SILENCE_TX:
if (s->t38_mode)
fax_modems_set_next_tx_handler(t, (span_tx_handler_t) NULL, NULL);
}
/*endif*/
- s->at_state.transmit = FALSE;
+ s->at_state.transmit = false;
break;
case FAX_MODEM_SILENCE_RX:
if (!s->t38_mode)
fax_modems_set_next_tx_handler(t, (span_tx_handler_t) NULL, NULL);
}
/*endif*/
- s->at_state.transmit = FALSE;
+ s->at_state.transmit = false;
break;
case FAX_MODEM_FLUSH:
/* Send 200ms of silence to "push" the last audio out */
silence_gen_alter(&t->silence_gen, ms_to_samples(200));
fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
fax_modems_set_next_tx_handler(t, (span_tx_handler_t) NULL, NULL);
- s->at_state.transmit = TRUE;
+ s->at_state.transmit = true;
}
/*endif*/
break;
{
if (s->dled)
{
- s->dled = FALSE;
+ s->dled = false;
if (stuffed[i] == ETX)
{
s->hdlc_tx.final = (s->hdlc_tx.buf[1] & 0x10);
else
{
if (stuffed[i] == DLE)
- s->dled = TRUE;
+ s->dled = true;
else
s->hdlc_tx.buf[s->hdlc_tx.len++] = stuffed[i];
/*endif*/
{
if (s->dled)
{
- s->dled = FALSE;
+ s->dled = false;
if (stuffed[i] == ETX)
{
- s->non_ecm_tx.final = TRUE;
+ s->non_ecm_tx.final = true;
t31_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND);
return;
}
else
{
if (stuffed[i] == DLE)
- s->dled = TRUE;
+ s->dled = true;
else
hdlc_rx_put_byte(&s->t38_fe.hdlc_rx_non_ecm, bit_reverse8(stuffed[i]));
/*endif*/
{
if (s->dled)
{
- s->dled = FALSE;
+ s->dled = false;
if (stuffed[i] == ETX)
{
- s->non_ecm_tx.final = TRUE;
+ s->non_ecm_tx.final = true;
t31_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND);
return;
}
else
{
if (stuffed[i] == DLE)
- s->dled = TRUE;
+ s->dled = true;
else
s->non_ecm_tx.buf[s->non_ecm_tx.in_bytes++] = stuffed[i];
/*endif*/
/* See if the buffer is approaching full. We might need to apply flow control. */
if (s->non_ecm_tx.in_bytes > T31_TX_BUF_HIGH_TIDE)
{
- s->non_ecm_tx.holding = TRUE;
+ s->non_ecm_tx.holding = true;
/* Tell the application to hold further data */
at_modem_control(&s->at_state, AT_MODEM_CONTROL_CTS, (void *) 0);
}
s = (t31_state_t *) user_data;
new_transmit = direction;
- immediate_response = TRUE;
+ immediate_response = true;
switch (operation)
{
case 'S':
else
silence_gen_alter(&s->audio.modems.silence_gen, ms_to_samples(val*10));
/*endif*/
- s->at_state.transmit = TRUE;
+ s->at_state.transmit = true;
}
else
{
/*endif*/
}
/*endif*/
- immediate_response = FALSE;
+ immediate_response = false;
span_log(&s->logging, SPAN_LOG_FLOW, "Silence %dms\n", val*10);
break;
case 'H':
{
case 3:
new_modem = (new_transmit) ? FAX_MODEM_V21_TX : FAX_MODEM_V21_RX;
- s->short_train = FALSE;
+ s->short_train = false;
s->bit_rate = 300;
break;
default:
if (new_modem != s->modem)
{
restart_modem(s, new_modem);
- immediate_response = FALSE;
+ immediate_response = false;
}
/*endif*/
s->at_state.transmit = new_transmit;
{
/* Send straight away, if there is something queued. */
t31_set_at_rx_mode(s, AT_MODE_DELIVERY);
- s->rx_frame_received = FALSE;
- s->audio.modems.rx_frame_received = FALSE;
+ s->rx_frame_received = false;
+ s->audio.modems.rx_frame_received = false;
do
{
if (!queue_empty(s->rx_queue))
}
else
{
- s->at_state.dte_is_waiting = TRUE;
+ s->at_state.dte_is_waiting = true;
break;
}
/*endif*/
while (msg[0] == AT_RESPONSE_CODE_CONNECT);
}
/*endif*/
- immediate_response = FALSE;
+ immediate_response = false;
break;
default:
switch (val)
s->t38_fe.next_tx_indicator = T38_IND_V27TER_2400_TRAINING;
s->t38_fe.current_tx_data_type = T38_DATA_V27TER_2400;
new_modem = (new_transmit) ? FAX_MODEM_V27TER_TX : FAX_MODEM_V27TER_RX;
- s->short_train = FALSE;
+ s->short_train = false;
s->bit_rate = 2400;
break;
case 48:
s->t38_fe.next_tx_indicator = T38_IND_V27TER_4800_TRAINING;
s->t38_fe.current_tx_data_type = T38_DATA_V27TER_4800;
new_modem = (new_transmit) ? FAX_MODEM_V27TER_TX : FAX_MODEM_V27TER_RX;
- s->short_train = FALSE;
+ s->short_train = false;
s->bit_rate = 4800;
break;
case 72:
s->t38_fe.next_tx_indicator = T38_IND_V29_7200_TRAINING;
s->t38_fe.current_tx_data_type = T38_DATA_V29_7200;
new_modem = (new_transmit) ? FAX_MODEM_V29_TX : FAX_MODEM_V29_RX;
- s->short_train = FALSE;
+ s->short_train = false;
s->bit_rate = 7200;
break;
case 96:
s->t38_fe.next_tx_indicator = T38_IND_V29_9600_TRAINING;
s->t38_fe.current_tx_data_type = T38_DATA_V29_9600;
new_modem = (new_transmit) ? FAX_MODEM_V29_TX : FAX_MODEM_V29_RX;
- s->short_train = FALSE;
+ s->short_train = false;
s->bit_rate = 9600;
break;
case 73:
s->t38_fe.next_tx_indicator = T38_IND_V17_7200_LONG_TRAINING;
s->t38_fe.current_tx_data_type = T38_DATA_V17_7200;
new_modem = (new_transmit) ? FAX_MODEM_V17_TX : FAX_MODEM_V17_RX;
- s->short_train = FALSE;
+ s->short_train = false;
s->bit_rate = 7200;
break;
case 74:
s->t38_fe.next_tx_indicator = T38_IND_V17_7200_SHORT_TRAINING;
s->t38_fe.current_tx_data_type = T38_DATA_V17_7200;
new_modem = (new_transmit) ? FAX_MODEM_V17_TX : FAX_MODEM_V17_RX;
- s->short_train = TRUE;
+ s->short_train = true;
s->bit_rate = 7200;
break;
case 97:
s->t38_fe.next_tx_indicator = T38_IND_V17_9600_LONG_TRAINING;
s->t38_fe.current_tx_data_type = T38_DATA_V17_9600;
new_modem = (new_transmit) ? FAX_MODEM_V17_TX : FAX_MODEM_V17_RX;
- s->short_train = FALSE;
+ s->short_train = false;
s->bit_rate = 9600;
break;
case 98:
s->t38_fe.next_tx_indicator = T38_IND_V17_9600_SHORT_TRAINING;
s->t38_fe.current_tx_data_type = T38_DATA_V17_9600;
new_modem = (new_transmit) ? FAX_MODEM_V17_TX : FAX_MODEM_V17_RX;
- s->short_train = TRUE;
+ s->short_train = true;
s->bit_rate = 9600;
break;
case 121:
s->t38_fe.next_tx_indicator = T38_IND_V17_12000_LONG_TRAINING;
s->t38_fe.current_tx_data_type = T38_DATA_V17_12000;
new_modem = (new_transmit) ? FAX_MODEM_V17_TX : FAX_MODEM_V17_RX;
- s->short_train = FALSE;
+ s->short_train = false;
s->bit_rate = 12000;
break;
case 122:
s->t38_fe.next_tx_indicator = T38_IND_V17_12000_SHORT_TRAINING;
s->t38_fe.current_tx_data_type = T38_DATA_V17_12000;
new_modem = (new_transmit) ? FAX_MODEM_V17_TX : FAX_MODEM_V17_RX;
- s->short_train = TRUE;
+ s->short_train = true;
s->bit_rate = 12000;
break;
case 145:
s->t38_fe.next_tx_indicator = T38_IND_V17_14400_LONG_TRAINING;
s->t38_fe.current_tx_data_type = T38_DATA_V17_14400;
new_modem = (new_transmit) ? FAX_MODEM_V17_TX : FAX_MODEM_V17_RX;
- s->short_train = FALSE;
+ s->short_train = false;
s->bit_rate = 14400;
break;
case 146:
s->t38_fe.next_tx_indicator = T38_IND_V17_14400_SHORT_TRAINING;
s->t38_fe.current_tx_data_type = T38_DATA_V17_14400;
new_modem = (new_transmit) ? FAX_MODEM_V17_TX : FAX_MODEM_V17_RX;
- s->short_train = TRUE;
+ s->short_train = true;
s->bit_rate = 14400;
break;
default:
}
/*endif*/
restart_modem(s, new_modem);
- immediate_response = FALSE;
+ immediate_response = false;
break;
}
/*endswitch*/
}
/*endif*/
s->at_state.rx_data_bytes = 0;
- s->at_state.transmit = FALSE;
+ s->at_state.transmit = false;
s->modem = FAX_MODEM_SILENCE_TX;
fax_modems_set_rx_handler(&s->audio.modems, (span_rx_handler_t) &span_dummy_rx, NULL, (span_rx_fillin_handler_t) &span_dummy_rx_fillin, NULL);
t31_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND);
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(void) t31_set_transmit_on_idle(t31_state_t *s, int transmit_on_idle)
+SPAN_DECLARE(void) t31_set_transmit_on_idle(t31_state_t *s, bool transmit_on_idle)
{
s->audio.modems.transmit_on_idle = transmit_on_idle;
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(void) t31_set_tep_mode(t31_state_t *s, int use_tep)
+SPAN_DECLARE(void) t31_set_tep_mode(t31_state_t *s, bool use_tep)
{
s->audio.modems.use_tep = use_tep;
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(void) t31_set_t38_config(t31_state_t *s, int without_pacing)
+SPAN_DECLARE(void) t31_set_t38_config(t31_state_t *s, bool without_pacing)
{
if (without_pacing)
{
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(void) t31_set_mode(t31_state_t *s, int t38_mode)
+SPAN_DECLARE(void) t31_set_mode(t31_state_t *s, bool t38_mode)
{
s->t38_mode = t38_mode;
span_log(&s->logging, SPAN_LOG_FLOW, "Mode set to %d\n", s->t38_mode);
t->hdlc_tx.ptr = 0;
- hdlc_tx_init(&s->hdlc_tx_non_ecm, FALSE, 1, FALSE, hdlc_tx_underflow2, s);
- hdlc_rx_init(&s->hdlc_rx_non_ecm, FALSE, TRUE, 2, hdlc_accept_non_ecm_frame, t);
+ hdlc_tx_init(&s->hdlc_tx_non_ecm, false, 1, false, hdlc_tx_underflow2, s);
+ hdlc_rx_init(&s->hdlc_rx_non_ecm, false, true, 2, hdlc_accept_non_ecm_frame, t);
return 0;
}
/*- End of function --------------------------------------------------------*/
return NULL;
/*endif*/
- alloced = FALSE;
+ alloced = false;
if (s == NULL)
{
if ((s = (t31_state_t *) span_alloc(sizeof (*s))) == NULL)
return NULL;
/*endif*/
- alloced = TRUE;
+ alloced = true;
}
/*endif*/
memset(s, 0, sizeof(*s));
s->modem_control_handler = modem_control_handler;
s->modem_control_user_data = modem_control_user_data;
fax_modems_init(&s->audio.modems,
- FALSE,
+ false,
hdlc_accept_frame,
hdlc_tx_underflow,
non_ecm_put_bit,
v8_parms.pstn_access = 0;
v8_parms.nsf = -1;
v8_parms.t66 = -1;
- v8_init(&s->audio.v8, FALSE, &v8_parms, v8_handler, s);
+ v8_init(&s->audio.v8, false, &v8_parms, v8_handler, s);
power_meter_init(&s->audio.rx_power, 4);
s->audio.last_sample = 0;
s->audio.silence_threshold_power = power_meter_level_dbm0(-36);
- s->at_state.rx_signal_present = FALSE;
- s->at_state.rx_trained = FALSE;
- s->audio.modems.rx_trained = FALSE;
+ s->at_state.rx_signal_present = false;
+ s->at_state.rx_trained = false;
+ s->audio.modems.rx_trained = false;
- s->at_state.do_hangup = FALSE;
+ s->at_state.do_hangup = false;
s->at_state.line_ptr = 0;
s->audio.silence_heard = 0;
s->silence_awaited = 0;
s->call_samples = 0;
s->modem = FAX_MODEM_NONE;
- s->at_state.transmit = TRUE;
+ s->at_state.transmit = true;
if ((s->rx_queue = queue_init(NULL, 4096, QUEUE_WRITE_ATOMIC | QUEUE_READ_ATOMIC)) == NULL)
{
if (tx_t38_packet_handler)
{
t31_t38_fe_init(s, tx_t38_packet_handler, tx_t38_packet_user_data);
- t31_set_t38_config(s, FALSE);
+ t31_set_t38_config(s, false);
}
/*endif*/
- s->t38_mode = FALSE;
+ s->t38_mode = false;
return s;
}
/*- End of function --------------------------------------------------------*/
#include <inttypes.h>
#include <ctype.h>
#include <string.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "spandsp/telephony.h"
#include "spandsp/bit_operations.h"
int vendor_id_len;
/*! The vendor's name */
const char *vendor_name;
- /*! TRUE if the station ID for this vendor is reversed */
+ /*! True if the station ID for this vendor is reversed */
int inverse_station_id_order;
/*! A pointer to a list of known models from this vendor */
const model_data_t *known_models;
static const nsf_data_t vendor_00[] =
{
/* Japan */
- {"\x00\x00", 2, "Unknown - indeterminate", TRUE, NULL},
- {"\x00\x01", 2, "Anritsu", FALSE, NULL},
- {"\x00\x02", 2, "Nippon Telephone", FALSE, NULL},
- {"\x00\x05", 2, "Mitsuba Electric", FALSE, NULL},
- {"\x00\x06", 2, "Master Net", FALSE, NULL},
- {"\x00\x09", 2, "Xerox/Toshiba", TRUE, Xerox},
- {"\x00\x0A", 2, "Kokusai", FALSE, NULL},
- {"\x00\x0D", 2, "Logic System International", FALSE, NULL},
- {"\x00\x0E", 2, "Panasonic", FALSE, Panasonic0E},
- {"\x00\x11", 2, "Canon", FALSE, Canon},
- {"\x00\x15", 2, "Toyotsushen Machinery", FALSE, NULL},
- {"\x00\x16", 2, "System House Mind", FALSE, NULL},
- {"\x00\x19", 2, "Xerox", TRUE, NULL},
- {"\x00\x1D", 2, "Hitachi Software", FALSE, NULL},
- {"\x00\x21", 2, "OKI Electric/Lanier", TRUE, NULL},
- {"\x00\x25", 2, "Ricoh", TRUE, Ricoh},
- {"\x00\x26", 2, "Konica", FALSE, NULL},
- {"\x00\x29", 2, "Japan Wireless", FALSE, NULL},
- {"\x00\x2D", 2, "Sony", FALSE, NULL},
- {"\x00\x31", 2, "Sharp/Olivetti", FALSE, Sharp},
- {"\x00\x35", 2, "Kogyu", FALSE, NULL},
- {"\x00\x36", 2, "Japan Telecom", FALSE, NULL},
- {"\x00\x3D", 2, "IBM Japan", FALSE, NULL},
- {"\x00\x39", 2, "Panasonic", FALSE, NULL},
- {"\x00\x41", 2, "Swasaki Communication", FALSE, NULL},
- {"\x00\x45", 2, "Muratec", FALSE, Muratec45},
- {"\x00\x46", 2, "Pheonix", FALSE, NULL},
- {"\x00\x48", 2, "Muratec", FALSE, Muratec48}, /* Not registered */
- {"\x00\x49", 2, "Japan Electric", FALSE, NULL},
- {"\x00\x4D", 2, "Okura Electric", FALSE, NULL},
- {"\x00\x51", 2, "Sanyo", FALSE, Sanyo},
- {"\x00\x55", 2, "Unknown - Japan 55", FALSE, NULL},
- {"\x00\x56", 2, "Brother", FALSE, Brother},
- {"\x00\x59", 2, "Fujitsu", FALSE, NULL},
- {"\x00\x5D", 2, "Kuoni", FALSE, NULL},
- {"\x00\x61", 2, "Casio", FALSE, NULL},
- {"\x00\x65", 2, "Tateishi Electric", FALSE, NULL},
- {"\x00\x66", 2, "Utax/Mita", TRUE, NULL},
- {"\x00\x69", 2, "Hitachi Production", FALSE, NULL},
- {"\x00\x6D", 2, "Hitachi Telecom", FALSE, NULL},
- {"\x00\x71", 2, "Tamura Electric Works", FALSE, NULL},
- {"\x00\x75", 2, "Tokyo Electric Corp.", FALSE, NULL},
- {"\x00\x76", 2, "Advance", FALSE, NULL},
- {"\x00\x79", 2, "Panasonic", FALSE, Panasonic79},
- {"\x00\x7D", 2, "Seiko", FALSE, NULL},
- {"\x08\x00", 2, "Daiko", FALSE, NULL},
- {"\x10\x00", 2, "Funai Electric", FALSE, NULL},
- {"\x20\x00", 2, "Eagle System", FALSE, NULL},
- {"\x30\x00", 2, "Nippon Business Systems", FALSE, NULL},
- {"\x40\x00", 2, "Comtron", FALSE, NULL},
- {"\x48\x00", 2, "Cosmo Consulting", FALSE, NULL},
- {"\x50\x00", 2, "Orion Electric", FALSE, NULL},
- {"\x60\x00", 2, "Nagano Nippon", FALSE, NULL},
- {"\x70\x00", 2, "Kyocera", FALSE, NULL},
- {"\x80\x00", 2, "Kanda Networks", FALSE, NULL},
- {"\x88\x00", 2, "Soft Front", FALSE, NULL},
- {"\x90\x00", 2, "Arctic", FALSE, NULL},
- {"\xA0\x00", 2, "Nakushima", FALSE, NULL},
- {"\xB0\x00", 2, "Minolta", FALSE, NULL},
- {"\xC0\x00", 2, "Tohoku Pioneer", FALSE, NULL},
- {"\xD0\x00", 2, "USC", FALSE, NULL},
- {"\xE0\x00", 2, "Hiboshi", FALSE, NULL},
- {"\xF0\x00", 2, "Sumitomo Electric", FALSE, NULL},
- {NULL, 0, NULL, FALSE, NULL}
+ {"\x00\x00", 2, "Unknown - indeterminate", true, NULL},
+ {"\x00\x01", 2, "Anritsu", false, NULL},
+ {"\x00\x02", 2, "Nippon Telephone", false, NULL},
+ {"\x00\x05", 2, "Mitsuba Electric", false, NULL},
+ {"\x00\x06", 2, "Master Net", false, NULL},
+ {"\x00\x09", 2, "Xerox/Toshiba", true, Xerox},
+ {"\x00\x0A", 2, "Kokusai", false, NULL},
+ {"\x00\x0D", 2, "Logic System International", false, NULL},
+ {"\x00\x0E", 2, "Panasonic", false, Panasonic0E},
+ {"\x00\x11", 2, "Canon", false, Canon},
+ {"\x00\x15", 2, "Toyotsushen Machinery", false, NULL},
+ {"\x00\x16", 2, "System House Mind", false, NULL},
+ {"\x00\x19", 2, "Xerox", true, NULL},
+ {"\x00\x1D", 2, "Hitachi Software", false, NULL},
+ {"\x00\x21", 2, "OKI Electric/Lanier", true, NULL},
+ {"\x00\x25", 2, "Ricoh", true, Ricoh},
+ {"\x00\x26", 2, "Konica", false, NULL},
+ {"\x00\x29", 2, "Japan Wireless", false, NULL},
+ {"\x00\x2D", 2, "Sony", false, NULL},
+ {"\x00\x31", 2, "Sharp/Olivetti", false, Sharp},
+ {"\x00\x35", 2, "Kogyu", false, NULL},
+ {"\x00\x36", 2, "Japan Telecom", false, NULL},
+ {"\x00\x3D", 2, "IBM Japan", false, NULL},
+ {"\x00\x39", 2, "Panasonic", false, NULL},
+ {"\x00\x41", 2, "Swasaki Communication", false, NULL},
+ {"\x00\x45", 2, "Muratec", false, Muratec45},
+ {"\x00\x46", 2, "Pheonix", false, NULL},
+ {"\x00\x48", 2, "Muratec", false, Muratec48}, /* Not registered */
+ {"\x00\x49", 2, "Japan Electric", false, NULL},
+ {"\x00\x4D", 2, "Okura Electric", false, NULL},
+ {"\x00\x51", 2, "Sanyo", false, Sanyo},
+ {"\x00\x55", 2, "Unknown - Japan 55", false, NULL},
+ {"\x00\x56", 2, "Brother", false, Brother},
+ {"\x00\x59", 2, "Fujitsu", false, NULL},
+ {"\x00\x5D", 2, "Kuoni", false, NULL},
+ {"\x00\x61", 2, "Casio", false, NULL},
+ {"\x00\x65", 2, "Tateishi Electric", false, NULL},
+ {"\x00\x66", 2, "Utax/Mita", true, NULL},
+ {"\x00\x69", 2, "Hitachi Production", false, NULL},
+ {"\x00\x6D", 2, "Hitachi Telecom", false, NULL},
+ {"\x00\x71", 2, "Tamura Electric Works", false, NULL},
+ {"\x00\x75", 2, "Tokyo Electric Corp.", false, NULL},
+ {"\x00\x76", 2, "Advance", false, NULL},
+ {"\x00\x79", 2, "Panasonic", false, Panasonic79},
+ {"\x00\x7D", 2, "Seiko", false, NULL},
+ {"\x08\x00", 2, "Daiko", false, NULL},
+ {"\x10\x00", 2, "Funai Electric", false, NULL},
+ {"\x20\x00", 2, "Eagle System", false, NULL},
+ {"\x30\x00", 2, "Nippon Business Systems", false, NULL},
+ {"\x40\x00", 2, "Comtron", false, NULL},
+ {"\x48\x00", 2, "Cosmo Consulting", false, NULL},
+ {"\x50\x00", 2, "Orion Electric", false, NULL},
+ {"\x60\x00", 2, "Nagano Nippon", false, NULL},
+ {"\x70\x00", 2, "Kyocera", false, NULL},
+ {"\x80\x00", 2, "Kanda Networks", false, NULL},
+ {"\x88\x00", 2, "Soft Front", false, NULL},
+ {"\x90\x00", 2, "Arctic", false, NULL},
+ {"\xA0\x00", 2, "Nakushima", false, NULL},
+ {"\xB0\x00", 2, "Minolta", false, NULL},
+ {"\xC0\x00", 2, "Tohoku Pioneer", false, NULL},
+ {"\xD0\x00", 2, "USC", false, NULL},
+ {"\xE0\x00", 2, "Hiboshi", false, NULL},
+ {"\xF0\x00", 2, "Sumitomo Electric", false, NULL},
+ {NULL, 0, NULL, false, NULL}
};
static const nsf_data_t vendor_20[] =
{
/* Germany */
- {"\x09", 1, "ITK Institut für Telekommunikation GmbH & Co KG", FALSE, NULL},
- {"\x11", 1, "Dr. Neuhaus Mikroelektronik", FALSE, NULL},
- {"\x21", 1, "ITO Communication", FALSE, NULL},
- {"\x31", 1, "mbp Kommunikationssysteme GmbH", FALSE, NULL},
- {"\x41", 1, "Siemens", FALSE, NULL},
- {"\x42", 1, "Deutsche Telekom AG", FALSE, NULL},
- {"\x51", 1, "mps Software", FALSE, NULL},
- {"\x61", 1, "Hauni Elektronik", FALSE, NULL},
- {"\x71", 1, "Digitronic computersysteme gmbh", FALSE, NULL},
- {"\x81\x00", 2, "Innovaphone GmbH", FALSE, NULL},
- {"\x81\x40", 2, "TEDAS Gesellschaft für Telekommunikations-, Daten- und Audiosysteme mbH", FALSE, NULL},
- {"\x81\x80", 2, "AVM Audiovisuelles Marketing und Computersysteme GmbH", FALSE, NULL},
- {"\x81\xC0", 2, "EICON Technology Research GmbH", FALSE, NULL},
- {"\xB1", 1, "Schneider Rundfunkwerke AG", FALSE, NULL},
- {"\xC2", 1, "Deutsche Telekom AG", FALSE, NULL},
- {"\xD1", 1, "Ferrari electronik GmbH", FALSE, NULL},
- {"\xF1", 1, "DeTeWe - Deutsche Telephonwerke AG & Co", FALSE, NULL},
- {"\xFF", 1, "Germany Regional Code", FALSE, NULL},
- {NULL, 0, NULL, FALSE, NULL}
+ {"\x09", 1, "ITK Institut für Telekommunikation GmbH & Co KG", false, NULL},
+ {"\x11", 1, "Dr. Neuhaus Mikroelektronik", false, NULL},
+ {"\x21", 1, "ITO Communication", false, NULL},
+ {"\x31", 1, "mbp Kommunikationssysteme GmbH", false, NULL},
+ {"\x41", 1, "Siemens", false, NULL},
+ {"\x42", 1, "Deutsche Telekom AG", false, NULL},
+ {"\x51", 1, "mps Software", false, NULL},
+ {"\x61", 1, "Hauni Elektronik", false, NULL},
+ {"\x71", 1, "Digitronic computersysteme gmbh", false, NULL},
+ {"\x81\x00", 2, "Innovaphone GmbH", false, NULL},
+ {"\x81\x40", 2, "TEDAS Gesellschaft für Telekommunikations-, Daten- und Audiosysteme mbH", false, NULL},
+ {"\x81\x80", 2, "AVM Audiovisuelles Marketing und Computersysteme GmbH", false, NULL},
+ {"\x81\xC0", 2, "EICON Technology Research GmbH", false, NULL},
+ {"\xB1", 1, "Schneider Rundfunkwerke AG", false, NULL},
+ {"\xC2", 1, "Deutsche Telekom AG", false, NULL},
+ {"\xD1", 1, "Ferrari electronik GmbH", false, NULL},
+ {"\xF1", 1, "DeTeWe - Deutsche Telephonwerke AG & Co", false, NULL},
+ {"\xFF", 1, "Germany Regional Code", false, NULL},
+ {NULL, 0, NULL, false, NULL}
};
static const nsf_data_t vendor_64[] =
{
/* China (not Lebanon) */
- {"\x00\x00", 2, "Unknown - China 00 00", FALSE, NULL},
- {"\x01\x00", 2, "Unknown - China 01 00", FALSE, NULL},
- {"\x01\x01", 2, "Unknown - China 01 01", FALSE, NULL},
- {"\x01\x02", 2, "Unknown - China 01 02", FALSE, NULL},
- {NULL, 0, NULL, FALSE, NULL}
+ {"\x00\x00", 2, "Unknown - China 00 00", false, NULL},
+ {"\x01\x00", 2, "Unknown - China 01 00", false, NULL},
+ {"\x01\x01", 2, "Unknown - China 01 01", false, NULL},
+ {"\x01\x02", 2, "Unknown - China 01 02", false, NULL},
+ {NULL, 0, NULL, false, NULL}
};
static const nsf_data_t vendor_61[] =
{
/* Korea */
- {"\x00\x7A", 2, "Xerox", FALSE, NULL},
- {NULL, 0, NULL, FALSE, NULL}
+ {"\x00\x7A", 2, "Xerox", false, NULL},
+ {NULL, 0, NULL, false, NULL}
};
static const nsf_data_t vendor_86[] =
{
/* Korea (not Papua New Guinea) */
- {"\x00\x02", 2, "Unknown - Korea 02", FALSE, NULL},
- {"\x00\x06", 2, "Unknown - Korea 06", FALSE, NULL},
- {"\x00\x08", 2, "Unknown - Korea 08", FALSE, NULL},
- {"\x00\x0A", 2, "Unknown - Korea 0A", FALSE, NULL},
- {"\x00\x0E", 2, "Unknown - Korea 0E", FALSE, NULL},
- {"\x00\x10", 2, "Samsung", FALSE, NULL},
- {"\x00\x11", 2, "Unknown - Korea 11", FALSE, NULL},
- {"\x00\x16", 2, "Samsung", FALSE, Samsung16},
- {"\x00\x1A", 2, "Unknown - Korea 1A", FALSE, NULL},
- {"\x00\x40", 2, "Unknown - Korea 40", FALSE, NULL},
- {"\x00\x48", 2, "Unknown - Korea 48", FALSE, NULL},
- {"\x00\x52", 2, "Unknown - Korea 52", FALSE, NULL},
- {"\x00\x5A", 2, "Samsung", FALSE, Samsung5A},
- {"\x00\x5E", 2, "Unknown - Korea 5E", FALSE, NULL},
- {"\x00\x66", 2, "Unknown - Korea 66", FALSE, NULL},
- {"\x00\x6E", 2, "Unknown - Korea 6E", FALSE, NULL},
- {"\x00\x82", 2, "Unknown - Korea 82", FALSE, NULL},
- {"\x00\x88", 2, "Unknown - Korea 88", FALSE, NULL},
- {"\x00\x8A", 2, "Unknown - Korea 8A", FALSE, NULL},
- {"\x00\x8C", 2, "Samsung", FALSE, Samsung8C},
- {"\x00\x92", 2, "Unknown - Korea 92", FALSE, NULL},
- {"\x00\x98", 2, "Samsung", FALSE, NULL},
- {"\x00\xA2", 2, "Samsung", FALSE, SamsungA2},
- {"\x00\xA4", 2, "Unknown - Korea A4", FALSE, NULL},
- {"\x00\xC2", 2, "Samsung", FALSE, NULL},
- {"\x00\xC9", 2, "Unknown - Korea C9", FALSE, NULL},
- {"\x00\xCC", 2, "Unknown - Korea CC", FALSE, NULL},
- {"\x00\xD2", 2, "Unknown - Korea D2", FALSE, NULL},
- {"\x00\xDA", 2, "Xerox", FALSE, XeroxDA},
- {"\x00\xE2", 2, "Unknown - Korea E2", FALSE, NULL},
- {"\x00\xEC", 2, "Unknown - Korea EC", FALSE, NULL},
- {"\x00\xEE", 2, "Unknown - Korea EE", FALSE, NULL},
- {NULL, 0, NULL, FALSE, NULL}
+ {"\x00\x02", 2, "Unknown - Korea 02", false, NULL},
+ {"\x00\x06", 2, "Unknown - Korea 06", false, NULL},
+ {"\x00\x08", 2, "Unknown - Korea 08", false, NULL},
+ {"\x00\x0A", 2, "Unknown - Korea 0A", false, NULL},
+ {"\x00\x0E", 2, "Unknown - Korea 0E", false, NULL},
+ {"\x00\x10", 2, "Samsung", false, NULL},
+ {"\x00\x11", 2, "Unknown - Korea 11", false, NULL},
+ {"\x00\x16", 2, "Samsung", false, Samsung16},
+ {"\x00\x1A", 2, "Unknown - Korea 1A", false, NULL},
+ {"\x00\x40", 2, "Unknown - Korea 40", false, NULL},
+ {"\x00\x48", 2, "Unknown - Korea 48", false, NULL},
+ {"\x00\x52", 2, "Unknown - Korea 52", false, NULL},
+ {"\x00\x5A", 2, "Samsung", false, Samsung5A},
+ {"\x00\x5E", 2, "Unknown - Korea 5E", false, NULL},
+ {"\x00\x66", 2, "Unknown - Korea 66", false, NULL},
+ {"\x00\x6E", 2, "Unknown - Korea 6E", false, NULL},
+ {"\x00\x82", 2, "Unknown - Korea 82", false, NULL},
+ {"\x00\x88", 2, "Unknown - Korea 88", false, NULL},
+ {"\x00\x8A", 2, "Unknown - Korea 8A", false, NULL},
+ {"\x00\x8C", 2, "Samsung", false, Samsung8C},
+ {"\x00\x92", 2, "Unknown - Korea 92", false, NULL},
+ {"\x00\x98", 2, "Samsung", false, NULL},
+ {"\x00\xA2", 2, "Samsung", false, SamsungA2},
+ {"\x00\xA4", 2, "Unknown - Korea A4", false, NULL},
+ {"\x00\xC2", 2, "Samsung", false, NULL},
+ {"\x00\xC9", 2, "Unknown - Korea C9", false, NULL},
+ {"\x00\xCC", 2, "Unknown - Korea CC", false, NULL},
+ {"\x00\xD2", 2, "Unknown - Korea D2", false, NULL},
+ {"\x00\xDA", 2, "Xerox", false, XeroxDA},
+ {"\x00\xE2", 2, "Unknown - Korea E2", false, NULL},
+ {"\x00\xEC", 2, "Unknown - Korea EC", false, NULL},
+ {"\x00\xEE", 2, "Unknown - Korea EE", false, NULL},
+ {NULL, 0, NULL, false, NULL}
};
static const nsf_data_t vendor_bc[] =
{
/* France */
- {"\x53\x01", 2, "Minolta", FALSE, NULL},
- {NULL, 0, NULL, FALSE, NULL}
+ {"\x53\x01", 2, "Minolta", false, NULL},
+ {NULL, 0, NULL, false, NULL}
};
static const nsf_data_t vendor_ad[] =
{
/* United States (not Tunisia) */
- {"\x00\x00", 2, "Pitney Bowes", FALSE, PitneyBowes},
- {"\x00\x0C", 2, "Dialogic", FALSE, NULL},
- {"\x00\x15", 2, "Lexmark", FALSE, Lexmark},
- {"\x00\x16", 2, "JetFax", FALSE, JetFax},
- {"\x00\x24", 2, "Octel", FALSE, NULL},
- {"\x00\x36", 2, "HP", FALSE, HP},
- {"\x00\x42", 2, "FaxTalk", FALSE, NULL},
- {"\x00\x44", 2, NULL, TRUE, NULL},
- {"\x00\x46", 2, "BrookTrout", FALSE, NULL},
- {"\x00\x51", 2, "Telogy Networks", FALSE, NULL},
- {"\x00\x55", 2, "HylaFAX", FALSE, NULL},
- {"\x00\x5C", 2, "IBM", FALSE, NULL},
- {"\x00\x98", 2, "Unknown - USA 98", TRUE, NULL},
- {NULL, 0, NULL, FALSE, NULL}
+ {"\x00\x00", 2, "Pitney Bowes", false, PitneyBowes},
+ {"\x00\x0C", 2, "Dialogic", false, NULL},
+ {"\x00\x15", 2, "Lexmark", false, Lexmark},
+ {"\x00\x16", 2, "JetFax", false, JetFax},
+ {"\x00\x24", 2, "Octel", false, NULL},
+ {"\x00\x36", 2, "HP", false, HP},
+ {"\x00\x42", 2, "FaxTalk", false, NULL},
+ {"\x00\x44", 2, NULL, true, NULL},
+ {"\x00\x46", 2, "BrookTrout", false, NULL},
+ {"\x00\x51", 2, "Telogy Networks", false, NULL},
+ {"\x00\x55", 2, "HylaFAX", false, NULL},
+ {"\x00\x5C", 2, "IBM", false, NULL},
+ {"\x00\x98", 2, "Unknown - USA 98", true, NULL},
+ {NULL, 0, NULL, false, NULL}
};
static const nsf_data_t vendor_b4[] =
{
/* United Kingdom */
- {"\x00\xB0", 2, "DCE", FALSE, NULL},
- {"\x00\xB1", 2, "Hasler", FALSE, NULL},
- {"\x00\xB2", 2, "Interquad", FALSE, NULL},
- {"\x00\xB3", 2, "Comwave", FALSE, NULL},
- {"\x00\xB4", 2, "Iconographic", FALSE, NULL},
- {"\x00\xB5", 2, "Wordcraft", FALSE, NULL},
- {"\x00\xB6", 2, "Acorn", FALSE, NULL},
- {NULL, 0, NULL, FALSE, NULL}
+ {"\x00\xB0", 2, "DCE", false, NULL},
+ {"\x00\xB1", 2, "Hasler", false, NULL},
+ {"\x00\xB2", 2, "Interquad", false, NULL},
+ {"\x00\xB3", 2, "Comwave", false, NULL},
+ {"\x00\xB4", 2, "Iconographic", false, NULL},
+ {"\x00\xB5", 2, "Wordcraft", false, NULL},
+ {"\x00\xB6", 2, "Acorn", false, NULL},
+ {NULL, 0, NULL, false, NULL}
};
static const nsf_data_t vendor_b5[] =
{
/* United States */
- {"\x00\x01", 2, "Picturetel", FALSE, NULL},
- {"\x00\x20", 2, "Conexant", FALSE, NULL},
- {"\x00\x22", 2, "Comsat", FALSE, NULL},
- {"\x00\x24", 2, "Octel", FALSE, NULL},
- {"\x00\x26", 2, "ROLM", FALSE, NULL},
- {"\x00\x28", 2, "SOFNET", FALSE, NULL},
- {"\x00\x29", 2, "TIA TR-29 Committee", FALSE, NULL},
- {"\x00\x2A", 2, "STF Tech", FALSE, NULL},
- {"\x00\x2C", 2, "HKB", FALSE, NULL},
- {"\x00\x2E", 2, "Delrina", FALSE, NULL},
- {"\x00\x30", 2, "Dialogic", FALSE, NULL},
- {"\x00\x32", 2, "Applied Synergy", FALSE, NULL},
- {"\x00\x34", 2, "Syncro Development", FALSE, NULL},
- {"\x00\x36", 2, "Genoa", FALSE, NULL},
- {"\x00\x38", 2, "Texas Instruments", FALSE, NULL},
- {"\x00\x3A", 2, "IBM", FALSE, NULL},
- {"\x00\x3C", 2, "ViaSat", FALSE, NULL},
- {"\x00\x3E", 2, "Ericsson", FALSE, NULL},
- {"\x00\x42", 2, "Bogosian", FALSE, NULL},
- {"\x00\x44", 2, "Adobe", FALSE, NULL},
- {"\x00\x46", 2, "Fremont Communications", FALSE, NULL},
- {"\x00\x48", 2, "Hayes", FALSE, NULL},
- {"\x00\x4A", 2, "Lucent", FALSE, NULL},
- {"\x00\x4C", 2, "Data Race", FALSE, NULL},
- {"\x00\x4E", 2, "TRW", FALSE, NULL},
- {"\x00\x52", 2, "Audiofax", FALSE, NULL},
- {"\x00\x54", 2, "Computer Automation", FALSE, NULL},
- {"\x00\x56", 2, "Serca", FALSE, NULL},
- {"\x00\x58", 2, "Octocom", FALSE, NULL},
- {"\x00\x5C", 2, "Power Solutions", FALSE, NULL},
- {"\x00\x5A", 2, "Digital Sound", FALSE, NULL},
- {"\x00\x5E", 2, "Pacific Data", FALSE, NULL},
- {"\x00\x60", 2, "Commetrex", FALSE, NULL},
- {"\x00\x62", 2, "BrookTrout", FALSE, NULL},
- {"\x00\x64", 2, "Gammalink", FALSE, NULL},
- {"\x00\x66", 2, "Castelle", FALSE, NULL},
- {"\x00\x68", 2, "Hybrid Fax", FALSE, NULL},
- {"\x00\x6A", 2, "Omnifax", FALSE, NULL},
- {"\x00\x6C", 2, "HP", FALSE, NULL},
- {"\x00\x6E", 2, "Microsoft", FALSE, NULL},
- {"\x00\x72", 2, "Speaking Devices", FALSE, NULL},
- {"\x00\x74", 2, "Compaq", FALSE, NULL},
- {"\x00\x76", 2, "Microsoft", FALSE, NULL}, /* uses LSB for country but MSB for manufacturer */
- {"\x00\x78", 2, "Cylink", FALSE, NULL},
- {"\x00\x7A", 2, "Pitney Bowes", FALSE, NULL},
- {"\x00\x7C", 2, "Digiboard", FALSE, NULL},
- {"\x00\x7E", 2, "Codex", FALSE, NULL},
- {"\x00\x82", 2, "Wang Labs", FALSE, NULL},
- {"\x00\x84", 2, "Netexpress Communications", FALSE, NULL},
- {"\x00\x86", 2, "Cable-Sat", FALSE, NULL},
- {"\x00\x88", 2, "MFPA", FALSE, NULL},
- {"\x00\x8A", 2, "Telogy Networks", FALSE, NULL},
- {"\x00\x8E", 2, "Telecom Multimedia Systems", FALSE, NULL},
- {"\x00\x8C", 2, "AT&T", FALSE, NULL},
- {"\x00\x92", 2, "Nuera", FALSE, NULL},
- {"\x00\x94", 2, "K56flex", FALSE, NULL},
- {"\x00\x96", 2, "MiBridge", FALSE, NULL},
- {"\x00\x98", 2, "Xerox", FALSE, NULL},
- {"\x00\x9A", 2, "Fujitsu", FALSE, NULL},
- {"\x00\x9B", 2, "Fujitsu", FALSE, NULL},
- {"\x00\x9C", 2, "Natural Microsystems", FALSE, NULL},
- {"\x00\x9E", 2, "CopyTele", FALSE, NULL},
- {"\x00\xA2", 2, "Murata", FALSE, NULL},
- {"\x00\xA4", 2, "Lanier", FALSE, NULL},
- {"\x00\xA6", 2, "Qualcomm", FALSE, NULL},
- {"\x00\xAA", 2, "HylaFAX", FALSE, NULL},
- {NULL, 0, NULL, FALSE, NULL}
+ {"\x00\x01", 2, "Picturetel", false, NULL},
+ {"\x00\x20", 2, "Conexant", false, NULL},
+ {"\x00\x22", 2, "Comsat", false, NULL},
+ {"\x00\x24", 2, "Octel", false, NULL},
+ {"\x00\x26", 2, "ROLM", false, NULL},
+ {"\x00\x28", 2, "SOFNET", false, NULL},
+ {"\x00\x29", 2, "TIA TR-29 Committee", false, NULL},
+ {"\x00\x2A", 2, "STF Tech", false, NULL},
+ {"\x00\x2C", 2, "HKB", false, NULL},
+ {"\x00\x2E", 2, "Delrina", false, NULL},
+ {"\x00\x30", 2, "Dialogic", false, NULL},
+ {"\x00\x32", 2, "Applied Synergy", false, NULL},
+ {"\x00\x34", 2, "Syncro Development", false, NULL},
+ {"\x00\x36", 2, "Genoa", false, NULL},
+ {"\x00\x38", 2, "Texas Instruments", false, NULL},
+ {"\x00\x3A", 2, "IBM", false, NULL},
+ {"\x00\x3C", 2, "ViaSat", false, NULL},
+ {"\x00\x3E", 2, "Ericsson", false, NULL},
+ {"\x00\x42", 2, "Bogosian", false, NULL},
+ {"\x00\x44", 2, "Adobe", false, NULL},
+ {"\x00\x46", 2, "Fremont Communications", false, NULL},
+ {"\x00\x48", 2, "Hayes", false, NULL},
+ {"\x00\x4A", 2, "Lucent", false, NULL},
+ {"\x00\x4C", 2, "Data Race", false, NULL},
+ {"\x00\x4E", 2, "TRW", false, NULL},
+ {"\x00\x52", 2, "Audiofax", false, NULL},
+ {"\x00\x54", 2, "Computer Automation", false, NULL},
+ {"\x00\x56", 2, "Serca", false, NULL},
+ {"\x00\x58", 2, "Octocom", false, NULL},
+ {"\x00\x5C", 2, "Power Solutions", false, NULL},
+ {"\x00\x5A", 2, "Digital Sound", false, NULL},
+ {"\x00\x5E", 2, "Pacific Data", false, NULL},
+ {"\x00\x60", 2, "Commetrex", false, NULL},
+ {"\x00\x62", 2, "BrookTrout", false, NULL},
+ {"\x00\x64", 2, "Gammalink", false, NULL},
+ {"\x00\x66", 2, "Castelle", false, NULL},
+ {"\x00\x68", 2, "Hybrid Fax", false, NULL},
+ {"\x00\x6A", 2, "Omnifax", false, NULL},
+ {"\x00\x6C", 2, "HP", false, NULL},
+ {"\x00\x6E", 2, "Microsoft", false, NULL},
+ {"\x00\x72", 2, "Speaking Devices", false, NULL},
+ {"\x00\x74", 2, "Compaq", false, NULL},
+ {"\x00\x76", 2, "Microsoft", false, NULL}, /* uses LSB for country but MSB for manufacturer */
+ {"\x00\x78", 2, "Cylink", false, NULL},
+ {"\x00\x7A", 2, "Pitney Bowes", false, NULL},
+ {"\x00\x7C", 2, "Digiboard", false, NULL},
+ {"\x00\x7E", 2, "Codex", false, NULL},
+ {"\x00\x82", 2, "Wang Labs", false, NULL},
+ {"\x00\x84", 2, "Netexpress Communications", false, NULL},
+ {"\x00\x86", 2, "Cable-Sat", false, NULL},
+ {"\x00\x88", 2, "MFPA", false, NULL},
+ {"\x00\x8A", 2, "Telogy Networks", false, NULL},
+ {"\x00\x8E", 2, "Telecom Multimedia Systems", false, NULL},
+ {"\x00\x8C", 2, "AT&T", false, NULL},
+ {"\x00\x92", 2, "Nuera", false, NULL},
+ {"\x00\x94", 2, "K56flex", false, NULL},
+ {"\x00\x96", 2, "MiBridge", false, NULL},
+ {"\x00\x98", 2, "Xerox", false, NULL},
+ {"\x00\x9A", 2, "Fujitsu", false, NULL},
+ {"\x00\x9B", 2, "Fujitsu", false, NULL},
+ {"\x00\x9C", 2, "Natural Microsystems", false, NULL},
+ {"\x00\x9E", 2, "CopyTele", false, NULL},
+ {"\x00\xA2", 2, "Murata", false, NULL},
+ {"\x00\xA4", 2, "Lanier", false, NULL},
+ {"\x00\xA6", 2, "Qualcomm", false, NULL},
+ {"\x00\xAA", 2, "HylaFAX", false, NULL},
+ {NULL, 0, NULL, false, NULL}
};
static const country_code_t t35_country_codes[255] =
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(int) t35_decode(const uint8_t *msg, int len, const char **country, const char **vendor, const char **model)
+SPAN_DECLARE(bool) t35_decode(const uint8_t *msg, int len, const char **country, const char **vendor, const char **model)
{
const nsf_data_t *p;
const model_data_t *pp;
*model = NULL;
if ((p = find_vendor(msg, len)) == NULL)
- return FALSE;
+ return false;
if (vendor)
*vendor = p->vendor_name;
if (model && p->known_models)
}
}
}
- return TRUE;
+ return true;
}
/*- End of function --------------------------------------------------------*/
/*- End of file ------------------------------------------------------------*/
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include <assert.h>
#include <memory.h>
//printf("Count is %d\n", count);
/* Do a dummy run through the fields to check we have a complete and uncorrupted packet. */
prev_ptr = ptr;
- other_half = FALSE;
+ other_half = false;
t30_field_type = 0;
for (i = 0; i < (int) count; i++)
{
/* Decode field_type */
t30_field_type = buf[ptr] & 0x7;
ptr++;
- other_half = FALSE;
+ other_half = false;
}
else
{
if (field_data_present)
ptr++;
else
- other_half = TRUE;
+ other_half = true;
}
if (t30_field_type > T38_FIELD_T4_NON_ECM_SIG_END)
{
/* Things look alright in the data, so lets run through the fields again, actually processing them.
There is no need to do all the error checking along the way on this pass. */
ptr = prev_ptr;
- other_half = FALSE;
+ other_half = false;
for (i = 0; i < (int) count; i++)
{
if (s->t38_version == 0)
/* Decode field_type */
t30_field_type = buf[ptr] & 0x7;
ptr++;
- other_half = FALSE;
+ other_half = false;
}
else
{
if (field_data_present)
ptr++;
else
- other_half = TRUE;
+ other_half = true;
}
}
else
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(void) t38_set_fill_bit_removal(t38_core_state_t *s, int fill_bit_removal)
+SPAN_DECLARE(void) t38_set_fill_bit_removal(t38_core_state_t *s, bool fill_bit_removal)
{
s->fill_bit_removal = fill_bit_removal;
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(void) t38_set_mmr_transcoding(t38_core_state_t *s, int mmr_transcoding)
+SPAN_DECLARE(void) t38_set_mmr_transcoding(t38_core_state_t *s, bool mmr_transcoding)
{
s->mmr_transcoding = mmr_transcoding;
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(void) t38_set_jbig_transcoding(t38_core_state_t *s, int jbig_transcoding)
+SPAN_DECLARE(void) t38_set_jbig_transcoding(t38_core_state_t *s, bool jbig_transcoding)
{
s->jbig_transcoding = jbig_transcoding;
}
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(void) t38_set_sequence_number_handling(t38_core_state_t *s, int check)
+SPAN_DECLARE(void) t38_set_sequence_number_handling(t38_core_state_t *s, bool check)
{
s->check_sequence_numbers = check;
}
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(void) t38_set_tep_handling(t38_core_state_t *s, int allow_for_tep)
+SPAN_DECLARE(void) t38_set_tep_handling(t38_core_state_t *s, bool allow_for_tep)
{
s->allow_for_tep = allow_for_tep;
}
T.38 domain - e.g. from SDP data. */
s->data_rate_management_method = T38_DATA_RATE_MANAGEMENT_TRANSFERRED_TCF;
s->data_transport_protocol = T38_TRANSPORT_UDPTL;
- s->fill_bit_removal = FALSE;
- s->mmr_transcoding = FALSE;
- s->jbig_transcoding = FALSE;
+ s->fill_bit_removal = false;
+ s->mmr_transcoding = false;
+ s->jbig_transcoding = false;
s->max_buffer_size = 400;
s->max_datagram_size = 100;
s->t38_version = 0;
- s->check_sequence_numbers = TRUE;
- s->pace_transmission = TRUE;
+ s->check_sequence_numbers = true;
+ s->pace_transmission = true;
/* Set some defaults */
s->category_control[T38_PACKET_CATEGORY_INDICATOR] = 1;
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include <assert.h>
#if defined(LOG_FAX_AUDIO)
#include "spandsp/private/logging.h"
#include "spandsp/private/silence_gen.h"
+#include "spandsp/private/power_meter.h"
#include "spandsp/private/fsk.h"
#include "spandsp/private/v17tx.h"
#include "spandsp/private/v17rx.h"
||
t->tx_handler == (span_tx_handler_t) &tone_gen)
{
- fax_modems_set_rx_active(t, TRUE);
+ fax_modems_set_rx_active(t, true);
}
else
{
- fax_modems_set_rx_active(t, FALSE);
+ fax_modems_set_rx_active(t, false);
}
/*endif*/
- return TRUE;
+ return true;
}
/*endif*/
u = &s->core.hdlc_to_modem;
if (u->in == u->out)
- return FALSE;
+ return false;
/*endif*/
if ((u->buf[u->out].contents & FLAG_INDICATOR) == 0)
- return FALSE;
+ return false;
/*endif*/
indicator = (u->buf[u->out].contents & 0xFF);
u->buf[u->out].len = 0;
if (s->core.image_data_mode && s->core.ecm_mode)
{
span_log(&s->logging, SPAN_LOG_FLOW, "HDLC mode\n");
- hdlc_tx_init(&t->hdlc_tx, FALSE, 2, TRUE, hdlc_underflow_handler, s);
+ hdlc_tx_init(&t->hdlc_tx, false, 2, true, hdlc_underflow_handler, s);
fax_modems_set_get_bit(t, (get_bit_func_t) hdlc_tx_get_bit, &t->hdlc_tx);
- use_hdlc = TRUE;
+ use_hdlc = true;
}
else
{
span_log(&s->logging, SPAN_LOG_FLOW, "Non-ECM mode\n");
fax_modems_set_get_bit(t, (get_bit_func_t) t38_non_ecm_buffer_get_bit, &s->core.non_ecm_to_modem);
- use_hdlc = FALSE;
+ use_hdlc = false;
}
/*endif*/
switch (indicator)
//silence_gen_set(&t->silence_gen, ms_to_samples(75));
fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
fax_modems_set_next_tx_handler(t, (span_tx_handler_t) NULL, NULL);
- fax_modems_set_rx_active(t, TRUE);
+ fax_modems_set_rx_active(t, true);
break;
case T38_IND_CNG:
t->tx_bit_rate = 0;
fax_modems_start_slow_modem(t, FAX_MODEM_CNG_TONE_TX);
silence_gen_set(&t->silence_gen, 0);
fax_modems_set_next_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
- fax_modems_set_rx_active(t, TRUE);
+ fax_modems_set_rx_active(t, true);
break;
case T38_IND_CED:
t->tx_bit_rate = 0;
fax_modems_start_slow_modem(t, FAX_MODEM_CED_TONE_TX);
fax_modems_set_next_tx_handler(t, (span_tx_handler_t) NULL, NULL);
- fax_modems_set_rx_active(t, TRUE);
+ fax_modems_set_rx_active(t, true);
break;
case T38_IND_V21_PREAMBLE:
t->tx_bit_rate = 300;
- hdlc_tx_init(&t->hdlc_tx, FALSE, 2, TRUE, hdlc_underflow_handler, s);
+ hdlc_tx_init(&t->hdlc_tx, false, 2, true, hdlc_underflow_handler, s);
hdlc_tx_flags(&t->hdlc_tx, 32);
silence_gen_alter(&t->silence_gen, ms_to_samples(75));
u->buf[u->in].len = 0;
fax_modems_start_slow_modem(t, FAX_MODEM_V21_TX);
fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
fax_modems_set_next_tx_handler(t, (span_tx_handler_t) &fsk_tx, &t->v21_tx);
- fax_modems_set_rx_active(t, TRUE);
+ fax_modems_set_rx_active(t, true);
break;
case T38_IND_V27TER_2400_TRAINING:
case T38_IND_V27TER_4800_TRAINING:
fax_modems_start_fast_modem(t, FAX_MODEM_V27TER_TX, bit_rate, s->core.short_train, use_hdlc);
fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
fax_modems_set_next_tx_handler(t, (span_tx_handler_t) &v27ter_tx, &t->fast_modems.v27ter_tx);
- fax_modems_set_rx_active(t, TRUE);
+ fax_modems_set_rx_active(t, true);
break;
case T38_IND_V29_7200_TRAINING:
case T38_IND_V29_9600_TRAINING:
fax_modems_start_fast_modem(t, FAX_MODEM_V29_TX, bit_rate, s->core.short_train, use_hdlc);
fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
fax_modems_set_next_tx_handler(t, (span_tx_handler_t) &v29_tx, &t->fast_modems.v29_tx);
- fax_modems_set_rx_active(t, TRUE);
+ fax_modems_set_rx_active(t, true);
break;
case T38_IND_V17_7200_SHORT_TRAINING:
case T38_IND_V17_7200_LONG_TRAINING:
case T38_IND_V17_12000_LONG_TRAINING:
case T38_IND_V17_14400_SHORT_TRAINING:
case T38_IND_V17_14400_LONG_TRAINING:
- short_train = FALSE;
+ short_train = false;
switch (indicator)
{
case T38_IND_V17_7200_SHORT_TRAINING:
- short_train = TRUE;
+ short_train = true;
bit_rate = 7200;
break;
case T38_IND_V17_7200_LONG_TRAINING:
bit_rate = 7200;
break;
case T38_IND_V17_9600_SHORT_TRAINING:
- short_train = TRUE;
+ short_train = true;
bit_rate = 9600;
break;
case T38_IND_V17_9600_LONG_TRAINING:
bit_rate = 9600;
break;
case T38_IND_V17_12000_SHORT_TRAINING:
- short_train = TRUE;
+ short_train = true;
bit_rate = 12000;
break;
case T38_IND_V17_12000_LONG_TRAINING:
bit_rate = 12000;
break;
case T38_IND_V17_14400_SHORT_TRAINING:
- short_train = TRUE;
+ short_train = true;
bit_rate = 14400;
break;
case T38_IND_V17_14400_LONG_TRAINING:
fax_modems_start_fast_modem(t, FAX_MODEM_V17_TX, bit_rate, short_train, use_hdlc);
fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
fax_modems_set_next_tx_handler(t, (span_tx_handler_t) &v17_tx, &t->fast_modems.v17_tx);
- fax_modems_set_rx_active(t, TRUE);
+ fax_modems_set_rx_active(t, true);
break;
case T38_IND_V8_ANSAM:
t->tx_bit_rate = 300;
hdlc_tx_flags(&t->hdlc_tx, t->tx_bit_rate/(8*5));
/*endif*/
s->t38x.in_progress_rx_indicator = indicator;
- return TRUE;
+ return true;
}
/*- End of function --------------------------------------------------------*/
processed, 2 machines which recognise each other might do special things
we cannot handle as a middle man. */
span_log(&s->logging, SPAN_LOG_FLOW, "Corrupting %s message to prevent recognition\n", t30_frametype(buf[2]));
- s->t38x.corrupt_current_frame[from_modem] = TRUE;
+ s->t38x.corrupt_current_frame[from_modem] = true;
}
/*endif*/
break;
case T30_CFR:
/* We are changing from TCF exchange to image exchange */
/* Successful training means we should change to short training */
- s->core.image_data_mode = TRUE;
- s->core.short_train = TRUE;
+ s->core.image_data_mode = true;
+ s->core.short_train = true;
span_log(&s->logging, SPAN_LOG_FLOW, "CFR - short train = %d, ECM = %d\n", s->core.short_train, s->core.ecm_mode);
if (!from_modem)
restart_rx_modem(s);
case T30_RTN:
case T30_RTP:
/* We are going back to the exchange of fresh TCF */
- s->core.image_data_mode = FALSE;
- s->core.short_train = FALSE;
+ s->core.image_data_mode = false;
+ s->core.short_train = false;
break;
case T30_CTR:
/* T.30 says the first image data after this does full training, yet does not
return to TCF. This seems to be the sole case of long training for image
data. */
- s->core.short_train = FALSE;
+ s->core.short_train = false;
break;
case T30_DTC:
case T30_DCS:
correct modem. */
s->core.fast_bit_rate = 0;
s->core.fast_rx_modem = FAX_MODEM_NONE;
- s->core.image_data_mode = FALSE;
- s->core.short_train = FALSE;
+ s->core.image_data_mode = false;
+ s->core.short_train = false;
if (from_modem)
s->core.timed_mode = TIMED_MODE_TCF_PREDICTABLE_MODEM_START_BEGIN;
/*endif*/
the fast modem again, so abandon our idea of it. */
s->core.fast_bit_rate = 0;
s->core.fast_rx_modem = FAX_MODEM_NONE;
- s->core.image_data_mode = FALSE;
- s->core.short_train = FALSE;
+ s->core.image_data_mode = false;
+ s->core.short_train = false;
#endif
/* Fall through */
case T30_MPS:
case T30_PRI_MPS:
- s->core.count_page_on_mcf = TRUE;
+ s->core.count_page_on_mcf = true;
break;
}
/*endswitch*/
the fast modem again, so abandon our idea of it. */
s->core.fast_bit_rate = 0;
s->core.fast_rx_modem = FAX_MODEM_NONE;
- s->core.image_data_mode = FALSE;
- s->core.short_train = FALSE;
+ s->core.image_data_mode = false;
+ s->core.short_train = false;
#endif
/* Fall through */
case T30_MPS:
case T30_MPS | 1:
case T30_PRI_MPS:
case T30_PRI_MPS | 1:
- s->core.count_page_on_mcf = TRUE;
+ s->core.count_page_on_mcf = true;
break;
case T30_MCF:
case T30_MCF | 1:
{
s->core.pages_confirmed++;
span_log(&s->logging, SPAN_LOG_FLOW, "Pages confirmed = %d\n", s->core.pages_confirmed);
- s->core.count_page_on_mcf = FALSE;
+ s->core.count_page_on_mcf = false;
}
/*endif*/
break;
{
if ((hdlc_buf->flags & HDLC_FLAG_MISSING_DATA) == 0)
{
- monitor_control_messages(s, FALSE, hdlc_buf->buf, hdlc_buf->len);
+ monitor_control_messages(s, false, hdlc_buf->buf, hdlc_buf->len);
if (s->core.real_time_frame_handler)
- s->core.real_time_frame_handler(s, s->core.real_time_frame_user_data, FALSE, hdlc_buf->buf, hdlc_buf->len);
+ s->core.real_time_frame_handler(s, s->core.real_time_frame_user_data, false, hdlc_buf->buf, hdlc_buf->len);
/*endif*/
}
/*endif*/
long training. There has to be more than one value HDLC frame in a
chunk of image data, so just setting short training mode here should
be enough. */
- s->core.short_train = TRUE;
+ s->core.short_train = true;
}
/*endif*/
hdlc_buf->contents = (data_type | FLAG_DATA);
- finalise_hdlc_frame(s, TRUE);
+ finalise_hdlc_frame(s, true);
}
else
{
hdlc_buf->contents = 0;
}
/*endif*/
- xx->corrupt_current_frame[0] = FALSE;
+ xx->corrupt_current_frame[0] = false;
break;
case T38_FIELD_HDLC_FCS_BAD:
xx->current_rx_field_class = T38_FIELD_CLASS_HDLC;
}
/*endif*/
hdlc_buf->contents = (data_type | FLAG_DATA);
- finalise_hdlc_frame(s, FALSE);
+ finalise_hdlc_frame(s, false);
}
else
{
hdlc_buf->contents = 0;
}
/*endif*/
- xx->corrupt_current_frame[0] = FALSE;
+ xx->corrupt_current_frame[0] = false;
break;
case T38_FIELD_HDLC_FCS_OK_SIG_END:
xx->current_rx_field_class = T38_FIELD_CLASS_HDLC;
{
if ((hdlc_buf->flags & HDLC_FLAG_MISSING_DATA) == 0)
{
- monitor_control_messages(s, FALSE, hdlc_buf->buf, hdlc_buf->len);
+ monitor_control_messages(s, false, hdlc_buf->buf, hdlc_buf->len);
if (s->core.real_time_frame_handler)
- s->core.real_time_frame_handler(s, s->core.real_time_frame_user_data, FALSE, hdlc_buf->buf, hdlc_buf->len);
+ s->core.real_time_frame_handler(s, s->core.real_time_frame_user_data, false, hdlc_buf->buf, hdlc_buf->len);
/*endif*/
}
/*endif*/
long training. There has to be more than one value HDLC frame in a
chunk of image data, so just setting short training mode here should
be enough. */
- s->core.short_train = TRUE;
+ s->core.short_train = true;
}
/*endif*/
hdlc_buf->contents = (data_type | FLAG_DATA);
- finalise_hdlc_frame(s, TRUE);
+ finalise_hdlc_frame(s, true);
}
else
{
xx->current_rx_field_class = T38_FIELD_CLASS_NONE;
}
/*endif*/
- xx->corrupt_current_frame[0] = FALSE;
+ xx->corrupt_current_frame[0] = false;
break;
case T38_FIELD_HDLC_FCS_BAD_SIG_END:
xx->current_rx_field_class = T38_FIELD_CLASS_HDLC;
}
/*endif*/
hdlc_buf->contents = (data_type | FLAG_DATA);
- finalise_hdlc_frame(s, FALSE);
+ finalise_hdlc_frame(s, false);
}
else
{
xx->current_rx_field_class = T38_FIELD_CLASS_NONE;
}
/*endif*/
- xx->corrupt_current_frame[0] = FALSE;
+ xx->corrupt_current_frame[0] = false;
break;
case T38_FIELD_HDLC_SIG_END:
hdlc_buf = &s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in];
xx->current_rx_field_class = T38_FIELD_CLASS_NONE;
}
/*endif*/
- xx->corrupt_current_frame[0] = FALSE;
+ xx->corrupt_current_frame[0] = false;
break;
case T38_FIELD_T4_NON_ECM_DATA:
if (xx->current_rx_field_class == T38_FIELD_CLASS_NONE)
if (len > 0)
t38_non_ecm_buffer_inject(&s->core.non_ecm_to_modem, buf, len);
/*endif*/
- xx->corrupt_current_frame[0] = FALSE;
+ xx->corrupt_current_frame[0] = false;
break;
case T38_FIELD_T4_NON_ECM_SIG_END:
if (xx->current_rx_field_class == T38_FIELD_CLASS_NONE)
xx->current_rx_field_class = T38_FIELD_CLASS_NONE;
}
/*endif*/
- xx->corrupt_current_frame[0] = FALSE;
+ xx->corrupt_current_frame[0] = false;
break;
default:
break;
break;
case SIG_STATUS_TRAINING_SUCCEEDED:
/* The modem is now trained */
- s->audio.modems.rx_signal_present = TRUE;
- s->audio.modems.rx_trained = TRUE;
+ s->audio.modems.rx_signal_present = true;
+ s->audio.modems.rx_trained = true;
s->core.timed_mode = TIMED_MODE_IDLE;
s->core.samples_to_timeout = 0;
- s->core.short_train = TRUE;
+ s->core.short_train = true;
to_t38_buffer_init(&s->core.to_t38);
break;
case SIG_STATUS_CARRIER_UP:
break;
case SIG_STATUS_TRAINING_SUCCEEDED:
/* The modem is now trained. */
- s->audio.modems.rx_signal_present = TRUE;
- s->audio.modems.rx_trained = TRUE;
- s->core.short_train = TRUE;
+ s->audio.modems.rx_signal_present = true;
+ s->audio.modems.rx_trained = true;
+ s->core.short_train = true;
/* Behave like HDLC preamble has been announced. */
- t->framing_ok_announced = TRUE;
+ t->framing_ok_announced = true;
to_t38_buffer_init(&s->core.to_t38);
break;
case SIG_STATUS_CARRIER_UP:
t->len = 0;
t->num_bits = 0;
t->flags_seen = 0;
- t->framing_ok_announced = FALSE;
+ t->framing_ok_announced = false;
to_t38_buffer_init(&s->core.to_t38);
break;
case SIG_STATUS_CARRIER_DOWN:
category = (s->t38x.current_tx_data_type == T38_DATA_V21) ? T38_PACKET_CATEGORY_CONTROL_DATA_END : T38_PACKET_CATEGORY_IMAGE_DATA_END;
t38_core_send_data(&s->t38x.t38, s->t38x.current_tx_data_type, T38_FIELD_HDLC_SIG_END, NULL, 0, category);
t38_core_send_indicator(&s->t38x.t38, T38_IND_NO_SIGNAL);
- t->framing_ok_announced = FALSE;
+ t->framing_ok_announced = false;
}
/*endif*/
restart_rx_modem(s);
span_log(&s->logging, SPAN_LOG_FLOW, "HDLC frame type %s, CRC OK\n", t30_frametype(t->buffer[2]));
if (s->t38x.current_tx_data_type == T38_DATA_V21)
{
- monitor_control_messages(s, TRUE, t->buffer, t->len - 2);
+ monitor_control_messages(s, true, t->buffer, t->len - 2);
if (s->core.real_time_frame_handler)
- s->core.real_time_frame_handler(s, s->core.real_time_frame_user_data, TRUE, t->buffer, t->len - 2);
+ s->core.real_time_frame_handler(s, s->core.real_time_frame_user_data, true, t->buffer, t->len - 2);
/*endif*/
}
else
/* Make sure we go back to short training if CTC/CTR has kicked us into
long training. Any successful HDLC frame received at a rate other than
V.21 is an adequate indication we should change. */
- s->core.short_train = TRUE;
+ s->core.short_train = true;
}
/*endif*/
/* It seems some boxes may not like us sending a _SIG_END here, and then another
if (s->t38x.current_tx_data_type == T38_DATA_V21)
{
t38_core_send_indicator(&s->t38x.t38, set_slow_packetisation(s));
- s->audio.modems.rx_signal_present = TRUE;
+ s->audio.modems.rx_signal_present = true;
}
/*endif*/
if (s->t38x.in_progress_rx_indicator == T38_IND_CNG)
set_next_tx_type(s);
/*endif*/
- t->framing_ok_announced = TRUE;
+ t->framing_ok_announced = true;
}
/*endif*/
}
t->num_bits = 0;
u->crc = 0xFFFF;
u->data_ptr = 0;
- s->t38x.corrupt_current_frame[1] = FALSE;
+ s->t38x.corrupt_current_frame[1] = false;
}
/*- End of function --------------------------------------------------------*/
s->core.ecm_mode);
t = &s->audio.modems;
- hdlc_rx_init(&t->hdlc_rx, FALSE, TRUE, HDLC_FRAMING_OK_THRESHOLD, NULL, s);
- t->rx_signal_present = FALSE;
- t->rx_trained = FALSE;
+ hdlc_rx_init(&t->hdlc_rx, false, true, HDLC_FRAMING_OK_THRESHOLD, NULL, s);
+ t->rx_signal_present = false;
+ t->rx_trained = false;
/* Default to the transmit data being V.21, unless a faster modem pops up trained. */
s->t38x.current_tx_data_type = T38_DATA_V21;
//fax_modems_start_slow_modem(t, FAX_MODEM_V21_RX);
/*endif*/
to_t38_buffer_init(&s->core.to_t38);
s->core.to_t38.octets_per_data_packet = 1;
- t->deferred_rx_handler_updates = TRUE;
+ t->deferred_rx_handler_updates = true;
switch (s->core.fast_rx_modem)
{
case FAX_MODEM_V27TER_RX:
case FAX_MODEM_V29_RX:
case FAX_MODEM_V17_RX:
- fax_modems_start_fast_modem(t, s->core.fast_rx_modem, s->core.fast_bit_rate, s->core.short_train, FALSE);
+ fax_modems_start_fast_modem(t, s->core.fast_rx_modem, s->core.fast_bit_rate, s->core.short_train, false);
s->core.fast_rx_active = s->core.fast_rx_modem;
break;
case FAX_MODEM_V21_RX:
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(void) t38_gateway_set_ecm_capability(t38_gateway_state_t *s, int ecm_allowed)
+SPAN_DECLARE(void) t38_gateway_set_ecm_capability(t38_gateway_state_t *s, bool ecm_allowed)
{
s->core.ecm_allowed = ecm_allowed;
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(void) t38_gateway_set_transmit_on_idle(t38_gateway_state_t *s, int transmit_on_idle)
+SPAN_DECLARE(void) t38_gateway_set_transmit_on_idle(t38_gateway_state_t *s, bool transmit_on_idle)
{
s->audio.modems.transmit_on_idle = transmit_on_idle;
}
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(void) t38_gateway_set_tep_mode(t38_gateway_state_t *s, int use_tep)
+SPAN_DECLARE(void) t38_gateway_set_tep_mode(t38_gateway_state_t *s, bool use_tep)
{
fax_modems_set_tep_mode(&s->audio.modems, use_tep);
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(void) t38_gateway_set_fill_bit_removal(t38_gateway_state_t *s, int remove)
+SPAN_DECLARE(void) t38_gateway_set_fill_bit_removal(t38_gateway_state_t *s, bool remove)
{
s->core.to_t38.fill_bit_removal = remove;
}
static int t38_gateway_audio_init(t38_gateway_state_t *s)
{
fax_modems_init(&s->audio.modems,
- FALSE,
+ false,
NULL,
hdlc_underflow_handler,
non_ecm_put_bit,
s);
/* We need to use progressive HDLC transmit, and a special HDLC receiver, which is different
from the other uses of FAX modems. */
- hdlc_tx_init(&s->audio.modems.hdlc_tx, FALSE, 2, TRUE, hdlc_underflow_handler, s);
+ hdlc_tx_init(&s->audio.modems.hdlc_tx, false, 2, true, hdlc_underflow_handler, s);
fsk_rx_set_put_bit(&s->audio.modems.v21_rx, (put_bit_func_t) t38_hdlc_rx_put_bit, &s->audio.modems.hdlc_rx);
/* TODO: Don't use the very low cutoff levels we would like to. We get some quirks if we do.
We need to sort this out. */
t38_gateway_audio_init(s);
t38_gateway_t38_init(s, tx_packet_handler, tx_packet_user_data);
- fax_modems_set_rx_active(&s->audio.modems, TRUE);
+ fax_modems_set_rx_active(&s->audio.modems, true);
t38_gateway_set_supported_modems(s, T30_SUPPORT_V27TER | T30_SUPPORT_V29 | T30_SUPPORT_V17);
t38_gateway_set_nsx_suppression(s, (const uint8_t *) "\x00\x00\x00", 3, (const uint8_t *) "\x00\x00\x00", 3);
s->core.to_t38.octets_per_data_packet = 1;
- s->core.ecm_allowed = TRUE;
+ s->core.ecm_allowed = true;
s->core.ms_per_tx_chunk = DEFAULT_MS_PER_TX_CHUNK;
- t38_non_ecm_buffer_init(&s->core.non_ecm_to_modem, FALSE, 0);
+ t38_non_ecm_buffer_init(&s->core.non_ecm_to_modem, false, 0);
restart_rx_modem(s);
s->core.timed_mode = TIMED_MODE_STARTUP;
s->core.samples_to_timeout = 1;
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include <assert.h>
s->out_ptr = 0;
s->in_ptr = 0;
s->latest_eol_ptr = 0;
- s->data_finished = FALSE;
+ s->data_finished = false;
}
/*- End of function --------------------------------------------------------*/
/* Don't flow control the data any more. Just push out the remainder of the data
in the buffer as fast as we can, and shut down. */
s->latest_eol_ptr = s->in_ptr;
- s->data_finished = TRUE;
+ s->data_finished = true;
}
/*- End of function --------------------------------------------------------*/
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(void) t38_non_ecm_buffer_set_mode(t38_non_ecm_buffer_state_t *s, int mode, int min_bits_per_row)
+SPAN_DECLARE(void) t38_non_ecm_buffer_set_mode(t38_non_ecm_buffer_state_t *s, bool image_mode, int min_bits_per_row)
{
- s->image_data_mode = mode;
+ s->image_data_mode = image_mode;
s->min_bits_per_row = min_bits_per_row;
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(t38_non_ecm_buffer_state_t *) t38_non_ecm_buffer_init(t38_non_ecm_buffer_state_t *s, int mode, int min_bits_per_row)
+SPAN_DECLARE(t38_non_ecm_buffer_state_t *) t38_non_ecm_buffer_init(t38_non_ecm_buffer_state_t *s, bool image_mode, int min_bits_per_row)
{
if (s == NULL)
{
return NULL;
}
memset(s, 0, sizeof(*s));
- s->image_data_mode = mode;
+ s->image_data_mode = image_mode;
s->min_bits_per_row = min_bits_per_row;
restart_buffer(s);
return s;
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include <assert.h>
#include <tiffio.h>
t38_terminal_state_t *s;
s = (t38_terminal_state_t *) user_data;
- s->t38_fe.rx_data_missing = TRUE;
+ s->t38_fe.rx_data_missing = true;
return 0;
}
/*- End of function --------------------------------------------------------*/
&&
(fe->current_rx_type == T30_MODEM_V21 || fe->current_rx_type == T30_MODEM_CNG))
{
- hdlc_accept_frame(s, NULL, SIG_STATUS_CARRIER_DOWN, TRUE);
+ hdlc_accept_frame(s, NULL, SIG_STATUS_CARRIER_DOWN, true);
}
/*endif*/
fe->timeout_rx_samples = 0;
}
/*endswitch*/
fe->hdlc_rx.len = 0;
- fe->rx_data_missing = FALSE;
+ fe->rx_data_missing = false;
return 0;
}
/*- End of function --------------------------------------------------------*/
}
else
{
- fe->rx_data_missing = TRUE;
+ fe->rx_data_missing = true;
}
}
/*- End of function --------------------------------------------------------*/
/* All real HDLC messages in the FAX world start with 0xFF. If this one is not starting
with 0xFF it would appear some octets must have been missed before this one. */
if (len <= 0 || buf[0] != 0xFF)
- fe->rx_data_missing = TRUE;
+ fe->rx_data_missing = true;
/*endif*/
}
/*endif*/
fe->hdlc_rx.len = 0;
}
/*endif*/
- fe->rx_data_missing = FALSE;
+ fe->rx_data_missing = false;
fe->timeout_rx_samples = fe->samples + ms_to_samples(MID_RX_TIMEOUT);
break;
case T38_FIELD_HDLC_FCS_BAD:
if (fe->hdlc_rx.len > 0)
{
span_log(&s->logging, SPAN_LOG_FLOW, "Type %s - CRC bad (%s)\n", (fe->hdlc_rx.len >= 3) ? t30_frametype(fe->hdlc_rx.buf[2]) : "???", (fe->rx_data_missing) ? "missing octets" : "clean");
- hdlc_accept_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, FALSE);
+ hdlc_accept_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, false);
fe->hdlc_rx.len = 0;
}
/*endif*/
- fe->rx_data_missing = FALSE;
+ fe->rx_data_missing = false;
fe->timeout_rx_samples = fe->samples + ms_to_samples(MID_RX_TIMEOUT);
break;
case T38_FIELD_HDLC_FCS_OK_SIG_END:
fe->hdlc_rx.len = 0;
}
/*endif*/
- fe->rx_data_missing = FALSE;
+ fe->rx_data_missing = false;
if (t->current_rx_data_type != data_type || t->current_rx_field_type != field_type)
- hdlc_accept_frame(s, NULL, SIG_STATUS_CARRIER_DOWN, TRUE);
+ hdlc_accept_frame(s, NULL, SIG_STATUS_CARRIER_DOWN, true);
/*endif*/
/* Treat this like a no signal indicator has occurred, so if the no signal indicator is missing, we are still OK */
fake_rx_indicator(t, s, T38_IND_NO_SIGNAL);
if (fe->hdlc_rx.len > 0)
{
span_log(&s->logging, SPAN_LOG_FLOW, "Type %s - CRC bad, sig end (%s)\n", (fe->hdlc_rx.len >= 3) ? t30_frametype(fe->hdlc_rx.buf[2]) : "???", (fe->rx_data_missing) ? "missing octets" : "clean");
- hdlc_accept_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, FALSE);
+ hdlc_accept_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, false);
fe->hdlc_rx.len = 0;
}
/*endif*/
- fe->rx_data_missing = FALSE;
+ fe->rx_data_missing = false;
if (t->current_rx_data_type != data_type || t->current_rx_field_type != field_type)
- hdlc_accept_frame(s, NULL, SIG_STATUS_CARRIER_DOWN, TRUE);
+ hdlc_accept_frame(s, NULL, SIG_STATUS_CARRIER_DOWN, true);
/*endif*/
/* Treat this like a no signal indicator has occurred, so if the no signal indicator is missing, we are still OK */
fake_rx_indicator(t, s, T38_IND_NO_SIGNAL);
i.e. they send T38_FIELD_HDLC_FCS_OK, and then T38_FIELD_HDLC_SIG_END when the carrier actually drops.
The other is because the HDLC signal drops unexpectedly - i.e. not just after a final frame. */
fe->hdlc_rx.len = 0;
- fe->rx_data_missing = FALSE;
+ fe->rx_data_missing = false;
front_end_status(s, T30_FRONT_END_RECEIVE_COMPLETE);
}
/*endif*/
if (!fe->rx_signal_present)
{
t30_non_ecm_put_bit(&s->t30, SIG_STATUS_TRAINING_SUCCEEDED);
- fe->rx_signal_present = TRUE;
+ fe->rx_signal_present = true;
}
/*endif*/
if (len > 0)
if (!fe->rx_signal_present)
{
t30_non_ecm_put_bit(&s->t30, SIG_STATUS_TRAINING_SUCCEEDED);
- fe->rx_signal_present = TRUE;
+ fe->rx_signal_present = true;
}
/*endif*/
bit_reverse(buf2, buf, len);
front_end_status(s, T30_FRONT_END_RECEIVE_COMPLETE);
}
/*endif*/
- fe->rx_signal_present = FALSE;
+ fe->rx_signal_present = false;
/* Treat this like a no signal indicator has occurred, so if the no signal indicator is missing, we are still OK */
fake_rx_indicator(t, s, T38_IND_NO_SIGNAL);
break;
fe = &s->t38_fe;
if (fe->current_rx_type == T30_MODEM_DONE || fe->current_tx_type == T30_MODEM_DONE)
- return TRUE;
+ return true;
/*endif*/
fe->samples += samples;
}
/*endif*/
if (fe->timed_step == T38_TIMED_STEP_NONE)
- return FALSE;
+ return false;
/*endif*/
/* Wait until the right time comes along, unless we are working in "no delays" mode, while talking to an
IAF terminal. */
if (fe->us_per_tx_chunk && fe->samples < fe->next_tx_samples)
- return FALSE;
+ return false;
/*endif*/
/* Its time to send something */
delay = 0;
if (delay < 0)
{
t30_terminate(&s->t30);
- return TRUE;
+ return true;
}
/*endif*/
fe->next_tx_samples += us_to_samples(delay);
- return FALSE;
+ return false;
}
/*- End of function --------------------------------------------------------*/
if ((config & T38_TERMINAL_OPTION_NO_PACING))
{
/* Continuous streaming mode, as used for TPKT over TCP transport */
- t38_set_pace_transmission(&s->t38_fe.t38, FALSE);
+ t38_set_pace_transmission(&s->t38_fe.t38, false);
s->t38_fe.hdlc_tx.extra_bits = 0;
if ((config & T38_TERMINAL_OPTION_NO_INDICATORS))
t38_set_redundancy_control(&s->t38_fe.t38, T38_PACKET_CATEGORY_INDICATOR, 0);
else
{
/* Paced streaming mode, as used for UDP transports */
- t38_set_pace_transmission(&s->t38_fe.t38, TRUE);
+ t38_set_pace_transmission(&s->t38_fe.t38, true);
s->t38_fe.hdlc_tx.extra_bits = 0;
if ((config & T38_TERMINAL_OPTION_NO_INDICATORS))
t38_set_redundancy_control(&s->t38_fe.t38, T38_PACKET_CATEGORY_INDICATOR, 0);
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(void) t38_terminal_set_tep_mode(t38_terminal_state_t *s, int use_tep)
+SPAN_DECLARE(void) t38_terminal_set_tep_mode(t38_terminal_state_t *s, bool use_tep)
{
if (use_tep)
s->t38_fe.chunking_modes |= T38_CHUNKING_ALLOW_TEP_TIME;
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(void) t38_terminal_set_fill_bit_removal(t38_terminal_state_t *s, int remove)
+SPAN_DECLARE(void) t38_terminal_set_fill_bit_removal(t38_terminal_state_t *s, bool remove)
{
if (remove)
s->t38_fe.iaf |= T30_IAF_MODE_NO_FILL_BITS;
s = &t->t38_fe;
t38_core_restart(&s->t38);
- s->rx_signal_present = FALSE;
+ s->rx_signal_present = false;
s->timed_step = T38_TIMED_STEP_NONE;
//s->iaf = T30_IAF_MODE_T37 | T30_IAF_MODE_T38;
s->iaf = T30_IAF_MODE_T38;
tx_packet_user_data);
t38_set_fastest_image_data_rate(&s->t38, 14400);
- s->rx_signal_present = FALSE;
+ s->rx_signal_present = false;
s->timed_step = T38_TIMED_STEP_NONE;
s->queued_timed_step = T38_TIMED_STEP_NONE;
//s->iaf = T30_IAF_MODE_T37 | T30_IAF_MODE_T38;
/*- End of function --------------------------------------------------------*/
SPAN_DECLARE(int) t38_terminal_restart(t38_terminal_state_t *s,
- int calling_party)
+ bool calling_party)
{
t38_terminal_t38_fe_restart(s);
t30_restart(&s->t30);
/*- End of function --------------------------------------------------------*/
SPAN_DECLARE(t38_terminal_state_t *) t38_terminal_init(t38_terminal_state_t *s,
- int calling_party,
+ bool calling_party,
t38_tx_packet_handler_t tx_packet_handler,
void *tx_packet_user_data)
{
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include <tiffio.h>
#include <assert.h>
lab->offset_a = a_P;
lab->offset_b = b_P;
- lab->ab_are_signed = FALSE;
+ lab->ab_are_signed = false;
}
/*- End of function --------------------------------------------------------*/
int ok;
int val[6];
- ok = FALSE;
+ ok = false;
for ( ; ptr; ptr = ptr->next)
{
if (ptr->marker != (JPEG_APP0 + 1))
continue;
if (ptr->data_length < 6)
- return FALSE;
+ return false;
/* Markers are:
JPEG_RST0
JPEG_EOI
JPEG_COM */
data = (const uint8_t *) ptr->data;
if (strncmp((const char *) data, "G3FAX", 5))
- return FALSE;
+ return false;
switch (data[5])
{
case 0:
if (ptr->data_length < 6 + 4)
{
span_log(&s->logging, SPAN_LOG_FLOW, "Got bad G3FAX0 length - %d\n", ptr->data_length);
- return FALSE;
+ return false;
}
val[0] = pack_16(&data[6]);
s->spatial_resolution = pack_16(&data[6 + 2]);
span_log(&s->logging, SPAN_LOG_FLOW, "Version %d, resolution %ddpi\n", val[0], s->spatial_resolution);
- ok = TRUE;
+ ok = true;
break;
case 1:
span_log(&s->logging, SPAN_LOG_FLOW, "Set gamut\n");
if (ptr->data_length < 6 + 12)
{
span_log(&s->logging, SPAN_LOG_FLOW, "Got bad G3FAX1 length - %d\n", ptr->data_length);
- return FALSE;
+ return false;
}
set_gamut_from_code(&s->logging, &s->lab, &data[6]);
break;
if (ptr->data_length < 6 + 4)
{
span_log(&s->logging, SPAN_LOG_FLOW, "Got bad G3FAX2 length - %d\n", ptr->data_length);
- return FALSE;
+ return false;
}
s->illuminant_colour_temperature = set_illuminant_from_code(&s->logging, &s->lab, &data[6]);
break;
default:
span_log(&s->logging, SPAN_LOG_FLOW, "Got unexpected G3FAX%d length - %d\n", data[5], ptr->data_length);
- return FALSE;
+ return false;
}
}
jpeg_set_defaults(&s->compressor);
/* Limit to baseline-JPEG values */
- //jpeg_set_quality(&s->compressor, s->quality, TRUE);
+ //jpeg_set_quality(&s->compressor, s->quality, true);
if (s->no_subsampling)
{
s->compressor.image_width = s->image_width;
s->compressor.image_height = s->image_length;
- jpeg_start_compress(&s->compressor, TRUE);
+ jpeg_start_compress(&s->compressor, true);
set_itu_fax(s);
/* ITU-YCC */
/* Illuminant D65 */
set_lab_illuminant(&s->lab, 95.047f, 100.000f, 108.883f);
- set_lab_gamut(&s->lab, 0, 100, -127, 127, -127, 127, FALSE);
+ set_lab_gamut(&s->lab, 0, 100, -127, 127, -127, 127, false);
}
else
{
/* ITULAB */
/* Illuminant D50 */
set_lab_illuminant(&s->lab, 96.422f, 100.000f, 82.521f);
- set_lab_gamut(&s->lab, 0, 100, -85, 85, -75, 125, FALSE);
+ set_lab_gamut(&s->lab, 0, 100, -85, 85, -75, 125, false);
}
s->compressed_image_size = 0;
s->compressed_image_ptr = 0;
}
/* Take the header */
- jpeg_read_header(&s->decompressor, FALSE);
+ jpeg_read_header(&s->decompressor, false);
/* Sanity check and parameter check */
if (!is_itu_fax(s, s->decompressor.marker_list))
{
/* ITU-YCC */
/* Illuminant D65 */
set_lab_illuminant(&s->lab, 95.047f, 100.000f, 108.883f);
- set_lab_gamut(&s->lab, 0, 100, -127, 127, -127, 127, FALSE);
+ set_lab_gamut(&s->lab, 0, 100, -127, 127, -127, 127, false);
}
else
{
/* ITULAB */
/* Illuminant D50 */
set_lab_illuminant(&s->lab, 96.422f, 100.000f, 82.521f);
- set_lab_gamut(&s->lab, 0, 100, -85, 85, -75, 125, FALSE);
+ set_lab_gamut(&s->lab, 0, 100, -85, 85, -75, 125, false);
}
s->end_of_data = 0;
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include <time.h>
#include "floating_fudge.h"
#include <setjmp.h>
#include "t43_gray_code_tables.h"
#include "t42_t43_local.h"
-#if !defined(FALSE)
-#define FALSE 0
-#endif
-#if !defined(TRUE)
-#define TRUE (!FALSE)
-#endif
-
SPAN_DECLARE(const char *) t43_image_type_to_str(int type)
{
switch (type)
/* ITULAB */
/* Illuminant D50 */
set_lab_illuminant(&s->lab, 96.422f, 100.000f, 82.521f);
- set_lab_gamut(&s->lab, 0, 100, -85, 85, -75, 125, FALSE);
+ set_lab_gamut(&s->lab, 0, 100, -85, 85, -75, 125, false);
s->t85.min_bit_planes = 1;
s->t85.max_bit_planes = 8;
/* ITULAB */
/* Illuminant D50 */
set_lab_illuminant(&s->lab, 96.422f, 100.000f, 82.521f);
- set_lab_gamut(&s->lab, 0, 100, -85, 85, -75, 125, FALSE);
+ set_lab_gamut(&s->lab, 0, 100, -85, 85, -75, 125, false);
s->t85.min_bit_planes = 1;
s->t85.max_bit_planes = 8;
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include <tiffio.h>
SPAN_DECLARE(t4_rx_state_t *) t4_rx_init(t4_rx_state_t *s, const char *file, int supported_output_compressions)
{
- int allocated;
+ bool alloced;
- allocated = FALSE;
+ alloced = false;
if (s == NULL)
{
if ((s = (t4_rx_state_t *) span_alloc(sizeof(*s))) == NULL)
return NULL;
- allocated = TRUE;
+ alloced = true;
}
#if defined(SPANDSP_SUPPORT_TIFF_FX)
TIFF_FX_init();
s->tiff.pages_in_file = 0;
if (open_tiff_output_file(s, file) < 0)
{
- if (allocated)
+ if (alloced)
span_free(s);
return NULL;
}
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include <tiffio.h>
need a minimum of 13 bits in the buffer to proceed with any bit stream
analysis. */
if ((s->rx_bits += quantity) < 13)
- return FALSE;
+ return false;
if (s->consecutive_eols)
{
/* Check if the image has already terminated. */
if (s->consecutive_eols >= EOLS_TO_END_ANY_RX_PAGE)
- return TRUE;
+ return true;
/* Check if the image hasn't even started. */
if (s->consecutive_eols < 0)
{
{
s->rx_bitstream >>= 1;
if (--s->rx_bits < 13)
- return FALSE;
+ return false;
}
/* We have an EOL, so now the page begins and we can proceed to
process the bit stream as image data. */
s->consecutive_eols = 0;
if (s->encoding == T4_COMPRESSION_T4_1D)
{
- s->row_is_2d = FALSE;
+ s->row_is_2d = false;
force_drop_rx_bits(s, 12);
}
else
if (s->consecutive_eols >= EOLS_TO_END_T6_RX_PAGE)
{
s->consecutive_eols = EOLS_TO_END_ANY_RX_PAGE;
- return TRUE;
+ return true;
}
}
else
if (s->consecutive_eols >= EOLS_TO_END_T4_RX_PAGE)
{
s->consecutive_eols = EOLS_TO_END_ANY_RX_PAGE;
- return TRUE;
+ return true;
}
}
}
add_run_to_row(s);
s->consecutive_eols = 0;
if (put_decoded_row(s))
- return TRUE;
+ return true;
}
if (s->encoding == T4_COMPRESSION_T4_2D)
{
{
force_drop_rx_bits(s, 12);
}
- s->in_black = FALSE;
+ s->in_black = false;
s->black_white = 0;
s->run_length = 0;
s->row_len = 0;
s->a0 += t4_1d_black_table[bits].param;
break;
case S_TermB:
- s->in_black = FALSE;
+ s->in_black = false;
if (s->row_len < s->image_width)
{
s->run_length += t4_1d_black_table[bits].param;
s->a0 += t4_1d_white_table[bits].param;
break;
case S_TermW:
- s->in_black = TRUE;
+ s->in_black = true;
if (s->row_len < s->image_width)
{
s->run_length += t4_1d_white_table[bits].param;
if (s->run_length > 0)
add_run_to_row(s);
if (put_decoded_row(s))
- return TRUE;
- s->in_black = FALSE;
+ return true;
+ s->in_black = false;
s->black_white = 0;
s->run_length = 0;
s->row_len = 0;
}
}
}
- return FALSE;
+ return false;
}
/*- End of function --------------------------------------------------------*/
if (bit < 0)
{
t4_t6_decode_rx_status(s, bit);
- return TRUE;
+ return true;
}
s->compressed_image_size++;
if (put_bits(s, bit & 1, 1))
s->pixels = 8;
s->row_len = 0;
- s->in_black = FALSE;
+ s->in_black = false;
s->black_white = 0;
s->b_cursor = 1;
s->a_cursor = 0;
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include <tiffio.h>
else
{
encode_1d_row(s, row_buf);
- s->row_is_2d = TRUE;
+ s->row_is_2d = true;
}
if (s->rows_to_next_1d_row <= 0)
{
/* Insert a row of 1D encoding */
- s->row_is_2d = FALSE;
+ s->row_is_2d = false;
s->rows_to_next_1d_row = s->max_rows_to_next_1d_row - 1;
}
break;
else
{
/* Attach an RTC (return to control == 6 x EOLs) to the end of the page */
- s->row_is_2d = FALSE;
+ s->row_is_2d = false;
for (i = 0; i < EOLS_TO_END_T4_TX_PAGE; i++)
encode_eol(s);
}
}
s->max_rows_to_next_1d_row = max;
s->rows_to_next_1d_row = max - 1;
- s->row_is_2d = FALSE;
+ s->row_is_2d = false;
}
/*- End of function --------------------------------------------------------*/
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include <tiffio.h>
static const TIFFFieldInfo tiff_fx_tiff_field_info[] =
{
- {TIFFTAG_INDEXED, 1, 1, TIFF_SHORT, FIELD_CUSTOM, FALSE, FALSE, (char *) "Indexed"},
- {TIFFTAG_GLOBALPARAMETERSIFD, 1, 1, TIFF_IFD8, FIELD_CUSTOM, FALSE, FALSE, (char *) "GlobalParametersIFD"},
- {TIFFTAG_PROFILETYPE, 1, 1, TIFF_LONG, FIELD_CUSTOM, FALSE, FALSE, (char *) "ProfileType"},
- {TIFFTAG_FAXPROFILE, 1, 1, TIFF_BYTE, FIELD_CUSTOM, FALSE, FALSE, (char *) "FaxProfile"},
- {TIFFTAG_CODINGMETHODS, 1, 1, TIFF_LONG, FIELD_CUSTOM, FALSE, FALSE, (char *) "CodingMethods"},
- {TIFFTAG_VERSIONYEAR, 4, 4, TIFF_BYTE, FIELD_CUSTOM, FALSE, FALSE, (char *) "VersionYear"},
- {TIFFTAG_MODENUMBER, 1, 1, TIFF_BYTE, FIELD_CUSTOM, FALSE, FALSE, (char *) "ModeNumber"},
- {TIFFTAG_DECODE, TIFF_VARIABLE, TIFF_VARIABLE, TIFF_SRATIONAL, FIELD_CUSTOM, FALSE, TRUE, (char *) "Decode"},
- {TIFFTAG_IMAGEBASECOLOR, TIFF_VARIABLE, TIFF_VARIABLE, TIFF_SHORT, FIELD_CUSTOM, FALSE, TRUE, (char *) "ImageBaseColor"},
- {TIFFTAG_T82OPTIONS, 1, 1, TIFF_LONG, FIELD_CUSTOM, FALSE, FALSE, (char *) "T82Options"},
- {TIFFTAG_STRIPROWCOUNTS, TIFF_VARIABLE, TIFF_VARIABLE, TIFF_LONG, FIELD_CUSTOM, FALSE, TRUE, (char *) "StripRowCounts"},
- {TIFFTAG_IMAGELAYER, 2, 2, TIFF_LONG, FIELD_CUSTOM, FALSE, FALSE, (char *) "ImageLayer"},
+ {TIFFTAG_INDEXED, 1, 1, TIFF_SHORT, FIELD_CUSTOM, false, false, (char *) "Indexed"},
+ {TIFFTAG_GLOBALPARAMETERSIFD, 1, 1, TIFF_IFD8, FIELD_CUSTOM, false, false, (char *) "GlobalParametersIFD"},
+ {TIFFTAG_PROFILETYPE, 1, 1, TIFF_LONG, FIELD_CUSTOM, false, false, (char *) "ProfileType"},
+ {TIFFTAG_FAXPROFILE, 1, 1, TIFF_BYTE, FIELD_CUSTOM, false, false, (char *) "FaxProfile"},
+ {TIFFTAG_CODINGMETHODS, 1, 1, TIFF_LONG, FIELD_CUSTOM, false, false, (char *) "CodingMethods"},
+ {TIFFTAG_VERSIONYEAR, 4, 4, TIFF_BYTE, FIELD_CUSTOM, false, false, (char *) "VersionYear"},
+ {TIFFTAG_MODENUMBER, 1, 1, TIFF_BYTE, FIELD_CUSTOM, false, false, (char *) "ModeNumber"},
+ {TIFFTAG_DECODE, TIFF_VARIABLE, TIFF_VARIABLE, TIFF_SRATIONAL, FIELD_CUSTOM, false, true, (char *) "Decode"},
+ {TIFFTAG_IMAGEBASECOLOR, TIFF_VARIABLE, TIFF_VARIABLE, TIFF_SHORT, FIELD_CUSTOM, false, true, (char *) "ImageBaseColor"},
+ {TIFFTAG_T82OPTIONS, 1, 1, TIFF_LONG, FIELD_CUSTOM, false, false, (char *) "T82Options"},
+ {TIFFTAG_STRIPROWCOUNTS, TIFF_VARIABLE, TIFF_VARIABLE, TIFF_LONG, FIELD_CUSTOM, false, true, (char *) "StripRowCounts"},
+ {TIFFTAG_IMAGELAYER, 2, 2, TIFF_LONG, FIELD_CUSTOM, false, false, (char *) "ImageLayer"},
};
#if 1
SPAN_DECLARE(void) TIFF_FX_init(void)
{
- static int first_time = TRUE;
+ static int first_time = true;
if (!first_time)
return;
- first_time = FALSE;
+ first_time = false;
/* Grab the inherited method and install */
_ParentExtender = TIFFSetTagExtender(TIFFFXDefaultDirectory);
/* The default luminant is D50 */
set_lab_illuminant(&s->lab_params, 96.422f, 100.000f, 82.521f);
- set_lab_gamut(&s->lab_params, 0, 100, -85, 85, -75, 125, FALSE);
+ set_lab_gamut(&s->lab_params, 0, 100, -85, 85, -75, 125, false);
t->compression = -1;
TIFFGetField(t->tiff_file, TIFFTAG_COMPRESSION, &t->compression);
case PHOTOMETRIC_CIELAB:
/* The default luminant is D50 */
set_lab_illuminant(&s->lab_params, 96.422f, 100.000f, 82.521f);
- set_lab_gamut(&s->lab_params, 0, 100, -128, 127, -128, 127, TRUE);
- s->apply_lab = TRUE;
+ set_lab_gamut(&s->lab_params, 0, 100, -128, 127, -128, 127, true);
+ s->apply_lab = true;
break;
case PHOTOMETRIC_ITULAB:
/* The default luminant is D50 */
set_lab_illuminant(&s->lab_params, 96.422f, 100.000f, 82.521f);
- set_lab_gamut(&s->lab_params, 0, 100, -85, 85, -75, 125, FALSE);
- s->apply_lab = TRUE;
+ set_lab_gamut(&s->lab_params, 0, 100, -85, 85, -75, 125, false);
+ s->apply_lab = true;
break;
default:
- s->apply_lab = FALSE;
+ s->apply_lab = false;
break;
}
total_len = 0;
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(void) t4_tx_set_header_overlays_image(t4_tx_state_t *s, int header_overlays_image)
+SPAN_DECLARE(void) t4_tx_set_header_overlays_image(t4_tx_state_t *s, bool header_overlays_image)
{
s->header_overlays_image = header_overlays_image;
}
{
int allocated;
- allocated = FALSE;
+ allocated = false;
if (s == NULL)
{
if ((s = (t4_tx_state_t *) span_alloc(sizeof(*s))) == NULL)
return NULL;
- allocated = TRUE;
+ allocated = true;
}
memset(s, 0, sizeof(*s));
#if defined(SPANDSP_SUPPORT_TIFF_FX)
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "spandsp/telephony.h"
#include "spandsp/alloc.h"
compression schemes, such as T.81. However, this code has not been checked
to see if it follows the letter of any spec other than T.82. */
-#define FALSE 0
-#define TRUE (!FALSE)
-
/* Code bytes which must trigger stuffing */
enum
{
s->output_byte_handler = output_byte_handler;
s->user_data = user_data;
- t81_t82_arith_encode_restart(s, FALSE);
+ t81_t82_arith_encode_restart(s, false);
return s;
}
/*- End of function --------------------------------------------------------*/
if (s->nopadding)
{
/* Subsequent symbols might depend on zero padding */
- s->nopadding = FALSE;
+ s->nopadding = false;
return -2;
}
}
if (s->ct >= 0)
s->ct--;
if (s->a == 0x10000)
- s->startup = FALSE;
+ s->startup = false;
}
/* T.82 figure 32 - DECODE */
s->c = 0;
s->a = 1;
s->ct = 0;
- s->startup = TRUE;
- s->nopadding = FALSE;
+ s->startup = true;
+ s->nopadding = false;
return 0;
}
/*- End of function --------------------------------------------------------*/
}
memset(s, 0, sizeof(*s));
- t81_t82_arith_decode_restart(s, FALSE);
+ t81_t82_arith_decode_restart(s, false);
return s;
}
/*- End of function --------------------------------------------------------*/
#include <stdlib.h>
#include <string.h>
#include <time.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "spandsp/telephony.h"
#include "spandsp/alloc.h"
#include "spandsp/private/t81_t82_arith_coding.h"
#include "spandsp/private/t85.h"
-#define FALSE 0
-#define TRUE (!FALSE)
-
static __inline__ int32_t pack_32(uint8_t *s)
{
int32_t value;
s->s.pscd_ptr = data;
s->s.pscd_end = data + len;
- for (s->interrupt = FALSE; s->i < s->l0 && s->y < s->yd && !s->interrupt; s->i++, s->y++)
+ for (s->interrupt = false; s->i < s->l0 && s->y < s->yd && !s->interrupt; s->i++, s->y++)
{
/* Point to the current image bytes */
for (i = 0; i < 3; i++)
}
/* This row is 'not typical' and has to be coded completely */
}
- s->pseudo = FALSE;
+ s->pseudo = false;
if (s->x == 0)
{
*(hp[0] - 1) <<= (s->bytes_per_row*8 - s->xd);
s->interrupt = s->row_write_handler(s->row_write_user_data, &s->row_buf[s->p[0]*s->bytes_per_row], s->bytes_per_row);
s->x = 0;
- s->pseudo = TRUE;
+ s->pseudo = true;
/* Shuffle the row buffers */
s->p[2] = s->p[1];
s->p[1] = s->p[0];
static int finish_sde(t85_decode_state_t *s)
{
/* Decode final pixels based on trailing zero bytes */
- s->s.nopadding = FALSE;
+ s->s.nopadding = false;
if (decode_pscd(s, s->buffer, 2) != 2 && s->interrupt)
return 1;
s->x = 0;
s->i = 0;
- s->pseudo = TRUE;
+ s->pseudo = true;
s->at_moves = 0;
if (s->buffer[1] == T82_SDRST)
{
s->tx = 0;
- s->lntp = TRUE;
+ s->lntp = true;
s->p[0] = 0;
s->p[1] = -1;
s->p[2] = -1;
s->x = 0;
s->y = 0;
s->i = 0;
- s->pseudo = TRUE;
+ s->pseudo = true;
s->at_moves = 0;
s->tx = 0;
- s->lntp = TRUE;
+ s->lntp = true;
s->bytes_per_row = bytes_per_row;
s->p[0] = 0;
s->p[1] = -1;
memset(s->at_row, 0, sizeof(s->at_row));
memset(s->at_tx, 0, sizeof(s->at_tx));
memset(s->row_h, 0, sizeof(s->row_h));
- s->pseudo = FALSE;
- s->lntp = FALSE;
- s->interrupt = FALSE;
+ s->pseudo = false;
+ s->lntp = false;
+ s->interrupt = false;
s->end_of_data = 0;
if (s->comment)
{
s->comment_progress = 0;
s->compressed_image_size = 0;
- t81_t82_arith_decode_restart(&s->s, FALSE);
+ t81_t82_arith_decode_restart(&s->s, false);
s->s.nopadding = s->options & T85_VLENGTH;
s->buf_len = 0;
s->x = 0;
s->y = 0;
s->i = 0;
- s->pseudo = TRUE;
+ s->pseudo = true;
s->at_moves = 0;
s->tx = 0;
- s->lntp = TRUE;
+ s->lntp = true;
s->p[0] = 0;
s->p[1] = -1;
s->p[2] = -1;
memset(s->at_row, 0, sizeof(s->at_row));
memset(s->at_tx, 0, sizeof(s->at_tx));
memset(s->row_h, 0, sizeof(s->row_h));
- s->pseudo = FALSE;
- s->lntp = FALSE;
- s->interrupt = FALSE;
+ s->pseudo = false;
+ s->lntp = false;
+ s->interrupt = false;
s->end_of_data = 0;
if (s->comment)
{
s->comment_progress = 0;
s->compressed_image_size = 0;
- t81_t82_arith_decode_restart(&s->s, FALSE);
+ t81_t82_arith_decode_restart(&s->s, false);
return 0;
}
#include <stdlib.h>
#include <string.h>
#include <time.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "spandsp/telephony.h"
#include "spandsp/alloc.h"
return 0;
/* We can't clip the image to the current length. We will have to
continue up to the original length with blank (all white) rows. */
- s->fill_with_white = TRUE;
+ s->fill_with_white = true;
memset(s->prev_row[0], 0, bytes_per_row);
}
}
for (i = 0; i <= s->mx; i++)
s->c[i] = 0;
}
- t81_t82_arith_encode_restart(&s->s, TRUE);
+ t81_t82_arith_encode_restart(&s->s, true);
}
/* Typical prediction */
- ltp = FALSE;
+ ltp = false;
if ((s->options & T85_TPBON))
{
/* Look for a match between the rows */
s->newlen = NEWLEN_NONE;
s->new_tx = -1;
s->tx = 0;
- s->prev_ltp = FALSE;
+ s->prev_ltp = false;
s->bitstream_iptr = 0;
s->bitstream_optr = 0;
if (s->bitstream)
s->bitstream = NULL;
}
s->bitstream_len = 0;
- s->fill_with_white = FALSE;
+ s->fill_with_white = false;
s->compressed_image_size = 0;
t81_t82_arith_encode_init(&s->s, output_byte, s);
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include "spandsp/telephony.h"
SPAN_DECLARE(time_scale_state_t *) time_scale_init(time_scale_state_t *s, int sample_rate, float playout_rate)
{
- int alloced;
+ bool alloced;
if (sample_rate > TIME_SCALE_MAX_SAMPLE_RATE)
return NULL;
- alloced = FALSE;
+ alloced = false;
if (s == NULL)
{
if ((s = (time_scale_state_t *) span_alloc(sizeof (*s))) == NULL)
return NULL;
/*endif*/
- alloced = TRUE;
+ alloced = true;
}
/*endif*/
s->sample_rate = sample_rate;
#include <string.h>
#include <time.h>
#include <stdlib.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include <assert.h>
#include "spandsp/telephony.h"
#include "spandsp/private/timezone.h"
-#if !defined(FALSE)
-#define FALSE 0
-#endif
-
-#if !defined(TRUE)
-#define TRUE (!FALSE)
-#endif
-
#define SECS_PER_MIN 60
#define MINS_PER_HOUR 60
#define HOURS_PER_DAY 24
}
}
/* Initially we're assumed to be in standard time. */
- isdst = FALSE;
+ isdst = false;
theiroffset = theirstdoffset;
/* Now juggle transition times and types tracking offsets as you do. */
for (i = 0; i < sp->timecnt; i++)
}
/* Finally, fill in ttis. ttisstd and ttisgmt need not be handled. */
sp->ttis[0].gmtoff = -stdoffset;
- sp->ttis[0].isdst = FALSE;
+ sp->ttis[0].isdst = false;
sp->ttis[0].abbrind = 0;
sp->ttis[1].gmtoff = -dstoffset;
- sp->ttis[1].isdst = TRUE;
+ sp->ttis[1].isdst = true;
sp->ttis[1].abbrind = stdlen + 1;
sp->typecnt = 2;
}
lclptr->ttis[0].abbrind = 0;
strcpy(lclptr->chars, gmt);
}
- else if (name[0] == ':' || tzparse(name, lclptr, FALSE) != 0)
+ else if (name[0] == ':' || tzparse(name, lclptr, false) != 0)
{
- tzparse(gmt, lclptr, TRUE);
+ tzparse(gmt, lclptr, true);
}
set_tzname(tz);
}
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include "spandsp/telephony.h"
#include "spandsp/v17rx.h"
#include "spandsp/private/logging.h"
+#include "spandsp/private/power_meter.h"
#include "spandsp/private/v17rx.h"
#if defined(SPANDSP_USE_FIXED_POINTx)
s->signal_present = 60;
equalizer_save(s);
s->carrier_phase_rate_save = s->carrier_phase_rate;
- s->short_train = TRUE;
+ s->short_train = true;
s->training_stage = TRAINING_STAGE_NORMAL_OPERATION;
}
else
}
#if defined(IAXMODEM_STUFF)
/* Carrier has dropped, but the put_bit is pending the signal_present delay. */
- s->carrier_drop_pending = TRUE;
+ s->carrier_drop_pending = true;
#endif
}
}
return 0;
s->signal_present = 1;
#if defined(IAXMODEM_STUFF)
- s->carrier_drop_pending = FALSE;
+ s->carrier_drop_pending = false;
#endif
report_status_change(s, SIG_STATUS_CARRIER_UP);
}
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(int) v17_rx_restart(v17_rx_state_t *s, int bit_rate, int short_train)
+SPAN_DECLARE(int) v17_rx_restart(v17_rx_state_t *s, int bit_rate, bool short_train)
{
int i;
#if defined(IAXMODEM_STUFF)
s->high_sample = 0;
s->low_samples = 0;
- s->carrier_drop_pending = FALSE;
+ s->carrier_drop_pending = false;
#endif
if (short_train != 2)
s->short_train = short_train;
span_log_set_protocol(&s->logging, "V.17 RX");
s->put_bit = put_bit;
s->put_bit_user_data = user_data;
- s->short_train = FALSE;
+ s->short_train = false;
s->scrambler_tap = 18 - 1;
v17_rx_signal_cutoff(s, -45.5f);
s->carrier_phase_rate_save = DDS_PHASE_RATE(CARRIER_NOMINAL_FREQ);
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include "spandsp/telephony.h"
{
/* Training finished - commence normal operation. */
s->current_get_bit = s->get_bit;
- s->in_training = FALSE;
+ s->in_training = false;
}
}
else
if (s->status_handler)
s->status_handler(s->status_user_data, SIG_STATUS_END_OF_DATA);
s->current_get_bit = fake_get_bit;
- s->in_training = TRUE;
+ s->in_training = true;
bit = 1;
}
bits |= (scramble(s, bit) << i);
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(int) v17_tx_restart(v17_tx_state_t *s, int bit_rate, int tep, int short_train)
+SPAN_DECLARE(int) v17_tx_restart(v17_tx_state_t *s, int bit_rate, bool tep, bool short_train)
{
switch (bit_rate)
{
s->rrc_filter_step = 0;
s->convolution = 0;
s->scramble_reg = 0x2ECDD5;
- s->in_training = TRUE;
+ s->in_training = true;
s->short_train = short_train;
s->training_step = (tep) ? V17_TRAINING_SEG_TEP_A : V17_TRAINING_SEG_1;
s->carrier_phase = 0;
}
/*- End of function --------------------------------------------------------*/
-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)
+SPAN_DECLARE(v17_tx_state_t *) v17_tx_init(v17_tx_state_t *s, int bit_rate, bool tep, get_bit_func_t get_bit, void *user_data)
{
switch (bit_rate)
{
s->scrambler_tap = 18 - 1;
s->carrier_phase_rate = dds_phase_ratef(CARRIER_NOMINAL_FREQ);
v17_tx_power(s, -14.0f);
- v17_tx_restart(s, bit_rate, tep, FALSE);
+ v17_tx_restart(s, bit_rate, tep, false);
return s;
}
/*- End of function --------------------------------------------------------*/
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include "spandsp/telephony.h"
#include "spandsp/private/queue.h"
#include "spandsp/private/tone_generate.h"
#include "spandsp/private/async.h"
+#include "spandsp/private/power_meter.h"
#include "spandsp/private/fsk.h"
#include "spandsp/private/dtmf.h"
#include "spandsp/private/modem_connect_tones.h"
s->next_byte = (uint8_t) 0xFF;
return x;
}
- if ((ch = queue_read_byte(&s->queue.queue)) >= 0)
- return ch;
- if (s->tx_signal_on)
+ for (;;)
{
- /* The FSK should now be switched off. */
- s->tx_signal_on = 0;
+ if ((ch = queue_read_byte(&s->queue.queue)) < 0)
+ {
+ if (s->tx_signal_on)
+ {
+ /* The FSK should now be switched off. */
+ s->tx_signal_on = 0;
+ }
+ async_tx_presend_bits(&s->async_tx, 42);
+ return SIG_STATUS_LINK_IDLE;
+ }
+ if ((x = encode_baudot(s, ch)) != 0)
+ break;
+ }
+ s->rx_suppression = (300*SAMPLE_RATE)/1000;
+ if (s->tx_signal_on == 1)
+ {
+ async_tx_presend_bits(&s->async_tx, 7);
+ s->tx_signal_on = 2;
}
- return 0x1F;
+ if ((x & 0x3E0))
+ {
+ s->next_byte = (uint8_t) (x & 0x1F);
+ return (uint8_t) ((x >> 5) & 0x1F);
+ }
+ s->next_byte = (uint8_t) 0xFF;
+ return (uint8_t) (x & 0x1F);
}
/*- End of function --------------------------------------------------------*/
}
return;
}
+ if (s->rx_suppression > 0)
+ return;
span_log(&s->logging, SPAN_LOG_FLOW, "Rx byte %x\n", byte);
if ((octet = decode_baudot(s, byte)) != 0xFF)
+ {
s->rx_msg[s->rx_msg_len++] = octet;
- if (s->rx_msg_len >= 256)
+ span_log(&s->logging, SPAN_LOG_FLOW, "Rx byte 0x%x '%c'\n", octet, octet);
+ }
+ if (s->rx_msg_len > 0) //= 256)
{
s->rx_msg[s->rx_msg_len] = '\0';
if (s->put_msg)
else
s->rx_suppression = 0;
}
- switch (s->mode)
+ if ((s->mode & V18_MODE_DTMF))
{
- case V18_MODE_DTMF:
/* Apply a message timeout. */
- s->in_progress -= len;
- if (s->in_progress <= 0)
- s->rx_msg_len = 0;
+ if (s->in_progress)
+ {
+ s->in_progress -= len;
+ if (s->in_progress <= 0)
+ {
+ s->in_progress = 0;
+ s->rx_msg_len = 0;
+ }
+ }
dtmf_rx(&s->dtmf_rx, amp, len);
- break;
- default:
+ }
+ if ((s->mode & (V18_MODE_5BIT_4545 | V18_MODE_5BIT_476 | V18_MODE_5BIT_50)))
+ {
fsk_rx(&s->fsk_rx, amp, len);
- break;
}
return 0;
}
else
s->rx_suppression = 0;
}
- switch (s->mode)
+ if ((s->mode & V18_MODE_DTMF))
{
- case V18_MODE_DTMF:
/* Apply a message timeout. */
- //s->in_progress -= len;
- //if (s->in_progress <= 0)
- // s->rx_msg_len = 0;
+ if (s->in_progress)
+ {
+ s->in_progress -= len;
+ if (s->in_progress <= 0)
+ {
+ s->in_progress = 0;
+ s->rx_msg_len = 0;
+ }
+ }
dtmf_rx_fillin(&s->dtmf_rx, len);
- break;
- default:
+ }
+ if ((s->mode & (V18_MODE_5BIT_4545 | V18_MODE_5BIT_476 | V18_MODE_5BIT_50)))
+ {
fsk_rx_fillin(&s->fsk_rx, len);
- break;
}
return 0;
}
SPAN_DECLARE(int) v18_put(v18_state_t *s, const char msg[], int len)
{
- char buf[256 + 1];
- int x;
- int n;
int i;
/* This returns the number of characters that would not fit in the buffer.
if ((len = strlen(msg)) == 0)
return 0;
}
- switch (s->mode)
- {
- case V18_MODE_5BIT_4545:
- case V18_MODE_5BIT_50:
- for (i = 0; i < len; i++)
- {
- n = 0;
- if ((x = encode_baudot(s, msg[i])))
- {
- if ((x & 0x3E0))
- buf[n++] = (uint8_t) ((x >> 5) & 0x1F);
- buf[n++] = (uint8_t) (x & 0x1F);
- /* TODO: Deal with out of space condition */
- if (queue_write(&s->queue.queue, (const uint8_t *) buf, n) < 0)
- return i;
- s->tx_signal_on = 1;
- }
- }
- return len;
- case V18_MODE_DTMF:
- break;
- }
- return -1;
+ /* TODO: Deal with out of space condition */
+ if ((i = queue_write(&s->queue.queue, (const uint8_t *) msg, len)) < 0)
+ return i;
+ s->tx_signal_on = 1;
+ return i;
}
/*- End of function --------------------------------------------------------*/
/*- End of function --------------------------------------------------------*/
SPAN_DECLARE(v18_state_t *) v18_init(v18_state_t *s,
- int calling_party,
+ bool calling_party,
int mode,
int nation,
put_msg_func_t put_msg,
case V18_MODE_5BIT_4545:
s->repeat_shifts = mode & V18_MODE_REPETITIVE_SHIFTS_OPTION;
fsk_tx_init(&s->fsk_tx, &preset_fsk_specs[FSK_WEITBRECHT_4545], async_tx_get_bit, &s->async_tx);
- async_tx_init(&s->async_tx, 5, ASYNC_PARITY_NONE, 2, FALSE, v18_tdd_get_async_byte, s);
+ async_tx_init(&s->async_tx, 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
case V18_MODE_5BIT_476:
s->repeat_shifts = mode & V18_MODE_REPETITIVE_SHIFTS_OPTION;
fsk_tx_init(&s->fsk_tx, &preset_fsk_specs[FSK_WEITBRECHT_476], async_tx_get_bit, &s->async_tx);
- async_tx_init(&s->async_tx, 5, ASYNC_PARITY_NONE, 2, FALSE, v18_tdd_get_async_byte, s);
+ async_tx_init(&s->async_tx, 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
case V18_MODE_5BIT_50:
s->repeat_shifts = mode & V18_MODE_REPETITIVE_SHIFTS_OPTION;
fsk_tx_init(&s->fsk_tx, &preset_fsk_specs[FSK_WEITBRECHT_50], async_tx_get_bit, &s->async_tx);
- async_tx_init(&s->async_tx, 5, ASYNC_PARITY_NONE, 2, FALSE, v18_tdd_get_async_byte, s);
+ async_tx_init(&s->async_tx, 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
break;
case V18_MODE_EDT:
fsk_tx_init(&s->fsk_tx, &preset_fsk_specs[FSK_V21CH1_110], async_tx_get_bit, &s->async_tx);
- async_tx_init(&s->async_tx, 7, ASYNC_PARITY_EVEN, 2, FALSE, v18_edt_get_async_byte, s);
+ async_tx_init(&s->async_tx, 7, ASYNC_PARITY_EVEN, 2, false, v18_edt_get_async_byte, s);
fsk_rx_init(&s->fsk_rx, &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->fsk_tx, &preset_fsk_specs[FSK_BELL103CH1], async_tx_get_bit, &s->async_tx);
- async_tx_init(&s->async_tx, 7, ASYNC_PARITY_EVEN, 1, FALSE, v18_edt_get_async_byte, s);
+ async_tx_init(&s->async_tx, 7, ASYNC_PARITY_EVEN, 1, false, v18_edt_get_async_byte, s);
fsk_rx_init(&s->fsk_rx, &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->fsk_tx, &preset_fsk_specs[FSK_V23CH1], async_tx_get_bit, &s->async_tx);
- async_tx_init(&s->async_tx, 7, ASYNC_PARITY_EVEN, 1, FALSE, v18_edt_get_async_byte, s);
+ async_tx_init(&s->async_tx, 7, ASYNC_PARITY_EVEN, 1, false, v18_edt_get_async_byte, s);
fsk_rx_init(&s->fsk_rx, &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->fsk_tx, &preset_fsk_specs[FSK_V21CH1], async_tx_get_bit, &s->async_tx);
- async_tx_init(&s->async_tx, 7, ASYNC_PARITY_EVEN, 1, FALSE, v18_edt_get_async_byte, s);
+ async_tx_init(&s->async_tx, 7, ASYNC_PARITY_EVEN, 1, false, v18_edt_get_async_byte, s);
fsk_rx_init(&s->fsk_rx, &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->fsk_tx, &preset_fsk_specs[FSK_V21CH1], async_tx_get_bit, &s->async_tx);
- async_tx_init(&s->async_tx, 7, ASYNC_PARITY_EVEN, 1, FALSE, v18_edt_get_async_byte, s);
+ async_tx_init(&s->async_tx, 7, ASYNC_PARITY_EVEN, 1, false, v18_edt_get_async_byte, s);
fsk_rx_init(&s->fsk_rx, &preset_fsk_specs[FSK_V21CH1], FSK_FRAME_MODE_7E1_FRAMES, v18_textphone_put_async_byte, s);
break;
}
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include "spandsp/telephony.h"
#include "spandsp/v22bis.h"
#include "spandsp/private/logging.h"
+#include "spandsp/private/power_meter.h"
#include "spandsp/private/v22bis.h"
#if defined(SPANDSP_USE_FIXED_POINT)
if (s->rx.training_count >= ms_to_symbols(100 + 450))
{
span_log(&s->logging, SPAN_LOG_FLOW, "+++ starting 16 way decisions (caller)\n");
- s->rx.sixteen_way_decisions = TRUE;
+ s->rx.sixteen_way_decisions = true;
s->rx.training = V22BIS_RX_TRAINING_STAGE_WAIT_FOR_SCRAMBLED_ONES_AT_2400;
s->rx.pattern_repeats = 0;
#if defined(SPANDSP_USE_FIXED_POINT)
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.sixteen_way_decisions = true;
s->rx.training = V22BIS_RX_TRAINING_STAGE_WAIT_FOR_SCRAMBLED_ONES_AT_2400;
s->rx.pattern_repeats = 0;
}
/* Look for power exceeding the carrier on point */
if (power < s->rx.carrier_on_power)
continue;
- s->rx.signal_present = TRUE;
+ s->rx.signal_present = true;
v22bis_report_status_change(s, SIG_STATUS_CARRIER_UP);
}
/* Only spend effort processing this data if the modem is not parked, after
s->rx.scrambler_pattern_count = 0;
s->rx.training = V22BIS_RX_TRAINING_STAGE_SYMBOL_ACQUISITION;
s->rx.training_count = 0;
- s->rx.signal_present = FALSE;
+ s->rx.signal_present = false;
s->rx.carrier_phase_rate = (s->calling_party) ? DDS_PHASE_RATE(2400.0f) : DDS_PHASE_RATE(1200.0f);
s->rx.carrier_phase = 0;
#endif
s->rx.constellation_state = 0;
- s->rx.sixteen_way_decisions = FALSE;
+ s->rx.sixteen_way_decisions = false;
equalizer_reset(s);
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include "spandsp/telephony.h"
#include "spandsp/v22bis.h"
#include "spandsp/private/logging.h"
+#include "spandsp/private/power_meter.h"
#include "spandsp/private/v22bis.h"
#if defined(SPANDSP_USE_FIXED_POINT)
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(int) v22bis_remote_loopback(v22bis_state_t *s, int enable)
+SPAN_DECLARE(int) v22bis_remote_loopback(v22bis_state_t *s, bool enable)
{
/* TODO: */
return -1;
SPAN_DECLARE(v22bis_state_t *) v22bis_init(v22bis_state_t *s,
int bit_rate,
int guard,
- int calling_party,
+ bool calling_party,
get_bit_func_t get_bit,
void *get_bit_user_data,
put_bit_func_t put_bit,
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include "spandsp/telephony.h"
#include "spandsp/v27ter_rx.h"
#include "spandsp/private/logging.h"
+#include "spandsp/private/power_meter.h"
#include "spandsp/private/v27ter_rx.h"
#if defined(SPANDSP_USE_FIXED_POINT)
{
/* Count down a short delay, to ensure we push the last
few bits through the filters before stopping. */
- v27ter_rx_restart(s, s->bit_rate, FALSE);
+ v27ter_rx_restart(s, s->bit_rate, false);
report_status_change(s, SIG_STATUS_CARRIER_DOWN);
return 0;
}
#if defined(IAXMODEM_STUFF)
/* Carrier has dropped, but the put_bit is pending the signal_present delay. */
- s->carrier_drop_pending = TRUE;
+ s->carrier_drop_pending = true;
#endif
}
}
return 0;
s->signal_present = 1;
#if defined(IAXMODEM_STUFF)
- s->carrier_drop_pending = FALSE;
+ s->carrier_drop_pending = false;
#endif
report_status_change(s, SIG_STATUS_CARRIER_UP);
}
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(int) v27ter_rx_restart(v27ter_rx_state_t *s, int bit_rate, int old_train)
+SPAN_DECLARE(int) v27ter_rx_restart(v27ter_rx_state_t *s, int bit_rate, bool old_train)
{
span_log(&s->logging, SPAN_LOG_FLOW, "Restarting V.27ter\n");
if (bit_rate != 4800 && bit_rate != 2400)
#if defined(IAXMODEM_STUFF)
s->high_sample = 0;
s->low_samples = 0;
- s->carrier_drop_pending = FALSE;
+ s->carrier_drop_pending = false;
#endif
vec_zeroi32(s->diff_angles, 16);
s->put_bit = put_bit;
s->put_bit_user_data = user_data;
- v27ter_rx_restart(s, bit_rate, FALSE);
+ v27ter_rx_restart(s, bit_rate, false);
return s;
}
/*- End of function --------------------------------------------------------*/
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include "spandsp/telephony.h"
if (s->status_handler)
s->status_handler(s->status_user_data, SIG_STATUS_END_OF_DATA);
s->current_get_bit = fake_get_bit;
- s->in_training = TRUE;
+ s->in_training = true;
bit = 1;
}
return scramble(s, bit);
/* Switch from the fake get_bit routine, to the user supplied real
one, and we are up and running. */
s->current_get_bit = s->get_bit;
- s->in_training = FALSE;
+ s->in_training = false;
}
if (s->training_step == V27TER_TRAINING_SHUTDOWN_END)
{
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(int) v27ter_tx_restart(v27ter_tx_state_t *s, int bit_rate, int tep)
+SPAN_DECLARE(int) v27ter_tx_restart(v27ter_tx_state_t *s, int bit_rate, bool tep)
{
if (bit_rate != 4800 && bit_rate != 2400)
return -1;
s->rrc_filter_step = 0;
s->scramble_reg = 0x3C;
s->scrambler_pattern_count = 0;
- s->in_training = TRUE;
+ s->in_training = true;
s->training_step = (tep) ? V27TER_TRAINING_SEG_1 : V27TER_TRAINING_SEG_2;
s->carrier_phase = 0;
s->baud_phase = 0;
}
/*- End of function --------------------------------------------------------*/
-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)
+SPAN_DECLARE(v27ter_tx_state_t *) v27ter_tx_init(v27ter_tx_state_t *s, int bit_rate, bool tep, get_bit_func_t get_bit, void *user_data)
{
switch (bit_rate)
{
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include "spandsp/telephony.h"
#include "spandsp/v29rx.h"
#include "spandsp/private/logging.h"
+#include "spandsp/private/power_meter.h"
#include "spandsp/private/v29rx.h"
#if defined(SPANDSP_USE_FIXED_POINT)
{
/* Count down a short delay, to ensure we push the last
few bits through the filters before stopping. */
- v29_rx_restart(s, s->bit_rate, FALSE);
+ v29_rx_restart(s, s->bit_rate, false);
report_status_change(s, SIG_STATUS_CARRIER_DOWN);
return 0;
}
#if defined(IAXMODEM_STUFF)
/* Carrier has dropped, but the put_bit is pending the
signal_present delay. */
- s->carrier_drop_pending = TRUE;
+ s->carrier_drop_pending = true;
#endif
}
}
return 0;
s->signal_present = 1;
#if defined(IAXMODEM_STUFF)
- s->carrier_drop_pending = FALSE;
+ s->carrier_drop_pending = false;
#endif
report_status_change(s, SIG_STATUS_CARRIER_UP);
}
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(int) v29_rx_restart(v29_rx_state_t *s, int bit_rate, int old_train)
+SPAN_DECLARE(int) v29_rx_restart(v29_rx_state_t *s, int bit_rate, bool old_train)
{
int i;
#if defined(IAXMODEM_STUFF)
s->high_sample = 0;
s->low_samples = 0;
- s->carrier_drop_pending = FALSE;
+ s->carrier_drop_pending = false;
#endif
s->old_train = old_train;
vec_zeroi32(s->diff_angles, 16);
/* The thresholds should be on at -26dBm0 and off at -31dBm0 */
v29_rx_signal_cutoff(s, -28.5f);
- v29_rx_restart(s, bit_rate, FALSE);
+ v29_rx_restart(s, bit_rate, false);
return s;
}
/*- End of function --------------------------------------------------------*/
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include "spandsp/telephony.h"
if (s->status_handler)
s->status_handler(s->status_user_data, SIG_STATUS_END_OF_DATA);
s->current_get_bit = fake_get_bit;
- s->in_training = TRUE;
+ s->in_training = true;
bit = 1;
}
out_bit = (bit ^ (s->scramble_reg >> (18 - 1)) ^ (s->scramble_reg >> (23 - 1))) & 1;
/* Switch from the fake get_bit routine, to the user supplied real
one, and we are up and running. */
s->current_get_bit = s->get_bit;
- s->in_training = FALSE;
+ s->in_training = false;
}
if (s->training_step == V29_TRAINING_SHUTDOWN_END)
{
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(int) v29_tx_restart(v29_tx_state_t *s, int bit_rate, int tep)
+SPAN_DECLARE(int) v29_tx_restart(v29_tx_state_t *s, int bit_rate, bool tep)
{
span_log(&s->logging, SPAN_LOG_FLOW, "Restarting V.29\n");
s->bit_rate = bit_rate;
s->rrc_filter_step = 0;
s->scramble_reg = 0;
s->training_scramble_reg = 0x2A;
- s->in_training = TRUE;
+ s->in_training = true;
s->training_step = (tep) ? V29_TRAINING_SEG_TEP : V29_TRAINING_SEG_1;
s->carrier_phase = 0;
s->baud_phase = 0;
}
/*- End of function --------------------------------------------------------*/
-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)
+SPAN_DECLARE(v29_tx_state_t *) v29_tx_init(v29_tx_state_t *s, int bit_rate, bool tep, get_bit_func_t get_bit, void *user_data)
{
switch (bit_rate)
{
#include <errno.h>
#include <fcntl.h>
#include <ctype.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include <assert.h>
#include "spandsp/telephony.h"
#include "spandsp/private/hdlc.h"
#include "spandsp/private/v42.h"
-#define FALSE 0
-#define TRUE (!FALSE)
-
/* Detection phase timer */
#define T_400 750
/* Acknowledgement timer - 1 second between SABME's */
s = &ss->lapm;
if (s->far_busy || ((s->vs - s->va) & 0x7F) >= s->tx_window_size_k)
- return FALSE;
+ return false;
if (s->info_get != s->info_put)
- return TRUE;
+ return true;
if ((info_put_next = s->info_put + 1) >= V42_INFO_FRAMES)
info_put_next = 0;
if (info_put_next == s->info_get || info_put_next == s->info_acked)
- return FALSE;
+ return false;
f = &s->info_buf[s->info_put];
buf = f->buf;
if (s->iframe_get == NULL)
- return FALSE;
+ return false;
n = s->iframe_get(s->iframe_get_user_data, buf + 3, s->tx_n401);
if (n < 0)
{
/* Error */
report_rx_status_change(ss, SIG_STATUS_LINK_ERROR);
- return FALSE;
+ return false;
}
if (n == 0)
- return FALSE;
+ return false;
f->len = n + 3;
s->info_put = info_put_next;
- return TRUE;
+ return true;
}
/*- End of function --------------------------------------------------------*/
if (!s->rejected)
{
tx_supervisory_frame(s, s->rsp_addr, LAPM_S_REJ, (frame[2] & 0x1));
- s->rejected = TRUE;
+ s->rejected = true;
}
return;
}
- s->rejected = FALSE;
+ s->rejected = false;
s->iframe_put(s->iframe_put_user_data, frame + 3, len - 3);
/* Increment vr */
switch (frame[1] & 0x0C)
{
case LAPM_S_RR:
- s->far_busy = FALSE;
+ s->far_busy = false;
ack_info(ss, frame[2] >> 1);
/* If p = 1 may be used for status checking? */
tx_information_rr_rnr_response(ss, frame, len);
break;
case LAPM_S_RNR:
- s->far_busy = TRUE;
+ s->far_busy = true;
ack_info(ss, frame[2] >> 1);
/* If p = 1 may be used for status checking? */
if ((frame[2] & 0x1))
tx_supervisory_frame(s, s->rsp_addr, (s->local_busy) ? LAPM_S_RNR : LAPM_S_RR, 1);
break;
case LAPM_S_REJ:
- s->far_busy = FALSE;
+ s->far_busy = false;
ack_info(ss, frame[2] >> 1);
if (s->retry_count == 0)
{
switch (frame[1] & 0x0C)
{
case LAPM_S_RR:
- s->far_busy = FALSE;
+ s->far_busy = false;
ack_info(ss, frame[2] >> 1);
if (s->retry_count && (frame[2] & 0x1))
{
}
break;
case LAPM_S_RNR:
- s->far_busy = TRUE;
+ s->far_busy = true;
ack_info(ss, frame[2] >> 1);
if (s->retry_count && (frame[2] & 0x1))
{
t401_start(ss);
break;
case LAPM_S_REJ:
- s->far_busy = FALSE;
+ s->far_busy = false;
ack_info(ss, frame[2] >> 1);
if (s->retry_count == 0 || (frame[2] & 0x1))
{
if (s->configuring)
{
receive_xid(ss, frame, len);
- s->configuring = FALSE;
+ s->configuring = false;
t401_stop(ss);
switch (s->state)
{
lapm_connect(ss);
break;
case LAPM_DATA:
- s->local_busy = FALSE;
+ s->local_busy = false;
tx_supervisory_frame(s, s->cmd_addr, LAPM_S_RR, 0);
break;
}
lapm_state_t *s;
s = &ss->lapm;
- s->configuring = TRUE;
+ s->configuring = true;
if (s->state == LAPM_DATA)
{
- s->local_busy = TRUE;
+ s->local_busy = true;
tx_supervisory_frame(s, s->cmd_addr, LAPM_S_RNR, 1);
}
transmit_xid(ss, s->cmd_addr);
s = &ss->lapm;
/* Reset the LAP.M state */
- s->local_busy = FALSE;
- s->far_busy = FALSE;
+ s->local_busy = false;
+ s->far_busy = false;
s->vs = 0;
s->va = 0;
s->vr = 0;
}
else
{
- s->neg.odp_seen = TRUE;
+ s->neg.odp_seen = true;
}
/*endif*/
break;
SPAN_DECLARE(void) v42_restart(v42_state_t *s)
{
- hdlc_tx_init(&s->lapm.hdlc_tx, FALSE, 1, TRUE, lapm_hdlc_underflow, s);
- hdlc_rx_init(&s->lapm.hdlc_rx, FALSE, FALSE, 1, lapm_receive, s);
+ hdlc_tx_init(&s->lapm.hdlc_tx, false, 1, true, lapm_hdlc_underflow, s);
+ hdlc_rx_init(&s->lapm.hdlc_rx, false, false, 1, lapm_receive, s);
if (s->detect)
{
s->neg.rxoks = 0;
s->neg.txadps = 0;
s->neg.rx_negotiation_step = 0;
- s->neg.odp_seen = FALSE;
+ s->neg.odp_seen = false;
t400_start(s);
s->lapm.state = LAPM_DETECT;
}
/*- End of function --------------------------------------------------------*/
SPAN_DECLARE(v42_state_t *) v42_init(v42_state_t *ss,
- int calling_party,
- int detect,
+ bool calling_party,
+ bool detect,
get_msg_func_t iframe_get,
put_msg_func_t iframe_put,
void *user_data)
s->iframe_put_user_data = user_data;
s->state = (ss->detect) ? LAPM_DETECT : LAPM_IDLE;
- s->local_busy = FALSE;
- s->far_busy = FALSE;
+ s->local_busy = false;
+ s->far_busy = false;
/* The address octet is:
Data link connection identifier (0)
#include <fcntl.h>
#include <ctype.h>
#include <assert.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "spandsp/telephony.h"
#include "spandsp/alloc.h"
s->flushed_length = 0;
s->string_length = 0;
s->escape_code = 0;
- s->transparent = TRUE;
- s->escaped = FALSE;
+ s->transparent = true;
+ s->escaped = false;
s->compression_performance = COMPRESSIBILITY_MONITOR;
}
/*- End of function --------------------------------------------------------*/
push_octet(s, s->escape_code);
push_octet(s, V42BIS_ECM);
s->bit_buffer = 0;
- s->transparent = FALSE;
+ s->transparent = false;
}
/*- End of function --------------------------------------------------------*/
s->last_added = 0;
push_compressed_code(s, V42BIS_ETM);
push_octet_alignment(s);
- s->transparent = TRUE;
+ s->transparent = true;
}
/*- End of function --------------------------------------------------------*/
if (s->escaped)
{
/* Command */
- s->escaped = FALSE;
+ s->escaped = false;
switch (in)
{
case V42BIS_ECM:
/* Enter compressed mode */
span_log(&ss->logging, SPAN_LOG_FLOW, "Hit V42BIS_ECM\n");
send_string(s);
- s->transparent = FALSE;
+ s->transparent = false;
s->update_at = s->last_matched;
s->last_matched = 0;
i++;
}
else if (in == s->escape_code)
{
- s->escaped = TRUE;
+ s->escaped = true;
i++;
continue;
}
- yyy = TRUE;
+ yyy = true;
for (j = 0; j < 2 && yyy; j++)
{
if (s->update_at)
s->last_matched = 0;
}
i++;
- yyy = FALSE;
+ yyy = false;
}
}
}
/* Enter transparent mode */
span_log(&ss->logging, SPAN_LOG_FLOW, "Hit V42BIS_ETM\n");
s->bit_count = 0;
- s->transparent = TRUE;
+ s->transparent = true;
s->last_matched = 0;
s->last_added = 0;
break;
#if defined(HAVE_MATH_H)
#include <math.h>
#endif
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include "spandsp/stdbool.h"
+#endif
#include "floating_fudge.h"
#include "spandsp/telephony.h"
#include "spandsp/v8.h"
#include "spandsp/private/logging.h"
+#include "spandsp/private/power_meter.h"
#include "spandsp/private/fsk.h"
#include "spandsp/private/modem_connect_tones.h"
#include "spandsp/private/v8.h"
return;
}
/* We have a matching pair of CMs or JMs, so we are happy this is correct. */
- s->got_cm_jm = TRUE;
+ s->got_cm_jm = true;
span_log(&s->logging, SPAN_LOG_FLOW, "Decoding\n");
if (data == 0)
{
if (++s->zero_byte_count == 3)
- s->got_cj = TRUE;
+ s->got_cj = true;
}
else
{
s->preamble_type = V8_SYNC_UNKNOWN;
s->bit_stream = 0;
s->cm_jm_len = 0;
- s->got_cm_jm = FALSE;
- s->got_cj = FALSE;
+ s->got_cm_jm = false;
+ s->got_cj = false;
s->zero_byte_count = 0;
s->rx_data_ptr = 0;
}
if (len < max_len)
{
span_log(&s->logging, SPAN_LOG_FLOW, "FSK ends\n");
- s->fsk_tx_on = FALSE;
+ s->fsk_tx_on = false;
}
}
return len;
fsk_tx_restart(&s->v21tx, &preset_fsk_specs[FSK_V21CH1]);
send_ci(s);
s->state = V8_CI_ON;
- s->fsk_tx_on = TRUE;
+ s->fsk_tx_on = true;
break;
case V8_CI_ON:
residual_samples = modem_connect_tones_rx(&s->ansam_rx, amp, len);
fsk_tx_restart(&s->v21tx, &preset_fsk_specs[FSK_V21CH1]);
send_ci(s);
s->state = V8_CI_ON;
- s->fsk_tx_on = TRUE;
+ s->fsk_tx_on = true;
}
}
break;
send_v92(s);
send_cm_jm(s);
s->state = V8_CM_ON;
- s->fsk_tx_on = TRUE;
+ s->fsk_tx_on = true;
}
break;
case V8_CM_ON:
for (i = 0; i < 3; i++)
v8_put_byte(s, 0);
s->state = V8_CJ_ON;
- s->fsk_tx_on = TRUE;
+ s->fsk_tx_on = true;
break;
}
if ((s->negotiation_timer -= len) <= 0)
s->state = V8_JM_ON;
send_cm_jm(s);
s->modem_connect_tone_tx_on = ms_to_samples(75);
- s->fsk_tx_on = TRUE;
+ s->fsk_tx_on = true;
break;
}
if ((s->negotiation_timer -= len) <= 0)
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(int) v8_restart(v8_state_t *s, int calling_party, v8_parms_t *parms)
+SPAN_DECLARE(int) v8_restart(v8_state_t *s, bool calling_party, v8_parms_t *parms)
{
memcpy(&s->parms, parms, sizeof(s->parms));
memset(&s->result, 0, sizeof(s->result));
/*- End of function --------------------------------------------------------*/
SPAN_DECLARE(v8_state_t *) v8_init(v8_state_t *s,
- int calling_party,
+ bool calling_party,
v8_parms_t *parms,
v8_result_handler_t result_handler,
void *user_data)
static int16_t amp[1000000];
-int tx_callback_reported = FALSE;
-int rx_callback_reported = FALSE;
+bool tx_callback_reported = false;
+bool rx_callback_reported = false;
-int sending_complete = FALSE;
+bool sending_complete = false;
SNDFILE *outhandle;
static void talkoff_tx_callback(void *user_data, int tone, int level, int duration)
{
printf("Ademco sender report %d\n", tone);
- tx_callback_reported = TRUE;
+ tx_callback_reported = true;
}
static int mitel_cm7291_side_2_and_bellcore_tests(void)
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Ademco-tx");
- tx_callback_reported = FALSE;
+ tx_callback_reported = false;
/* The remainder of the Mitel tape is the talk-off test */
/* Here we use the Bellcore test tapes (much tougher), in six
printf("Report mismatch\n");
exit(2);
}
- rx_callback_reported = TRUE;
+ rx_callback_reported = true;
}
/*- End of function --------------------------------------------------------*/
if (++reports_entry < 5)
ademco_contactid_sender_put(sender, &reports[reports_entry]);
else
- sending_complete = TRUE;
+ sending_complete = true;
break;
case 0:
/* Sending failed after retries */
- sending_complete = TRUE;
+ sending_complete = true;
break;
}
}
awgn_init_dbm0(&noise_source, 1234567, -50);
munge = codec_munge_init(MUNGE_CODEC_ALAW, 0);
- sending_complete = FALSE;
- rx_callback_reported = FALSE;
+ sending_complete = false;
+ rx_callback_reported = false;
for (i = 0; i < 1000; i++)
{
char *decode_test_file = NULL;
int errors = 0;
-int basic_testing = FALSE;
+bool basic_testing = false;
adsi_rx_state_t *rx_adsi;
adsi_tx_state_t *tx_adsi;
int current_standard = 0;
int good_message_received;
-int log_audio = FALSE;
+bool log_audio = false;
SNDFILE *outhandle = NULL;
-int short_preamble = FALSE;
+bool short_preamble = false;
static int adsi_create_message(adsi_tx_state_t *s, uint8_t *msg)
{
uint8_t body[256];
printf("Good message received (%d bytes)\n", len);
- good_message_received = TRUE;
+ good_message_received = true;
for (i = 0; i < len; i++)
{
printf("%02x ", msg[i]);
int push;
int i;
- basic_testing = TRUE;
+ basic_testing = true;
printf("Testing %s\n", adsi_standard_to_str(standard));
tx_adsi = adsi_tx_init(NULL, standard);
if (short_preamble)
rx_adsi = adsi_rx_init(NULL, standard, put_adsi_msg, NULL);
/* Fake an OK condition for the first message test */
- good_message_received = TRUE;
+ good_message_received = true;
push = 0;
for (i = 0; i < 100000; i++)
{
printf("No message received %s (%d)\n", adsi_standard_to_str(standard), i);
exit(2);
}
- good_message_received = FALSE;
+ good_message_received = false;
adsi_msg_len = adsi_create_message(tx_adsi, adsi_msg);
adsi_msg_len = adsi_tx_put_message(tx_adsi, adsi_msg, adsi_msg_len);
}
}
adsi_rx_free(rx_adsi);
adsi_tx_free(tx_adsi);
- basic_testing = FALSE;
+ basic_testing = false;
}
/*- End of function --------------------------------------------------------*/
int enable_basic_tests;
int enable_talkoff_tests;
- log_audio = FALSE;
+ log_audio = false;
decode_test_file = NULL;
test_standard = -1;
- short_preamble = FALSE;
- enable_basic_tests = TRUE;
- enable_talkoff_tests = FALSE;
+ short_preamble = false;
+ enable_basic_tests = true;
+ enable_talkoff_tests = false;
while ((opt = getopt(argc, argv, "bd:lps:t")) != -1)
{
switch (opt)
{
case 'b':
- enable_basic_tests = TRUE;
- enable_talkoff_tests = FALSE;
+ enable_basic_tests = true;
+ enable_talkoff_tests = false;
break;
case 'd':
decode_test_file = optarg;
break;
case 'l':
- log_audio = TRUE;
+ log_audio = true;
break;
case 'p':
- short_preamble = TRUE;
+ short_preamble = true;
break;
case 's':
if (strcasecmp("CLASS", optarg) == 0)
test_standard = atoi(optarg);
break;
case 't':
- enable_basic_tests = FALSE;
- enable_talkoff_tests = TRUE;
+ enable_basic_tests = false;
+ enable_talkoff_tests = true;
break;
default:
//usage();
void *b;
void *c;
- if (span_mem_allocators(malloc,
- memalign,
+ if (span_mem_allocators(memalign,
+ malloc,
realloc,
free))
{
printf("Failed\n");
exit(2);
}
- a = span_alloc(42);
- b = span_aligned_alloc(8, 42);
+ a = span_aligned_alloc(8, 42);
+ b = span_alloc(42);
c = span_realloc(NULL, 42);
printf("%p %p %p\n", a, b, c);
span_free(a);
int bit;
printf("Test with async 8N1\n");
- async_tx_init(&tx_async, 8, ASYNC_PARITY_NONE, 1, FALSE, test_get_async_byte, NULL);
- async_rx_init(&rx_async, 8, ASYNC_PARITY_NONE, 1, FALSE, test_put_async_byte, NULL);
+ async_tx_init(&tx_async, 8, ASYNC_PARITY_NONE, 1, false, test_get_async_byte, NULL);
+ async_rx_init(&rx_async, 8, ASYNC_PARITY_NONE, 1, false, test_put_async_byte, NULL);
tx_async_chars = 0;
rx_async_chars = 0;
rx_async_char_mask = 0xFF;
}
printf("Test with async 7E1\n");
- async_tx_init(&tx_async, 7, ASYNC_PARITY_EVEN, 1, FALSE, test_get_async_byte, NULL);
- async_rx_init(&rx_async, 7, ASYNC_PARITY_EVEN, 1, FALSE, test_put_async_byte, NULL);
+ async_tx_init(&tx_async, 7, ASYNC_PARITY_EVEN, 1, false, test_get_async_byte, NULL);
+ async_rx_init(&rx_async, 7, ASYNC_PARITY_EVEN, 1, false, test_put_async_byte, NULL);
tx_async_chars = 0;
rx_async_chars = 0;
rx_async_char_mask = 0x7F;
}
printf("Test with async 8O1\n");
- async_tx_init(&tx_async, 8, ASYNC_PARITY_ODD, 1, FALSE, test_get_async_byte, NULL);
- async_rx_init(&rx_async, 8, ASYNC_PARITY_ODD, 1, FALSE, test_put_async_byte, NULL);
+ async_tx_init(&tx_async, 8, ASYNC_PARITY_ODD, 1, false, test_get_async_byte, NULL);
+ async_rx_init(&rx_async, 8, ASYNC_PARITY_ODD, 1, false, test_put_async_byte, NULL);
tx_async_chars = 0;
rx_async_chars = 0;
rx_async_char_mask = 0xFF;
}
printf("Test with async 8O1 and V.14\n");
- async_tx_init(&tx_async, 8, ASYNC_PARITY_ODD, 1, TRUE, test_get_async_byte, NULL);
- async_rx_init(&rx_async, 8, ASYNC_PARITY_ODD, 1, TRUE, test_put_async_byte, NULL);
+ async_tx_init(&tx_async, 8, ASYNC_PARITY_ODD, 1, true, test_get_async_byte, NULL);
+ async_rx_init(&rx_async, 8, ASYNC_PARITY_ODD, 1, true, test_put_async_byte, NULL);
tx_async_chars = 0;
rx_async_chars = 0;
rx_async_char_mask = 0xFF;
}
printf("Test with async 5N2\n");
- async_tx_init(&tx_async, 5, ASYNC_PARITY_NONE, 2, FALSE, test_get_async_byte, NULL);
- async_rx_init(&rx_async, 5, ASYNC_PARITY_NONE, 2, FALSE, test_put_async_byte, NULL);
+ async_tx_init(&tx_async, 5, ASYNC_PARITY_NONE, 2, false, test_get_async_byte, NULL);
+ async_rx_init(&rx_async, 5, ASYNC_PARITY_NONE, 2, false, test_put_async_byte, NULL);
tx_async_chars = 0;
rx_async_chars = 0;
rx_async_char_mask = 0x1F;
static char bell_mf_tone_codes[] = "1234567890CA*B#";
-int callback_ok;
+bool callback_ok;
int callback_roll;
static void my_mf_gen_init(float low_fudge,
gap,
0,
0,
- FALSE);
+ false);
}
}
/*- End of function --------------------------------------------------------*/
if (data != (void *) 0x12345678)
{
- callback_ok = FALSE;
+ callback_ok = false;
return;
}
- callback_ok = TRUE;
+ callback_ok = true;
t = s + callback_roll;
seg = 15 - callback_roll;
for (i = 0; i < len; i += seg, seg = 15)
seg = len - i;
if (memcmp(digits + i, t, seg))
{
- callback_ok = FALSE;
+ callback_ok = false;
printf("Fail at %d %d\n", i, seg);
break;
}
/* Test the callback mode for delivering detected digits */
printf("Test: Callback digit delivery mode.\n");
- callback_ok = FALSE;
+ callback_ok = false;
callback_roll = 0;
mf_state = bell_mf_rx_init(NULL, digit_delivery, (void *) 0x12345678);
my_mf_gen_init(0.0, -10, 0.0, -10, 68, 68);
bert_put_bit(rx_bert, bit);
test[tx_bert->tx.reg]++;
}
- failed = FALSE;
+ failed = false;
if (test[0] != 0)
{
printf("XXX %d %d\n", 0, test[0]);
- failed = TRUE;
+ failed = true;
}
for (i = 1; i < 0x200; i++)
{
if (test[i] != 2)
{
printf("XXX %d %d\n", i, test[i]);
- failed = TRUE;
+ failed = true;
}
}
bert_result(rx_bert, &bert_results);
bert_put_bit(rx_bert, bit);
test[tx_bert->tx.reg]++;
}
- failed = FALSE;
+ failed = false;
if (test[0] != 0)
{
printf("XXX %d %d\n", 0, test[0]);
- failed = TRUE;
+ failed = true;
}
for (i = 1; i < 0x800; i++)
{
if (test[i] != 2)
{
printf("XXX %d %d\n", i, test[i]);
- failed = TRUE;
+ failed = true;
}
}
bert_result(rx_bert, &bert_results);
bert_put_bit(rx_bert, bit);
test[tx_bert->tx.reg]++;
}
- failed = FALSE;
+ failed = false;
if (test[0] != 0)
{
printf("XXX %d %d\n", 0, test[0]);
- failed = TRUE;
+ failed = true;
}
for (i = 1; i < 0x8000; i++)
{
if (test[i] != 2)
{
printf("XXX %d %d\n", i, test[i]);
- failed = TRUE;
+ failed = true;
}
}
bert_result(rx_bert, &bert_results);
bert_put_bit(rx_bert, bit);
test[tx_bert->tx.reg]++;
}
- failed = FALSE;
+ failed = false;
if (test[0] != 0)
{
printf("XXX %d %d\n", 0, test[0]);
- failed = TRUE;
+ failed = true;
}
for (i = 1; i < 0x100000; i++)
{
bert_put_bit(rx_bert, bit);
test[tx_bert->tx.reg]++;
}
- failed = FALSE;
+ failed = false;
if (test[0] != 0)
{
printf("XXX %d %d\n", 0, test[0]);
- failed = TRUE;
+ failed = true;
}
for (i = 1; i < 0x800000; i++)
{
unsigned int x;
int total_bits;
- s = bitstream_init(&state, TRUE);
+ s = bitstream_init(&state, true);
w = buffer;
total_bits = 0;
for (i = 0; i < SEQUENCE_LENGTH; i++)
exit(2);
}
- s = bitstream_init(&state, TRUE);
+ s = bitstream_init(&state, true);
r = buffer;
for (i = 0; i < SEQUENCE_LENGTH; i++)
{
}
}
- s = bitstream_init(&state, FALSE);
+ s = bitstream_init(&state, false);
w = buffer;
total_bits = 0;
for (i = 0; i < SEQUENCE_LENGTH; i++)
exit(2);
}
- s = bitstream_init(&state, FALSE);
+ s = bitstream_init(&state, false);
r = buffer;
for (i = 0; i < SEQUENCE_LENGTH; i++)
{
char dtmf_positions[] = "123A" "456B" "789C" "*0#D";
-int callback_hit;
-int callback_ok;
+bool callback_hit;
+bool callback_ok;
int callback_roll;
int step;
float max_forward_twist;
float max_reverse_twist;
-int use_dialtone_filter = FALSE;
+bool use_dialtone_filter = false;
char *decode_test_file = NULL;
gap,
0,
0,
- FALSE);
+ false);
}
}
}
const char *s = ALL_POSSIBLE_DIGITS;
const char *t;
- callback_hit = TRUE;
+ callback_hit = true;
if (data == (void *) 0x12345678)
{
t = s + callback_roll;
seg = len - i;
if (memcmp(digits + i, t, seg))
{
- callback_ok = FALSE;
+ callback_ok = false;
printf("Fail at %d %d\n", i, seg);
break;
}
}
else
{
- callback_ok = FALSE;
+ callback_ok = false;
}
}
/*- End of function --------------------------------------------------------*/
const char *s = ALL_POSSIBLE_DIGITS;
int len;
static int last_step = 0;
- static int first = TRUE;
+ static int first = true;
//printf("Digit status %d %d %d\n", signal, level, delay);
- callback_hit = TRUE;
+ callback_hit = true;
len = step - last_step;
if (data == (void *) 0x12345678)
{
if (first)
{
/* At the beginning the apparent duration is expected to be wrong */
- first = FALSE;
+ first = false;
}
else
{
printf("Failed for signal %s length %d at %d\n", (callback_roll & 1) ? "on" : "off", len, step);
- callback_ok = FALSE;
+ callback_ok = false;
}
}
if (callback_roll & 1)
if (signal != 0)
{
printf("Failed for signal 0x%X instead of 0\n", signal);
- callback_ok = FALSE;
+ callback_ok = false;
}
}
else
if (signal != s[callback_roll >> 1])
{
printf("Failed for signal 0x%X instead of 0x%X\n", signal, s[callback_roll >> 1]);
- callback_ok = FALSE;
+ callback_ok = false;
}
if (level < DEFAULT_DTMF_TX_LEVEL + 3 - 1 || level > DEFAULT_DTMF_TX_LEVEL + 3 + 1)
{
printf("Failed for level %d instead of %d\n", level, DEFAULT_DTMF_TX_LEVEL + 3);
- callback_ok = FALSE;
+ callback_ok = false;
}
}
if (++callback_roll >= 32)
}
else
{
- callback_ok = FALSE;
+ callback_ok = false;
}
last_step = step;
}
for (j = -30; j < -3; j++)
{
- tone_gen_descriptor_init(&dial_tone_desc, 350, j, 440, j, 1, 0, 0, 0, TRUE);
+ tone_gen_descriptor_init(&dial_tone_desc, 350, j, 440, j, 1, 0, 0, 0, true);
tone_gen_init(&dial_tone, &dial_tone_desc);
for (i = 0; i < 10; i++)
{
/* Test the callback mode for delivering detected digits */
printf("Test: Callback digit delivery mode.\n");
- callback_hit = FALSE;
- callback_ok = TRUE;
+ callback_hit = false;
+ callback_ok = true;
callback_roll = 0;
dtmf_state = dtmf_rx_init(NULL, digit_delivery, (void *) 0x12345678);
if (use_dialtone_filter || max_forward_twist >= 0.0f || max_reverse_twist >= 0.0f)
/* Test the realtime callback mode for reporting detected digits */
printf("Test: Realtime callback digit delivery mode.\n");
- callback_hit = FALSE;
- callback_ok = TRUE;
+ callback_hit = false;
+ callback_ok = true;
callback_roll = 0;
dtmf_rx_init(dtmf_state, NULL, NULL);
dtmf_rx_set_realtime_callback(dtmf_state, digit_status, (void *) 0x12345678);
int channel_codec;
int opt;
- use_dialtone_filter = FALSE;
+ use_dialtone_filter = false;
channel_codec = MUNGE_CODEC_NONE;
decode_test_file = NULL;
max_forward_twist = -1.0f;
max_forward_twist = atof(optarg);
break;
case 'f':
- use_dialtone_filter = TRUE;
+ use_dialtone_filter = true;
break;
case 'R':
max_reverse_twist = atof(optarg);
exit(2);
}
- add_digits = TRUE;
+ add_digits = true;
do
{
len = dtmf_tx(gen, amp, 160);
if (dtmf_tx_put(gen, "1234567890", -1))
{
printf("Digit buffer full\n");
- add_digits = FALSE;
+ add_digits = false;
}
}
}
static void print_test_title(const char *title)
{
- if (quiet == FALSE)
+ if (quiet == false)
printf(title);
}
/*- End of function --------------------------------------------------------*/
int i;
time_t now;
int simulate;
- int cng;
- int hpf;
- int two_channel_file;
int opt;
int mode;
+ bool cng;
+ bool hpf;
+ bool two_channel_file;
/* Check which tests we should run */
if (argc < 2)
fprintf(stderr, "Usage: echo tests [-g] [-m <model number>] [-s] <list of test numbers>\n");
line_model_no = 0;
supp_line_model_no = 0;
- cng = FALSE;
- hpf = FALSE;
- use_gui = FALSE;
- simulate = FALSE;
+ cng = false;
+ hpf = false;
+ use_gui = false;
+ simulate = false;
munger = -1;
- two_channel_file = FALSE;
+ two_channel_file = false;
erl = -12.0f;
while ((opt = getopt(argc, argv, "2ace:ghm:M:su")) != -1)
switch (opt)
{
case '2':
- two_channel_file = TRUE;
+ two_channel_file = true;
break;
case 'a':
munger = G711_ALAW;
break;
case 'c':
- cng = TRUE;
+ cng = true;
break;
case 'e':
/* Allow for ERL being entered as x or -x */
break;
case 'g':
#if defined(ENABLE_GUI)
- use_gui = TRUE;
+ use_gui = true;
#else
fprintf(stderr, "Graphical monitoring not available\n");
exit(2);
#endif
break;
case 'h':
- hpf = TRUE;
+ hpf = true;
break;
case 'm':
line_model_no = atoi(optarg);
supp_line_model_no = atoi(optarg);
break;
case 's':
- simulate = TRUE;
+ simulate = true;
break;
case 'u':
munger = G711_ULAW;
{ 0, 0, 0, 0}
};
-int decode_test = FALSE;
+bool decode_test = false;
int rx_bits = 0;
t30_state_t t30_dummy;
t4_rx_state_t t4_rx_state;
-int t4_up = FALSE;
+bool t4_up = false;
hdlc_rx_state_t hdlcrx;
int y_resolution = T4_Y_RESOLUTION_STANDARD;
int image_width = 1728;
int octets_per_ecm_frame = 256;
-int error_correcting_mode = FALSE;
+bool error_correcting_mode = false;
int current_fallback = 0;
-int end_of_page_detected = FALSE;
+bool end_of_page_detected = false;
static void decode_20digit_msg(const uint8_t *pkt, int len)
{
t4_rx_set_image_width(&t4_rx_state, image_width);
t4_rx_start_page(&t4_rx_state);
- t4_up = TRUE;
- end_of_page_detected = FALSE;
+ t4_up = true;
+ end_of_page_detected = false;
for (i = 0; i < 256; i++)
ecm_len[i] = -1;
fprintf(stderr, "Image resolution = %dx%d\n", stats.x_resolution, stats.y_resolution);
fprintf(stderr, "Bad rows = %d\n", stats.bad_rows);
fprintf(stderr, "Longest bad row run = %d\n", stats.longest_bad_row_run);
- t4_up = FALSE;
+ t4_up = false;
}
/*- End of function --------------------------------------------------------*/
t4_end();
if (!end_of_page_detected)
fprintf(stderr, "End of page detected\n");
- end_of_page_detected = TRUE;
+ end_of_page_detected = true;
}
}
//printf("V.17 Rx bit %d - %d\n", rx_bits++, bit);
t4_end();
if (!end_of_page_detected)
fprintf(stderr, "End of page detected\n");
- end_of_page_detected = TRUE;
+ end_of_page_detected = true;
}
}
//printf("V.29 Rx bit %d - %d\n", rx_bits++, bit);
t4_end();
if (!end_of_page_detected)
fprintf(stderr, "End of page detected\n");
- end_of_page_detected = TRUE;
+ end_of_page_detected = true;
}
}
//printf("V.27ter Rx bit %d - %d\n", rx_bits++, bit);
span_log_init(&t30_dummy.logging, SPAN_LOG_FLOW, NULL);
span_log_set_protocol(&t30_dummy.logging, "T.30");
- hdlc_rx_init(&hdlcrx, FALSE, TRUE, 5, hdlc_accept, NULL);
+ hdlc_rx_init(&hdlcrx, false, true, 5, hdlc_accept, NULL);
fsk = fsk_rx_init(NULL, &preset_fsk_specs[FSK_V21CH2], FSK_FRAME_MODE_SYNC, v21_put_bit, NULL);
v17 = v17_rx_init(NULL, 14400, v17_put_bit, NULL);
v29 = v29_rx_init(NULL, 9600, v29_put_bit, NULL);
switch (status)
{
case SIG_STATUS_TRAINING_FAILED:
- s->modems.rx_trained = FALSE;
+ s->modems.rx_trained = false;
break;
case SIG_STATUS_TRAINING_SUCCEEDED:
/* The modem is now trained */
- s->modems.rx_trained = TRUE;
+ s->modems.rx_trained = true;
break;
case SIG_STATUS_CARRIER_UP:
- s->modems.rx_signal_present = TRUE;
+ s->modems.rx_signal_present = true;
break;
case SIG_STATUS_CARRIER_DOWN:
if (s->modems.rx_trained)
{
if (s->real_time_frame_handler)
- s->real_time_frame_handler(s, s->real_time_frame_user_data, TRUE, NULL, 0);
+ s->real_time_frame_handler(s, s->real_time_frame_user_data, true, NULL, 0);
}
- s->modems.rx_signal_present = FALSE;
- s->modems.rx_trained = FALSE;
+ s->modems.rx_signal_present = false;
+ s->modems.rx_trained = false;
break;
}
}
switch (status)
{
case SIG_STATUS_TRAINING_FAILED:
- s->modems.rx_trained = FALSE;
+ s->modems.rx_trained = false;
break;
case SIG_STATUS_TRAINING_SUCCEEDED:
/* The modem is now trained */
- s->modems.rx_trained = TRUE;
+ s->modems.rx_trained = true;
break;
case SIG_STATUS_CARRIER_UP:
- s->modems.rx_signal_present = TRUE;
+ s->modems.rx_signal_present = true;
break;
case SIG_STATUS_CARRIER_DOWN:
- s->modems.rx_signal_present = FALSE;
- s->modems.rx_trained = FALSE;
+ s->modems.rx_signal_present = false;
+ s->modems.rx_trained = false;
break;
}
}
}
s = (faxtester_state_t *) user_data;
if (s->real_time_frame_handler)
- s->real_time_frame_handler(s, s->real_time_frame_user_data, TRUE, msg, len);
+ s->real_time_frame_handler(s, s->real_time_frame_user_data, true, msg, len);
}
/*- End of function --------------------------------------------------------*/
{
if (!s->modems.rx_signal_present)
{
- s->wait_for_silence = FALSE;
+ s->wait_for_silence = false;
front_end_step_complete(s);
}
}
void faxtest_set_rx_silence(faxtester_state_t *s)
{
- s->wait_for_silence = TRUE;
+ s->wait_for_silence = true;
}
/*- End of function --------------------------------------------------------*/
return;
s->current_rx_type = type;
if (use_hdlc)
- hdlc_rx_init(&t->hdlc_rx, FALSE, FALSE, HDLC_FRAMING_OK_THRESHOLD, hdlc_accept, s);
+ hdlc_rx_init(&t->hdlc_rx, false, false, HDLC_FRAMING_OK_THRESHOLD, hdlc_accept, s);
switch (type)
{
case T30_MODEM_CED:
case T30_MODEM_PAUSE:
silence_gen_alter(&t->silence_gen, ms_to_samples(short_train));
fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
- s->transmit = TRUE;
+ s->transmit = true;
break;
case T30_MODEM_CED:
case T30_MODEM_CNG:
tone = (type == T30_MODEM_CED) ? MODEM_CONNECT_TONES_FAX_CED : MODEM_CONNECT_TONES_FAX_CNG;
fax_modems_start_slow_modem(t, tone);
- s->transmit = TRUE;
+ s->transmit = true;
break;
case T30_MODEM_V21:
fax_modems_start_slow_modem(t, FAX_MODEM_V21_TX);
fsk_tx_set_modem_status_handler(&t->v21_tx, modem_tx_status, (void *) s);
- s->transmit = TRUE;
+ s->transmit = true;
break;
case T30_MODEM_V27TER:
fax_modems_set_get_bit(t, get_bit_func, get_bit_user_data);
v27ter_tx_set_modem_status_handler(&t->fast_modems.v27ter_tx, modem_tx_status, (void *) s);
/* For any fast modem, set 200ms of preamble flags */
hdlc_tx_flags(&t->hdlc_tx, bit_rate/(8*5));
- s->transmit = TRUE;
+ s->transmit = true;
break;
case T30_MODEM_V29:
fax_modems_set_get_bit(t, get_bit_func, get_bit_user_data);
v29_tx_set_modem_status_handler(&t->fast_modems.v29_tx, modem_tx_status, (void *) s);
/* For any fast modem, set 200ms of preamble flags */
hdlc_tx_flags(&t->hdlc_tx, bit_rate/(8*5));
- s->transmit = TRUE;
+ s->transmit = true;
break;
case T30_MODEM_V17:
fax_modems_set_get_bit(t, get_bit_func, get_bit_user_data);
v17_tx_set_modem_status_handler(&t->fast_modems.v17_tx, modem_tx_status, (void *) s);
/* For any fast modem, set 200ms of preamble flags */
hdlc_tx_flags(&t->hdlc_tx, bit_rate/(8*5));
- s->transmit = TRUE;
+ s->transmit = true;
break;
case T30_MODEM_DONE:
span_log(&s->logging, SPAN_LOG_FLOW, "FAX exchange complete\n");
default:
silence_gen_alter(&t->silence_gen, 0);
fax_modems_set_tx_handler(t, (span_tx_handler_t) &silence_gen, &t->silence_gen);
- s->transmit = FALSE;
+ s->transmit = false;
break;
}
s->current_tx_type = type;
span_log_init(&s->logging, SPAN_LOG_NONE, NULL);
span_log_set_protocol(&s->logging, "TST");
fax_modems_init(&s->modems,
- FALSE,
+ false,
NULL,
hdlc_underflow_handler,
non_ecm_put_bit,
t38_non_ecm_buffer_get_bit,
tone_detected,
s);
- fax_modems_set_tep_mode(&s->modems, FALSE);
- fax_modems_set_rx_active(&s->modems, TRUE);
+ fax_modems_set_tep_mode(&s->modems, false);
+ fax_modems_set_rx_active(&s->modems, true);
faxtester_set_timeout(s, -1);
- faxtester_set_tx_type(s, T30_MODEM_NONE, 0, FALSE, FALSE);
+ faxtester_set_tx_type(s, T30_MODEM_NONE, 0, false, false);
return s;
}
\brief FAX tester real time frame handler.
\param s The FAX tester context.
\param user_data An opaque pointer.
- \param direction TRUE for incoming, FALSE for outgoing.
+ \param direction True for incoming, false for outgoing.
\param msg The HDLC message.
\param len The length of the message.
*/
/*! \brief CED or CNG detector */
modem_connect_tones_rx_state_t connect_rx;
- /*! If TRUE, transmission is in progress */
- int transmit;
+ /*! If true, transmission is in progress */
+ bool transmit;
- /*! \brief TRUE is the short training sequence should be used. */
- int short_train;
+ /*! \brief true if the short training sequence should be used. */
+ bool short_train;
/*! \brief The currently select receiver type */
int current_rx_type;
/*! Select whether silent audio will be sent when FAX transmit is idle.
\brief Select whether silent audio will be sent when FAX transmit is idle.
\param s The FAX tester context.
- \param transmit_on_idle TRUE if silent audio should be output when the FAX transmitter is
+ \param transmit_on_idle true if silent audio should be output when the FAX transmitter is
idle. FALSE to transmit zero length audio when the FAX transmitter is idle. The default
behaviour is FALSE.
*/
/*! Select whether talker echo protection tone will be sent for the image modems.
\brief Select whether TEP will be sent for the image modems.
\param s The FAX tester context.
- \param use_tep TRUE if TEP should be sent.
+ \param use_tep true if TEP should be sent.
*/
void faxtester_set_tep_mode(faxtester_state_t *s, int use_tep);
/*! Initialise a FAX context.
\brief Initialise a FAX context.
\param s The FAX tester context.
- \param calling_party TRUE if the context is for a calling party. FALSE if the
+ \param calling_party true if the context is for a calling party. FALSE if the
context is for an answering party.
\return A pointer to the FAX context, or NULL if there was a problem.
*/
t30_exchanged_info_t expected_rx_info[2];
-int use_receiver_not_ready = FALSE;
-int test_local_interrupt = FALSE;
+bool use_receiver_not_ready = false;
+bool test_local_interrupt = false;
double when = 0.0;
-int phase_e_reached[2] = {FALSE, FALSE};
-int completed[2] = {FALSE, FALSE};
-int succeeded[2] = {FALSE, FALSE};
+bool phase_e_reached[2] = {false, false};
+bool completed[2] = {false, false};
+bool succeeded[2] = {false, false};
-int t38_simulate_incrementing_repeats = FALSE;
+bool t38_simulate_incrementing_repeats = false;
static int phase_b_handler(t30_state_t *s, void *user_data, int result)
{
if (i == 'A')
{
printf("%c: Initiating interrupt request\n", i);
- t30_local_interrupt_request(s, TRUE);
+ t30_local_interrupt_request(s, true);
}
else
{
case T30_PRI_EOM:
case T30_PRI_EOP:
printf("%c: Accepting interrupt request\n", i);
- t30_local_interrupt_request(s, TRUE);
+ t30_local_interrupt_request(s, true);
break;
case T30_PIN:
break;
fax_log_rx_parameters(s, tag);
t30_get_transfer_statistics(s, &t);
succeeded[i] = (result == T30_ERR_OK);
- phase_e_reached[i] = TRUE;
+ phase_e_reached[i] = true;
}
/*- End of function --------------------------------------------------------*/
static void real_time_frame_handler(t30_state_t *s,
void *user_data,
- int direction,
+ bool incoming,
const uint8_t *msg,
int len)
{
i = (intptr_t) user_data;
printf("%c: Real time frame handler - %s, %s, length = %d\n",
i + 'A',
- (direction) ? "line->T.30" : "T.30->line",
+ (incoming) ? "line->T.30" : "T.30->line",
t30_frametype(msg[2]),
len);
}
i = (intptr_t) user_data;
printf("%c: Document handler - event %d\n", i + 'A', event);
- return FALSE;
+ return false;
}
/*- End of function --------------------------------------------------------*/
static void real_time_gateway_frame_handler(t38_gateway_state_t *s,
void *user_data,
- int direction,
+ bool incoming,
const uint8_t *msg,
int len)
{
i = (intptr_t) user_data;
printf("%c: Real time gateway frame handler - %s, %s, length = %d\n",
i + 'A',
- (direction) ? "PSTN->T.38" : "T.38->PSTN",
+ (incoming) ? "PSTN->T.38" : "T.38->PSTN",
t30_frametype(msg[2]),
len);
}
#endif
#if defined(ENABLE_GUI)
- use_gui = FALSE;
+ use_gui = false;
#endif
- log_audio = FALSE;
- use_ecm = FALSE;
+ log_audio = false;
+ use_ecm = false;
t38_version = 1;
input_tiff_file_name = INPUT_TIFF_FILE_NAME;
- t38_simulate_incrementing_repeats = FALSE;
+ t38_simulate_incrementing_repeats = false;
g1050_model_no = 0;
g1050_speed_pattern_no = 1;
- remove_fill_bits = FALSE;
- use_tep = FALSE;
- feedback_audio = FALSE;
- use_transmit_on_idle = TRUE;
+ remove_fill_bits = false;
+ use_tep = false;
+ feedback_audio = false;
+ use_transmit_on_idle = true;
supported_modems = T30_SUPPORT_V27TER | T30_SUPPORT_V29 | T30_SUPPORT_V17;
page_header_info = NULL;
page_header_tz = NULL;
decode_file_name = NULL;
code_to_look_up = -1;
allowed_bilevel_resolutions = 0;
- colour_enabled = FALSE;
+ colour_enabled = false;
t38_transport = T38_TRANSPORT_UDPTL;
while ((opt = getopt(argc, argv, "b:c:Cd:D:efFgH:i:Ilm:M:n:p:s:S:tT:u:v:z:")) != -1)
{
code_to_look_up = atoi(optarg);
break;
case 'C':
- colour_enabled = TRUE;
+ colour_enabled = true;
break;
case 'd':
decode_file_name = optarg;
drop_frame = atoi(optarg);
break;
case 'e':
- use_ecm = TRUE;
+ use_ecm = true;
break;
case 'f':
- feedback_audio = TRUE;
+ feedback_audio = true;
break;
case 'F':
- remove_fill_bits = TRUE;
+ remove_fill_bits = true;
break;
case 'g':
#if defined(ENABLE_GUI)
- use_gui = TRUE;
+ use_gui = true;
#else
fprintf(stderr, "Graphical monitoring not available\n");
exit(2);
input_tiff_file_name = optarg;
break;
case 'I':
- t38_simulate_incrementing_repeats = TRUE;
+ t38_simulate_incrementing_repeats = true;
break;
case 'l':
- log_audio = TRUE;
+ log_audio = true;
break;
case 'm':
supported_modems = atoi(optarg);
scan_line_time = atoi(optarg);
break;
case 't':
- use_tep = TRUE;
+ use_tep = true;
break;
case 'T':
start_page = 0;
{
t30_set_supported_colour_resolutions(t30_state[i], 0);
}
- t30_set_supported_output_compressions(t30_state[i], T4_COMPRESSION_T4_2D);
+ //t30_set_supported_output_compressions(t30_state[i], T4_COMPRESSION_T85);
t30_set_ecm_capability(t30_state[i], use_ecm);
t30_set_supported_compressions(t30_state[i],
T4_COMPRESSION_T4_1D
| T4_COMPRESSION_T6
| T4_COMPRESSION_T85
| T4_COMPRESSION_T85_L0
-#if 0
//| T4_COMPRESSION_T88
| T4_COMPRESSION_T43
| T4_COMPRESSION_T45
| T4_COMPRESSION_GRAY_TO_BILEVEL
| T4_COMPRESSION_COLOUR_TO_BILEVEL
| T4_COMPRESSION_RESCALING
-#endif
| 0);
t30_set_minimum_scan_line_time(t30_state[i], scan_line_time);
break;
case T38_TRANSPORT_TCP:
case T38_TRANSPORT_TCP_TPKT:
- t38_terminal_set_fill_bit_removal(t38_state[i], TRUE);
+ t38_terminal_set_fill_bit_removal(t38_state[i], true);
t38_terminal_set_config(t38_state[i], T38_TERMINAL_OPTION_NO_PACING | T38_TERMINAL_OPTION_NO_INDICATORS);
- t38_terminal_set_tep_mode(t38_state[i], FALSE);
+ t38_terminal_set_tep_mode(t38_state[i], false);
break;
}
}
fax_rx(fax_state[i], fax_rx_buf[i], SAMPLES_PER_CHUNK);
if (!t30_call_active(t30_state[i]))
{
- completed[i] = TRUE;
+ completed[i] = true;
continue;
}
char *decode_test_file = NULL;
both_ways_line_model_state_t *model;
int rx_bits = 0;
-int cutoff_test_carrier = FALSE;
+bool cutoff_test_carrier = false;
static void rx_status(void *user_data, int status)
{
switch (status)
{
case SIG_STATUS_CARRIER_UP:
- cutoff_test_carrier = TRUE;
+ cutoff_test_carrier = true;
break;
case SIG_STATUS_CARRIER_DOWN:
- cutoff_test_carrier = FALSE;
+ cutoff_test_carrier = false;
break;
}
}
int modem_under_test_1;
int modem_under_test_2;
int modems_set;
- int log_audio;
int channel_codec;
int rbs_pattern;
int on_at;
int off_at;
+ int opt;
+ bool log_audio;
tone_gen_descriptor_t tone_desc;
tone_gen_state_t tone_tx;
- int opt;
channel_codec = MUNGE_CODEC_NONE;
rbs_pattern = 0;
line_model_no = 0;
decode_test_file = NULL;
- noise_sweep = FALSE;
+ noise_sweep = false;
modem_under_test_1 = FSK_V21CH1;
modem_under_test_2 = FSK_V21CH2;
- log_audio = FALSE;
+ log_audio = false;
modems_set = 0;
while ((opt = getopt(argc, argv, "c:d:lm:nr:s:")) != -1)
{
decode_test_file = optarg;
break;
case 'l':
- log_audio = TRUE;
+ log_audio = true;
break;
case 'm':
line_model_no = atoi(optarg);
break;
case 'n':
- noise_sweep = TRUE;
+ noise_sweep = true;
break;
case 'r':
rbs_pattern = atoi(optarg);
0,
0,
0,
- TRUE);
+ true);
tone_gen_init(&tone_tx, &tone_desc);
for (j = 0; j < 10; j++)
{
0,
0,
0,
- TRUE);
+ true);
tone_gen_init(&tone_tx, &tone_desc);
for (j = 0; j < 10; j++)
{
#endif
#if defined(ENABLE_GUI)
- use_gui = FALSE;
+ use_gui = false;
#endif
model_no = MODEL_NO;
speed_pattern_no = SPEED_PATTERN_NO;
{
case 'g':
#if defined(ENABLE_GUI)
- use_gui = TRUE;
+ use_gui = true;
#else
fprintf(stderr, "Graphical monitoring not available\n");
exit(2);
#include "spandsp/g168models.h"
#include "spandsp-sim.h"
-#define FALSE 0
-#define TRUE (!FALSE)
-
typedef struct
{
const char *name;
0,
0,
0,
- TRUE);
+ true);
tone_gen_init(&tone_state, &tone_desc);
tone_gen(&tone_state, amp, 8000);
for (i = 0; i < 10; i++)
int16_t outdata[BLOCK_LEN];
uint8_t g711data[BLOCK_LEN];
- basic_tests = TRUE;
+ basic_tests = true;
law = G711_ALAW;
- encode = FALSE;
- decode = FALSE;
+ encode = false;
+ decode = false;
in_file = NULL;
out_file = NULL;
while ((opt = getopt(argc, argv, "ad:e:l:u")) != -1)
{
case 'a':
law = G711_ALAW;
- basic_tests = FALSE;
+ basic_tests = false;
break;
case 'd':
in_file = optarg;
- basic_tests = FALSE;
- decode = TRUE;
+ basic_tests = false;
+ decode = true;
break;
case 'e':
in_file = optarg;
- basic_tests = FALSE;
- encode = TRUE;
+ basic_tests = false;
+ encode = true;
break;
case 'l':
out_file = optarg;
break;
case 'u':
law = G711_ULAW;
- basic_tests = FALSE;
+ basic_tests = false;
break;
default:
//usage();
if (basic_tests)
{
- compliance_tests(TRUE);
+ compliance_tests(true);
}
else
{
if (!decode && !encode)
{
decode =
- encode = TRUE;
+ encode = true;
}
if (in_file == NULL)
{
}
len = j - i;
enc_state = g722_encode_init(NULL, 64000, 0);
- enc_state->itu_test_mode = TRUE;
+ enc_state->itu_test_mode = true;
len2 = g722_encode(enc_state, compressed, itu_data + i, len);
/* Check the result against the ITU's reference output data */
compressed[k] = itu_data[k + i] >> ((mode == 3) ? 10 : (mode == 2) ? 9 : 8);
dec_state = g722_decode_init(NULL, (mode == 3) ? 48000 : (mode == 2) ? 56000 : 64000, 0);
- dec_state->itu_test_mode = TRUE;
+ dec_state->itu_test_mode = true;
len2 = g722_decode(dec_state, decompressed, compressed, len);
/* Check the result against the ITU's reference output data */
g722_encode_state_t *enc_state;
g722_decode_state_t *dec_state;
swept_tone_state_t *swept;
- power_meter_t in_meter;
- power_meter_t out_meter;
+ power_meter_t *in_meter;
+ power_meter_t *out_meter;
int16_t original[1024];
uint8_t compressed[1024];
int16_t decompressed[1024];
Figure 16/G.722, Figure A.1/G.722, and Figure A.2/G.722 */
enc_state = g722_encode_init(NULL, 64000, 0);
dec_state = g722_decode_init(NULL, 64000, 0);
- power_meter_init(&in_meter, 7);
- power_meter_init(&out_meter, 7);
+ in_meter = power_meter_init(NULL, 7);
+ out_meter = power_meter_init(NULL, 7);
/* First some silence */
len = 1024;
memset(original, 0, len*sizeof(original[0]));
for (i = 0; i < len; i++)
- in_level = power_meter_update(&in_meter, original[i]);
+ in_level = power_meter_update(in_meter, original[i]);
len2 = g722_encode(enc_state, compressed, original, len);
len3 = g722_decode(dec_state, decompressed, compressed, len2);
out_level = 0;
for (i = 0; i < len3; i++)
- out_level = power_meter_update(&out_meter, decompressed[i]);
+ out_level = power_meter_update(out_meter, decompressed[i]);
printf("Silence produces %d at the output\n", out_level);
/* Now a swept tone test */
- swept = swept_tone_init(NULL, 25.0f, 3500.0f, -10.0f, 60*16000, FALSE);
+ swept = swept_tone_init(NULL, 25.0f, 3500.0f, -10.0f, 60*16000, false);
do
{
len = swept_tone(swept, original, 1024);
for (i = 0; i < len; i++)
- in_level = power_meter_update(&in_meter, original[i]);
+ in_level = power_meter_update(in_meter, original[i]);
len2 = g722_encode(enc_state, compressed, original, len);
len3 = g722_decode(dec_state, decompressed, compressed, len2);
for (i = 0; i < len3; i++)
- out_level = power_meter_update(&out_meter, decompressed[i]);
+ out_level = power_meter_update(out_meter, decompressed[i]);
printf("%10d, %10d, %f\n", in_level, out_level, (float) out_level/in_level);
}
while (len > 0);
int32_t tone_phase_rate;
bit_rate = 64000;
- eight_k_in = FALSE;
- eight_k_out = FALSE;
- itutests = TRUE;
- encode = FALSE;
- decode = FALSE;
- tone_test = FALSE;
+ eight_k_in = false;
+ eight_k_out = false;
+ itutests = true;
+ encode = false;
+ decode = false;
+ tone_test = false;
in_file = NULL;
out_file = NULL;
while ((opt = getopt(argc, argv, "b:d:e:i:l:o:t")) != -1)
fprintf(stderr, "Invalid bit rate selected. Only 48000, 56000 and 64000 are valid.\n");
exit(2);
}
- itutests = FALSE;
+ itutests = false;
break;
case 'd':
in_file = optarg;
- decode = TRUE;
- itutests = FALSE;
+ decode = true;
+ itutests = false;
break;
case 'e':
in_file = optarg;
- encode = TRUE;
- itutests = FALSE;
+ encode = true;
+ itutests = false;
break;
case 'i':
i = atoi(optarg);
eight_k_out = (i == 8000);
break;
case 't':
- tone_test = TRUE;
- itutests = FALSE;
+ tone_test = true;
+ itutests = false;
break;
default:
//usage();
if (!decode && !encode)
{
decode =
- encode = TRUE;
+ encode = true;
}
if (in_file == NULL)
{
g726_state_t enc_state;
g726_state_t dec_state;
int opt;
- int itutests;
+ bool itutests;
int bit_rate;
SNDFILE *inhandle;
SNDFILE *outhandle;
int packing;
bit_rate = 32000;
- itutests = TRUE;
+ itutests = true;
packing = G726_PACKING_NONE;
while ((opt = getopt(argc, argv, "b:LR")) != -1)
{
fprintf(stderr, "Invalid bit rate selected. Only 16000, 24000, 32000 and 40000 are valid.\n");
exit(2);
}
- itutests = FALSE;
+ itutests = false;
break;
case 'L':
packing = G726_PACKING_LEFT;
static void etsi_compliance_tests(void)
{
- perform_linear_test(TRUE, 1, "Seq01");
- perform_linear_test(TRUE, 1, "Seq02");
- perform_linear_test(TRUE, 1, "Seq03");
- perform_linear_test(TRUE, 1, "Seq04");
- perform_linear_test(FALSE, 1, "Seq05");
- perform_law_test(TRUE, 'a', "Seq01");
- perform_law_test(TRUE, 'a', "Seq02");
- perform_law_test(TRUE, 'a', "Seq03");
- perform_law_test(TRUE, 'a', "Seq04");
- perform_law_test(FALSE, 'a', "Seq05");
- perform_law_test(TRUE, 'u', "Seq01");
- perform_law_test(TRUE, 'u', "Seq02");
- perform_law_test(TRUE, 'u', "Seq03");
- perform_law_test(TRUE, 'u', "Seq04");
- perform_law_test(FALSE, 'u', "Seq05");
+ perform_linear_test(true, 1, "Seq01");
+ perform_linear_test(true, 1, "Seq02");
+ perform_linear_test(true, 1, "Seq03");
+ perform_linear_test(true, 1, "Seq04");
+ perform_linear_test(false, 1, "Seq05");
+ perform_law_test(true, 'a', "Seq01");
+ perform_law_test(true, 'a', "Seq02");
+ perform_law_test(true, 'a', "Seq03");
+ perform_law_test(true, 'a', "Seq04");
+ perform_law_test(false, 'a', "Seq05");
+ perform_law_test(true, 'u', "Seq01");
+ perform_law_test(true, 'u', "Seq02");
+ perform_law_test(true, 'u', "Seq03");
+ perform_law_test(true, 'u', "Seq04");
+ perform_law_test(false, 'u', "Seq05");
/* This is not actually an ETSI test */
perform_pack_unpack_test();
int etsitests;
int packing;
- etsitests = TRUE;
+ etsitests = true;
packing = GSM0610_PACKING_NONE;
while ((opt = getopt(argc, argv, "lp:")) != -1)
{
switch (opt)
{
case 'l':
- etsitests = FALSE;
+ etsitests = false;
break;
case 'p':
packing = atoi(optarg);
int ref_len;
uint8_t buf[1000];
-int abort_reported;
-int frame_handled;
-int frame_failed;
+bool abort_reported;
+bool frame_handled;
+bool frame_failed;
int frame_len_errors;
int frame_data_errors;
-int underflow_reported;
-int framing_ok_reported;
+bool underflow_reported;
+bool framing_ok_reported;
int framing_ok_reports;
hdlc_rx_state_t rx;
switch (len)
{
case SIG_STATUS_FRAMING_OK:
- framing_ok_reported = TRUE;
+ framing_ok_reported = true;
framing_ok_reports++;
break;
case SIG_STATUS_ABORT:
- abort_reported = TRUE;
+ abort_reported = true;
break;
}
return;
frame_data_errors++;
return;
}
- frame_handled = TRUE;
+ frame_handled = true;
}
else
{
- frame_failed = TRUE;
+ frame_failed = true;
}
}
/*- End of function --------------------------------------------------------*/
static void underflow_handler(void *user_data)
{
//printf("Underflow reported\n");
- underflow_reported = TRUE;
+ underflow_reported = true;
}
/*- End of function --------------------------------------------------------*/
printf("Testing with CRC-16 (byte by byte)\n");
frame_len_errors = 0;
frame_data_errors = 0;
- hdlc_tx_init(&tx, FALSE, 1, FALSE, underflow_handler, NULL);
- hdlc_rx_init(&rx, FALSE, FALSE, 5, frame_handler, NULL);
- underflow_reported = FALSE;
+ hdlc_tx_init(&tx, false, 1, false, underflow_handler, NULL);
+ hdlc_rx_init(&rx, false, false, 5, frame_handler, NULL);
+ underflow_reported = false;
start = rdtscll();
hdlc_tx_flags(&tx, 40);
/* Push an initial message so we should NOT get an underflow after the preamble. */
ref_len = cook_up_msg(buf);
hdlc_tx_frame(&tx, buf, ref_len);
- frame_handled = FALSE;
- frame_failed = FALSE;
+ frame_handled = false;
+ frame_failed = false;
frames_sent = 0;
bytes_sent = 0;
for (i = 0; i < 1000000; i++)
hdlc_rx_put_byte(&rx, nextbyte);
if (underflow_reported)
{
- underflow_reported = FALSE;
+ underflow_reported = false;
nextbyte = hdlc_tx_get_byte(&tx);
hdlc_rx_put_byte(&rx, nextbyte);
frames_sent++;
}
ref_len = cook_up_msg(buf);
hdlc_tx_frame(&tx, buf, ref_len);
- frame_handled = FALSE;
+ frame_handled = false;
}
}
end = rdtscll();
printf("Testing with CRC-16 (chunk by chunk)\n");
frame_len_errors = 0;
frame_data_errors = 0;
- hdlc_tx_init(&tx, FALSE, 1, FALSE, underflow_handler, NULL);
- hdlc_rx_init(&rx, FALSE, FALSE, 5, frame_handler, NULL);
- underflow_reported = FALSE;
+ hdlc_tx_init(&tx, false, 1, false, underflow_handler, NULL);
+ hdlc_rx_init(&rx, false, false, 5, frame_handler, NULL);
+ underflow_reported = false;
start = rdtscll();
hdlc_tx_flags(&tx, 40);
/* Push an initial message so we should NOT get an underflow after the preamble. */
ref_len = cook_up_msg(buf);
hdlc_tx_frame(&tx, buf, ref_len);
- frame_handled = FALSE;
- frame_failed = FALSE;
+ frame_handled = false;
+ frame_failed = false;
frames_sent = 0;
bytes_sent = 0;
for (i = 0; i < 10000; i++)
hdlc_rx_put(&rx, bufx, len);
if (underflow_reported)
{
- underflow_reported = FALSE;
+ underflow_reported = false;
len = hdlc_tx_get(&tx, bufx, 100);
hdlc_rx_put(&rx, bufx, len);
frames_sent++;
}
ref_len = cook_up_msg(buf);
hdlc_tx_frame(&tx, buf, ref_len);
- frame_handled = FALSE;
+ frame_handled = false;
}
}
end = rdtscll();
printf("Testing with CRC-16 (bit by bit)\n");
frame_len_errors = 0;
frame_data_errors = 0;
- hdlc_tx_init(&tx, FALSE, 2, FALSE, underflow_handler, NULL);
- hdlc_rx_init(&rx, FALSE, FALSE, 5, frame_handler, NULL);
- underflow_reported = FALSE;
+ hdlc_tx_init(&tx, false, 2, false, underflow_handler, NULL);
+ hdlc_rx_init(&rx, false, false, 5, frame_handler, NULL);
+ underflow_reported = false;
start = rdtscll();
hdlc_tx_flags(&tx, 40);
/* Don't push an initial message so we should get an underflow after the preamble. */
/* Lie for the first message, as there isn't really one */
- frame_handled = TRUE;
- frame_failed = FALSE;
+ frame_handled = true;
+ frame_failed = false;
frames_sent = 0;
bytes_sent = 0;
ref_len = 0;
hdlc_rx_put_bit(&rx, nextbyte);
if (underflow_reported)
{
- underflow_reported = FALSE;
+ underflow_reported = false;
for (j = 0; j < 20; j++)
{
nextbyte = hdlc_tx_get_bit(&tx);
}
ref_len = cook_up_msg(buf);
hdlc_tx_frame(&tx, buf, ref_len);
- frame_handled = FALSE;
+ frame_handled = false;
}
}
end = rdtscll();
printf("Testing with CRC-32 (byte by byte)\n");
frame_len_errors = 0;
frame_data_errors = 0;
- hdlc_tx_init(&tx, TRUE, 1, FALSE, underflow_handler, NULL);
- hdlc_rx_init(&rx, TRUE, FALSE, 1, frame_handler, NULL);
- underflow_reported = FALSE;
+ hdlc_tx_init(&tx, true, 1, false, underflow_handler, NULL);
+ hdlc_rx_init(&rx, true, false, 1, frame_handler, NULL);
+ underflow_reported = false;
start = rdtscll();
hdlc_tx_flags(&tx, 40);
/* Don't push an initial message so we should get an underflow after the preamble. */
/* Lie for the first message, as there isn't really one */
- frame_handled = TRUE;
- frame_failed = FALSE;
+ frame_handled = true;
+ frame_failed = false;
frames_sent = 0;
bytes_sent = 0;
ref_len = 0;
hdlc_rx_put_byte(&rx, nextbyte);
if (underflow_reported)
{
- underflow_reported = FALSE;
+ underflow_reported = false;
nextbyte = hdlc_tx_get_byte(&tx);
hdlc_rx_put_byte(&rx, nextbyte);
if (ref_len)
}
ref_len = cook_up_msg(buf);
hdlc_tx_frame(&tx, buf, ref_len);
- frame_handled = FALSE;
+ frame_handled = false;
}
}
end = rdtscll();
printf("Testing progressive mode with CRC-16 (byte by byte)\n");
frame_len_errors = 0;
frame_data_errors = 0;
- hdlc_tx_init(&tx, TRUE, 1, TRUE, underflow_handler, NULL);
- hdlc_rx_init(&rx, TRUE, FALSE, 1, frame_handler, NULL);
- underflow_reported = FALSE;
+ hdlc_tx_init(&tx, true, 1, true, underflow_handler, NULL);
+ hdlc_rx_init(&rx, true, false, 1, frame_handler, NULL);
+ underflow_reported = false;
start = rdtscll();
hdlc_tx_flags(&tx, 40);
/* Don't push an initial message so we should get an underflow after the preamble. */
/* Lie for the first message, as there isn't really one */
- frame_handled = TRUE;
- frame_failed = FALSE;
+ frame_handled = true;
+ frame_failed = false;
progress = 9999;
progress_delay = 9999;
frames_sent = 0;
hdlc_rx_put_byte(&rx, nextbyte);
if (underflow_reported)
{
- underflow_reported = FALSE;
+ underflow_reported = false;
nextbyte = hdlc_tx_get_byte(&tx);
hdlc_rx_put_byte(&rx, nextbyte);
if (ref_len)
hdlc_tx_frame(&tx, buf, 10);
progress = 10;
progress_delay = 8;
- frame_handled = FALSE;
+ frame_handled = false;
}
if (progress < ref_len && progress_delay-- <= 0)
{
printf("Testing frame length error handling using CRC-16 (bit by bit)\n");
frame_len_errors = 0;
frame_data_errors = 0;
- hdlc_tx_init(&tx, FALSE, 2, FALSE, underflow_handler, NULL);
- hdlc_rx_init(&rx, FALSE, TRUE, 5, frame_handler, NULL);
+ hdlc_tx_init(&tx, false, 2, false, underflow_handler, NULL);
+ hdlc_rx_init(&rx, false, true, 5, frame_handler, NULL);
hdlc_rx_set_max_frame_len(&rx, 100);
- underflow_reported = FALSE;
- framing_ok_reported = FALSE;
+ underflow_reported = false;
+ framing_ok_reported = false;
framing_ok_reports = 0;
hdlc_tx_flags(&tx, 10);
/* Don't push an initial message so we should get an underflow after the preamble. */
/* Lie for the first message, as there isn't really one */
- frame_handled = TRUE;
- frame_failed = FALSE;
+ frame_handled = true;
+ frame_failed = false;
frames_sent = 0;
bytes_sent = 0;
ref_len = 0;
if (framing_ok_reported)
{
printf("Framing OK reported at bit %d (%d)\n", i, framing_ok_reports);
- framing_ok_reported = FALSE;
+ framing_ok_reported = false;
}
if (underflow_reported)
{
- underflow_reported = FALSE;
+ underflow_reported = false;
for (j = 0; j < 20; j++)
{
nextbyte = hdlc_tx_get_bit(&tx);
if (framing_ok_reported)
{
printf("Framing OK reported at bit %d (%d) - %d\n", i, framing_ok_reports, frame_handled);
- framing_ok_reported = FALSE;
+ framing_ok_reported = false;
}
}
if (ref_len)
}
ref_len++;
hdlc_tx_frame(&tx, buf, ref_len);
- frame_handled = FALSE;
+ frame_handled = false;
}
}
/* We shouldn't reach here */
printf("Testing CRC error handling using CRC-16 (bit by bit)\n");
frame_len_errors = 0;
frame_data_errors = 0;
- hdlc_tx_init(&tx, FALSE, 2, FALSE, underflow_handler, NULL);
- hdlc_rx_init(&rx, FALSE, TRUE, 5, frame_handler, NULL);
- underflow_reported = FALSE;
- framing_ok_reported = FALSE;
+ hdlc_tx_init(&tx, false, 2, false, underflow_handler, NULL);
+ hdlc_rx_init(&rx, false, true, 5, frame_handler, NULL);
+ underflow_reported = false;
+ framing_ok_reported = false;
framing_ok_reports = 0;
hdlc_tx_flags(&tx, 10);
/* Don't push an initial message so we should get an underflow after the preamble. */
/* Lie for the first message, as there isn't really one */
- frame_handled = TRUE;
- frame_failed = FALSE;
+ frame_handled = true;
+ frame_failed = false;
frames_sent = 0;
bytes_sent = 0;
ref_len = 100;
- corrupt = FALSE;
+ corrupt = false;
for (i = 0; i < 8*1000000; i++)
{
nextbyte = hdlc_tx_get_bit(&tx);
if (framing_ok_reported)
{
printf("Framing OK reported at bit %d (%d)\n", i, framing_ok_reports);
- framing_ok_reported = FALSE;
+ framing_ok_reported = false;
}
if (underflow_reported)
{
- underflow_reported = FALSE;
+ underflow_reported = false;
for (j = 0; j < 20; j++)
{
nextbyte = hdlc_tx_get_bit(&tx);
if (framing_ok_reported)
{
printf("Framing OK reported at bit %d (%d) - %d\n", i, framing_ok_reports, frame_handled);
- framing_ok_reported = FALSE;
+ framing_ok_reported = false;
}
}
if (ref_len)
hdlc_tx_frame(&tx, buf, ref_len);
if ((corrupt = rand() & 1))
hdlc_tx_corrupt_frame(&tx);
- frame_handled = FALSE;
+ frame_handled = false;
}
}
printf("Testing abort handling using CRC-16 (bit by bit)\n");
frame_len_errors = 0;
frame_data_errors = 0;
- hdlc_tx_init(&tx, FALSE, 2, FALSE, underflow_handler, NULL);
- hdlc_rx_init(&rx, FALSE, TRUE, 0, frame_handler, NULL);
- underflow_reported = FALSE;
- framing_ok_reported = FALSE;
+ hdlc_tx_init(&tx, false, 2, false, underflow_handler, NULL);
+ hdlc_rx_init(&rx, false, true, 0, frame_handler, NULL);
+ underflow_reported = false;
+ framing_ok_reported = false;
framing_ok_reports = 0;
hdlc_tx_flags(&tx, 10);
/* Don't push an initial message so we should get an underflow after the preamble. */
/* Lie for the first message, as there isn't really one */
- frame_handled = TRUE;
- frame_failed = FALSE;
+ frame_handled = true;
+ frame_failed = false;
frames_sent = 0;
bytes_sent = 0;
ref_len = 0;
- abort = FALSE;
- abort_reported = FALSE;
+ abort = false;
+ abort_reported = false;
for (i = 0; i < 8*1000000; i++)
{
nextbyte = hdlc_tx_get_bit(&tx);
if (framing_ok_reported)
{
printf("Framing OK reported at bit %d (%d)\n", i, framing_ok_reports);
- framing_ok_reported = FALSE;
+ framing_ok_reported = false;
}
if (underflow_reported)
{
- underflow_reported = FALSE;
+ underflow_reported = false;
for (j = 0; j < 20; j++)
{
nextbyte = hdlc_tx_get_bit(&tx);
if (framing_ok_reported)
{
printf("Framing OK reported at bit %d (%d) - %d\n", i, framing_ok_reports, frame_handled);
- framing_ok_reported = FALSE;
+ framing_ok_reported = false;
}
}
if (ref_len)
hdlc_tx_frame(&tx, buf, ref_len);
if ((abort = rand() & 1))
hdlc_tx_abort(&tx);
- frame_handled = FALSE;
- abort_reported = FALSE;
+ frame_handled = false;
+ abort_reported = false;
}
}
printf("Testing the octet_counting handling using CRC-16 (bit by bit)\n");
frame_len_errors = 0;
frame_data_errors = 0;
- hdlc_tx_init(&tx, FALSE, 2, FALSE, underflow_handler, NULL);
- hdlc_rx_init(&rx, FALSE, TRUE, 0, frame_handler, NULL);
+ hdlc_tx_init(&tx, false, 2, false, underflow_handler, NULL);
+ hdlc_rx_init(&rx, false, true, 0, frame_handler, NULL);
//hdlc_rx_set_max_frame_len(&rx, 50);
hdlc_rx_set_octet_counting_report_interval(&rx, 16);
- underflow_reported = FALSE;
- framing_ok_reported = FALSE;
+ underflow_reported = false;
+ framing_ok_reported = false;
framing_ok_reports = 0;
hdlc_tx_flags(&tx, 10);
/* Don't push an initial message so we should get an underflow after the preamble. */
/* Lie for the first message, as there isn't really one */
- frame_handled = TRUE;
- frame_failed = FALSE;
+ frame_handled = true;
+ frame_failed = false;
frames_sent = 0;
bytes_sent = 0;
ref_len = 0;
if (framing_ok_reported)
{
printf("Framing OK reported at bit %d (%d)\n", i, framing_ok_reports);
- framing_ok_reported = FALSE;
+ framing_ok_reported = false;
}
if (underflow_reported)
{
- underflow_reported = FALSE;
+ underflow_reported = false;
for (j = 0; j < 20; j++)
{
nextbyte = hdlc_tx_get_bit(&tx);
if (framing_ok_reported)
{
printf("Framing OK reported at bit %d (%d) - %d\n", i, framing_ok_reports, frame_handled);
- framing_ok_reported = FALSE;
+ framing_ok_reported = false;
}
}
if (ref_len)
hdlc_tx_frame(&tx, buf, ref_len);
hdlc_tx_abort(&tx);
//hdlc_tx_corrupt_frame(&tx);
- frame_handled = FALSE;
+ frame_handled = false;
}
}
exit(2);
}
- hdlc_rx_init(&rx, FALSE, TRUE, 2, decode_handler, NULL);
+ hdlc_rx_init(&rx, false, true, 2, decode_handler, NULL);
while (fgets(buf, 1024, in))
{
if (sscanf(buf, "Rx bit %d - %d", &num, &bit) == 2)
int total_pre_samples;
int total_compressed_bytes;
int total_post_samples;
- const char *in_file_name;
int variant;
int chunk_size;
int enc_chunk_size;
- int log_encoded_data;
int opt;
+ bool log_encoded_data;
+ const char *in_file_name;
variant = IMA_ADPCM_DVI4;
in_file_name = IN_FILE_NAME;
chunk_size = 160;
enc_chunk_size = 0;
- log_encoded_data = FALSE;
+ log_encoded_data = false;
while ((opt = getopt(argc, argv, "ac:i:lv")) != -1)
{
switch (opt)
in_file_name = optarg;
break;
case 'l':
- log_encoded_data = TRUE;
+ log_encoded_data = true;
break;
case 'v':
variant = IMA_ADPCM_VDVI;
printf("Dithering from a 8 bit per sample gray scale to bi-level\n");
create_undithered_50_by_50(&im, image, 1);
s = image_translate_init(NULL, T4_IMAGE_TYPE_BILEVEL, -1, -1, T4_IMAGE_TYPE_GRAY_8BIT, im.width, im.length, row_read, &im);
- get_bilevel_image(s, TRUE);
+ get_bilevel_image(s, true);
printf("Scrunching from a 8 bit per sample gray scale to 8 bit per sample gray scale\n");
create_undithered_50_by_50(&im, image, 1);
s = image_translate_init(s, T4_IMAGE_TYPE_GRAY_8BIT, -1, -1, T4_IMAGE_TYPE_GRAY_8BIT, im.width, im.length, row_read, &im);
- get_gray8_image(s, TRUE);
+ get_gray8_image(s, true);
printf("Scrunching from a 8 bit per sample gray scale to 16 bit per sample gray scale\n");
create_undithered_50_by_50(&im, image, 1);
s = image_translate_init(s, T4_IMAGE_TYPE_GRAY_12BIT, -1, -1, T4_IMAGE_TYPE_GRAY_8BIT, im.width, im.length, row_read, &im);
- get_gray16_image(s, TRUE);
+ get_gray16_image(s, true);
printf("Scrunching from a 8 bit per sample gray scale to 3x8 bit per sample colour\n");
create_undithered_50_by_50(&im, image, 1);
s = image_translate_init(s, T4_IMAGE_TYPE_COLOUR_8BIT, -1, -1, T4_IMAGE_TYPE_GRAY_8BIT, im.width, im.length, row_read, &im);
- get_colour8_image(s, TRUE);
+ get_colour8_image(s, true);
printf("Scrunching from a 8 bit per sample gray scale to 3x16 bit per sample colour\n");
create_undithered_50_by_50(&im, image, 1);
s = image_translate_init(s, T4_IMAGE_TYPE_COLOUR_12BIT, -1, -1, T4_IMAGE_TYPE_GRAY_8BIT, im.width, im.length, row_read, &im);
- get_colour16_image(s, TRUE);
+ get_colour16_image(s, true);
image_translate_free(s);
}
printf("Dithering from a 16 bit per sample gray scale to bi-level\n");
create_undithered_50_by_50(&im, (uint8_t *) image, 2);
s = image_translate_init(NULL, T4_IMAGE_TYPE_BILEVEL, -1, -1, T4_IMAGE_TYPE_GRAY_12BIT, im.width, im.length, row_read, &im);
- get_bilevel_image(s, TRUE);
+ get_bilevel_image(s, true);
printf("Scrunching from a 16 bit per sample gray scale to 8 bit per sample gray scale\n");
create_undithered_50_by_50(&im, (uint8_t *) image, 2);
s = image_translate_init(s, T4_IMAGE_TYPE_GRAY_8BIT, -1, -1, T4_IMAGE_TYPE_GRAY_12BIT, im.width, im.length, row_read, &im);
- get_gray8_image(s, TRUE);
+ get_gray8_image(s, true);
printf("Scrunching from a 16 bit per sample gray scale to 16 bit per sample gray scale\n");
create_undithered_50_by_50(&im, (uint8_t *) image, 2);
s = image_translate_init(s, T4_IMAGE_TYPE_GRAY_12BIT, -1, -1, T4_IMAGE_TYPE_GRAY_12BIT, im.width, im.length, row_read, &im);
- get_gray16_image(s, TRUE);
+ get_gray16_image(s, true);
printf("Scrunching from a 16 bit per sample gray scale to 3x8 bit per sample colour\n");
create_undithered_50_by_50(&im, (uint8_t *) image, 2);
s = image_translate_init(s, T4_IMAGE_TYPE_COLOUR_8BIT, -1, -1, T4_IMAGE_TYPE_GRAY_12BIT, im.width, im.length, row_read, &im);
- get_colour8_image(s, TRUE);
+ get_colour8_image(s, true);
printf("Scrunching from a 16 bit per sample gray scale to 3x16 bit per sample colour\n");
create_undithered_50_by_50(&im, (uint8_t *) image, 2);
s = image_translate_init(s, T4_IMAGE_TYPE_COLOUR_12BIT, -1, -1, T4_IMAGE_TYPE_GRAY_12BIT, im.width, im.length, row_read, &im);
- get_colour16_image(s, TRUE);
+ get_colour16_image(s, true);
image_translate_free(s);
}
printf("Dithering from a 3x8 bit per sample colour to bi-level\n");
create_undithered_50_by_50(&im, image, 3);
s = image_translate_init(NULL, T4_IMAGE_TYPE_BILEVEL, -1, -1, T4_IMAGE_TYPE_COLOUR_8BIT, im.width, im.length, row_read, &im);
- get_bilevel_image(s, TRUE);
+ get_bilevel_image(s, true);
printf("Scrunching from a 3x8 bit per sample colour to 8 bit per sample gray scale\n");
create_undithered_50_by_50(&im, image, 3);
s = image_translate_init(s, T4_IMAGE_TYPE_GRAY_8BIT, -1, -1, T4_IMAGE_TYPE_COLOUR_8BIT, im.width, im.length, row_read, &im);
- get_gray8_image(s, TRUE);
+ get_gray8_image(s, true);
printf("Scrunching from a 3x8 bit per sample colour to 16 bit per sample gray scale\n");
create_undithered_50_by_50(&im, image, 3);
s = image_translate_init(s, T4_IMAGE_TYPE_GRAY_12BIT, -1, -1, T4_IMAGE_TYPE_COLOUR_8BIT, im.width, im.length, row_read, &im);
- get_gray16_image(s, TRUE);
+ get_gray16_image(s, true);
printf("Scrunching from a 3x8 bit per sample colour to 3x8 bit per sample colour\n");
create_undithered_50_by_50(&im, image, 3);
s = image_translate_init(s, T4_IMAGE_TYPE_COLOUR_8BIT, -1, -1, T4_IMAGE_TYPE_COLOUR_8BIT, im.width, im.length, row_read, &im);
- get_colour8_image(s, TRUE);
+ get_colour8_image(s, true);
printf("Scrunching from a 3x8 bit per sample colour to 3x16 bit per sample colour\n");
create_undithered_50_by_50(&im, image, 3);
s = image_translate_init(s, T4_IMAGE_TYPE_COLOUR_12BIT, -1, -1, T4_IMAGE_TYPE_COLOUR_8BIT, im.width, im.length, row_read, &im);
- get_colour16_image(s, TRUE);
+ get_colour16_image(s, true);
image_translate_free(s);
}
printf("Dithering from a 3x16 bit per sample colour to bi-level\n");
create_undithered_50_by_50(&im, (uint8_t *) image, 6);
s = image_translate_init(NULL, T4_IMAGE_TYPE_BILEVEL, -1, -1, T4_IMAGE_TYPE_COLOUR_12BIT, im.width, im.length, row_read, &im);
- get_bilevel_image(s, TRUE);
+ get_bilevel_image(s, true);
printf("Scrunching from a 3x16 bit per sample colour to 8 bit per sample gray scale\n");
create_undithered_50_by_50(&im, (uint8_t *) image, 6);
s = image_translate_init(s, T4_IMAGE_TYPE_GRAY_8BIT, -1, -1, T4_IMAGE_TYPE_COLOUR_12BIT, im.width, im.length, row_read, &im);
- get_gray8_image(s, TRUE);
+ get_gray8_image(s, true);
printf("Scrunching from a 3x16 bit per sample colour to 16 bit per sample gray scale\n");
create_undithered_50_by_50(&im, (uint8_t *) image, 6);
s = image_translate_init(s, T4_IMAGE_TYPE_GRAY_12BIT, -1, -1, T4_IMAGE_TYPE_COLOUR_12BIT, im.width, im.length, row_read, &im);
- get_gray16_image(s, TRUE);
+ get_gray16_image(s, true);
printf("Scrunching from a 3x16 bit per sample colour to 3x8 bit per sample colour\n");
create_undithered_50_by_50(&im, (uint8_t *) image, 6);
s = image_translate_init(s, T4_IMAGE_TYPE_COLOUR_8BIT, -1, -1, T4_IMAGE_TYPE_COLOUR_12BIT, im.width, im.length, row_read, &im);
- get_colour8_image(s, TRUE);
+ get_colour8_image(s, true);
printf("Scrunching from a 3x16 bit per sample colour to 3x16 bit per sample colour\n");
create_undithered_50_by_50(&im, (uint8_t *) image, 6);
s = image_translate_init(s, T4_IMAGE_TYPE_COLOUR_12BIT, -1, -1, T4_IMAGE_TYPE_COLOUR_12BIT, im.width, im.length, row_read, &im);
- get_colour16_image(s, TRUE);
+ get_colour16_image(s, true);
image_translate_free(s);
}
create_undithered_50_by_50(&im, image, 3);
s = image_translate_init(NULL, T4_IMAGE_TYPE_BILEVEL, 200, -1, T4_IMAGE_TYPE_COLOUR_8BIT, im.width, im.length, row_read, &im);
- get_bilevel_image(s, FALSE);
+ get_bilevel_image(s, false);
image_translate_free(s);
}
/*- End of function --------------------------------------------------------*/
int main(int argc, char *argv[])
{
int line_model_no;
- int speech_test;
int opt;
+ bool speech_test;
channel_codec = MUNGE_CODEC_NONE;
line_model_no = 0;
rbs_pattern = 0;
- speech_test = FALSE;
+ speech_test = false;
while ((opt = getopt(argc, argv, "c:m:r:s:")) != -1)
{
switch (opt)
#include "spandsp.h"
-static int tests_failed = FALSE;
+static bool tests_failed = false;
static int msg_step = 0;
static int msg2_step = 0;
-static int msg_done = FALSE;
-static int msg2_done = FALSE;
+static bool msg_done = false;
+static bool msg2_done = false;
static void message_handler(void *user_data, int level, const char *text)
{
if (strcmp(ref[msg_step], text))
{
printf(">>>: %s", ref[msg_step]);
- tests_failed = TRUE;
+ tests_failed = true;
}
if (ref[++msg_step][0] == '\0')
- msg_done = TRUE;
+ msg_done = true;
printf("MSG: %s", text);
}
/*- End of function --------------------------------------------------------*/
if (strcmp(" FLOW Protocol NewTag Date/time tagged log 1 2 3\n", text + 23))
{
printf(">>>: %s", text + 23);
- tests_failed = TRUE;
+ tests_failed = true;
}
if (++msg2_step == 10)
- msg2_done = TRUE;
+ msg2_done = true;
printf("MSG: %s", text);
}
/*- End of function --------------------------------------------------------*/
if (!span_log_test(log, i))
{
if (i != 6)
- tests_failed = TRUE;
+ tests_failed = true;
break;
}
}
lpc10_decode_state_t *lpc10_dec_state;
int i;
int block_no;
- int log_error;
- int compress;
- int decompress;
+ bool log_error;
+ bool compress;
+ bool decompress;
const char *in_file_name;
int compress_file;
int decompress_file;
int enc_len;
int dec_len;
- compress = FALSE;
- decompress = FALSE;
- log_error = TRUE;
+ compress = false;
+ decompress = false;
+ log_error = true;
in_file_name = IN_FILE_NAME;
while ((opt = getopt(argc, argv, "cdi:l")) != -1)
{
switch (opt)
{
case 'c':
- compress = TRUE;
+ compress = true;
break;
case 'd':
- decompress = TRUE;
+ decompress = true;
break;
case 'i':
in_file_name = optarg;
break;
case 'l':
- log_error = FALSE;
+ log_error = false;
break;
default:
//usage();
exit(2);
}
- if ((lpc10_enc_state = lpc10_encode_init(NULL, TRUE)) == NULL)
+ if ((lpc10_enc_state = lpc10_encode_init(NULL, true)) == NULL)
{
fprintf(stderr, " Cannot create encoder\n");
exit(2);
}
- if ((lpc10_dec_state = lpc10_decode_init(NULL, TRUE)) == NULL)
+ if ((lpc10_dec_state = lpc10_decode_init(NULL, true)) == NULL)
{
fprintf(stderr, " Cannot create decoder\n");
exit(2);
#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
int frames;
int samples;
int hit;
- int false_hit;
- int false_miss;
int level2;
int max_level2;
int tone_type;
int test_list;
int opt;
+ bool false_hit;
+ bool false_miss;
char *decode_test_file;
fsk_tx_state_t preamble_tx;
printf("Test 2a: CNG detection with frequency\n");
tone_type = MODEM_CONNECT_TONES_FAX_CNG;
awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f);
- false_hit = FALSE;
- false_miss = FALSE;
+ false_hit = false;
+ false_miss = false;
for (pitch = 1100 - 500; pitch <= 1100 + 500; pitch++)
{
/* Use the transmitter to test the receiver */
if (pitch < (1100 - CED_FREQ_BLACKOUT) || pitch > (1100 + CED_FREQ_BLACKOUT))
{
if (hit != MODEM_CONNECT_TONES_NONE)
- false_hit = TRUE;
+ false_hit = true;
/*endif*/
}
else if (pitch > (1100 - CED_FREQ_TOLERANCE) && pitch < (1100 + CED_FREQ_TOLERANCE))
{
if (hit != tone_type)
- false_miss = TRUE;
+ false_miss = true;
/*endif*/
}
/*endif*/
{
printf("Test 2b: CED/ANS detection with frequency\n");
awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f);
- false_hit = FALSE;
- false_miss = FALSE;
+ false_hit = false;
+ false_miss = false;
for (pitch = 2100 - 500; pitch < 2100 + 500; pitch++)
{
/* Use the transmitter to test the receiver */
if (pitch < (2100 - CNG_FREQ_BLACKOUT) || pitch > (2100 + CNG_FREQ_BLACKOUT))
{
if (hit != MODEM_CONNECT_TONES_NONE)
- false_hit = TRUE;
+ false_hit = true;
/*endif*/
}
else if (pitch > (2100 - CNG_FREQ_TOLERANCE) && pitch < (2100 + CNG_FREQ_TOLERANCE))
{
if (hit != MODEM_CONNECT_TONES_FAX_CED)
- false_miss = TRUE;
+ false_miss = true;
/*endif*/
}
/*endif*/
printf("Test 2c: ANSam detection with frequency\n");
tone_type = MODEM_CONNECT_TONES_ANSAM;
awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f);
- false_hit = FALSE;
- false_miss = FALSE;
+ false_hit = false;
+ false_miss = false;
for (pitch = 2100 - 100; pitch <= 2100 + 100; pitch++)
{
/* Use the transmitter to test the receiver */
if (pitch < (2100 - CNG_FREQ_BLACKOUT) || pitch > (2100 + CNG_FREQ_BLACKOUT))
{
if (hit != MODEM_CONNECT_TONES_NONE)
- false_hit = TRUE;
+ false_hit = true;
/*endif*/
}
else if (pitch > (2100 - CNG_FREQ_TOLERANCE) && pitch < (2100 + CNG_FREQ_TOLERANCE))
{
if (hit != tone_type)
- false_miss = TRUE;
+ false_miss = true;
/*endif*/
}
/*endif*/
printf("Test 2d: ANS/ (EC-disable) detection with frequency\n");
tone_type = MODEM_CONNECT_TONES_ANS_PR;
awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f);
- false_hit = FALSE;
- false_miss = FALSE;
+ false_hit = false;
+ false_miss = false;
for (pitch = 2100 - 100; pitch <= 2100 + 100; pitch++)
{
/* Use the transmitter to test the receiver */
if (pitch < (2100 - CNG_FREQ_BLACKOUT) || pitch > (2100 + CNG_FREQ_BLACKOUT))
{
if (hit != MODEM_CONNECT_TONES_NONE)
- false_hit = TRUE;
+ false_hit = true;
/*endif*/
}
else if (pitch > (2100 - CNG_FREQ_TOLERANCE) && pitch < (2100 + CNG_FREQ_TOLERANCE))
{
if (hit != tone_type)
- false_miss = TRUE;
+ false_miss = true;
/*endif*/
}
/*endif*/
printf("Test 2e: ANSam/ (Modulated EC-disable) detection with frequency\n");
tone_type = MODEM_CONNECT_TONES_ANSAM_PR;
awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f);
- false_hit = FALSE;
- false_miss = FALSE;
+ false_hit = false;
+ false_miss = false;
for (pitch = 2100 - 100; pitch <= 2100 + 100; pitch++)
{
/* Use the transmitter to test the receiver */
if (pitch < (2100 - CNG_FREQ_BLACKOUT) || pitch > (2100 + CNG_FREQ_BLACKOUT))
{
if (hit != MODEM_CONNECT_TONES_NONE)
- false_hit = TRUE;
+ false_hit = true;
/*endif*/
}
else if (pitch > (2100 - CNG_FREQ_TOLERANCE) && pitch < (2100 + CNG_FREQ_TOLERANCE))
{
if (hit != tone_type)
- false_miss = TRUE;
+ false_miss = true;
/*endif*/
}
/*endif*/
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;
+ false_hit = false;
+ false_miss = false;
for (pitch = 2225 - 500; pitch <= 2225 + 500; pitch++)
{
/* Use the transmitter to test the receiver */
if (pitch < (2225 - BELL_ANS_FREQ_BLACKOUT) || pitch > (2225 + BELL_ANS_FREQ_BLACKOUT))
{
if (hit != MODEM_CONNECT_TONES_NONE)
- false_hit = TRUE;
+ 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;
+ false_miss = true;
/*endif*/
}
/*endif*/
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;
+ false_hit = false;
+ false_miss = false;
for (pitch = 1300 - 500; pitch <= 1300 + 500; pitch++)
{
/* Use the transmitter to test the receiver */
if (pitch < (1300 - CALLING_TONE_FREQ_BLACKOUT) || pitch > (1300 + CALLING_TONE_FREQ_BLACKOUT))
{
if (hit != MODEM_CONNECT_TONES_NONE)
- false_hit = TRUE;
+ 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;
+ false_miss = true;
/*endif*/
}
/*endif*/
printf("Test 3a: CNG detection with level\n");
tone_type = MODEM_CONNECT_TONES_FAX_CNG;
awgn_init_dbm0(&chan_noise_source, 7162534, -60.0f);
- false_hit = FALSE;
- false_miss = FALSE;
+ false_hit = false;
+ false_miss = false;
for (pitch = 1100 - CED_FREQ_TOLERANCE; pitch <= 1100 + CED_FREQ_TOLERANCE; pitch += 2*CED_FREQ_TOLERANCE)
{
for (level = LEVEL_MAX; level >= LEVEL_MIN; level--)
if (level < LEVEL_MIN_REJECT)
{
if (hit != MODEM_CONNECT_TONES_NONE)
- false_hit = TRUE;
+ false_hit = true;
/*endif*/
}
else if (level > LEVEL_MIN_ACCEPT)
{
if (hit != tone_type)
- false_miss = TRUE;
+ false_miss = true;
/*endif*/
}
/*endif*/
printf("Test 3b: CED/ANS detection with level\n");
tone_type = MODEM_CONNECT_TONES_ANS;
awgn_init_dbm0(&chan_noise_source, 7162534, -60.0f);
- false_hit = FALSE;
- false_miss = FALSE;
+ false_hit = false;
+ false_miss = false;
for (pitch = 2100 - CNG_FREQ_TOLERANCE; pitch <= 2100 + CNG_FREQ_TOLERANCE; pitch += 2*CNG_FREQ_TOLERANCE)
{
for (level = LEVEL_MAX; level >= LEVEL_MIN; level--)
if (level < LEVEL_MIN_REJECT)
{
if (hit != MODEM_CONNECT_TONES_NONE)
- false_hit = TRUE;
+ false_hit = true;
/*endif*/
}
else if (level > LEVEL_MIN_ACCEPT)
{
if (hit != tone_type)
- false_miss = TRUE;
+ false_miss = true;
/*endif*/
}
/*endif*/
printf("Test 3c: ANSam detection with level\n");
tone_type = MODEM_CONNECT_TONES_ANSAM;
awgn_init_dbm0(&chan_noise_source, 7162534, -60.0f);
- false_hit = FALSE;
- false_miss = FALSE;
+ false_hit = false;
+ false_miss = false;
for (pitch = 2100 - CNG_FREQ_TOLERANCE; pitch <= 2100 + CNG_FREQ_TOLERANCE; pitch += 2*CNG_FREQ_TOLERANCE)
{
//for (level = LEVEL_MAX; level >= LEVEL_MIN; level--)
if (level < LEVEL_MIN_REJECT)
{
if (hit != MODEM_CONNECT_TONES_NONE)
- false_hit = TRUE;
+ false_hit = true;
/*endif*/
}
else if (level > LEVEL_MIN_ACCEPT)
{
if (hit != tone_type)
- false_miss = TRUE;
+ false_miss = true;
/*endif*/
}
/*endif*/
printf("Test 3d: ANS/ (EC-disable) detection with level\n");
tone_type = MODEM_CONNECT_TONES_ANS_PR;
awgn_init_dbm0(&chan_noise_source, 7162534, -60.0f);
- false_hit = FALSE;
- false_miss = FALSE;
+ false_hit = false;
+ false_miss = false;
for (pitch = 2100 - CNG_FREQ_TOLERANCE; pitch <= 2100 + CNG_FREQ_TOLERANCE; pitch += 2*CNG_FREQ_TOLERANCE)
{
for (level = LEVEL_MAX; level >= LEVEL_MIN; level--)
if (level < LEVEL_MIN_REJECT)
{
if (hit != MODEM_CONNECT_TONES_NONE)
- false_hit = TRUE;
+ false_hit = true;
/*endif*/
}
else if (level > LEVEL_MIN_ACCEPT)
{
if (hit != tone_type)
- false_miss = TRUE;
+ false_miss = true;
/*endif*/
}
/*endif*/
printf("Test 3e: ANSam/ (Modulated EC-disable) detection with level\n");
tone_type = MODEM_CONNECT_TONES_ANSAM_PR;
awgn_init_dbm0(&chan_noise_source, 7162534, -60.0f);
- false_hit = FALSE;
- false_miss = FALSE;
+ false_hit = false;
+ false_miss = false;
for (pitch = 2100 - CNG_FREQ_TOLERANCE; pitch <= 2100 + CNG_FREQ_TOLERANCE; pitch += 2*CNG_FREQ_TOLERANCE)
{
for (level = LEVEL_MAX; level >= LEVEL_MIN; level--)
if (level < LEVEL_MIN_REJECT)
{
if (hit != MODEM_CONNECT_TONES_NONE)
- false_hit = TRUE;
+ false_hit = true;
/*endif*/
}
else if (level > LEVEL_MIN_ACCEPT)
{
if (hit != tone_type)
- false_miss = TRUE;
+ false_miss = true;
/*endif*/
}
/*endif*/
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;
+ 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--)
if (level < LEVEL_MIN_REJECT)
{
if (hit != MODEM_CONNECT_TONES_NONE)
- false_hit = TRUE;
+ false_hit = true;
/*endif*/
}
else if (level > LEVEL_MIN_ACCEPT)
{
if (hit != tone_type)
- false_miss = TRUE;
+ false_miss = true;
/*endif*/
}
/*endif*/
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;
+ 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--)
if (level < LEVEL_MIN_REJECT)
{
if (hit != MODEM_CONNECT_TONES_NONE)
- false_hit = TRUE;
+ false_hit = true;
/*endif*/
}
else if (level > LEVEL_MIN_ACCEPT)
{
if (hit != tone_type)
- false_miss = TRUE;
+ false_miss = true;
/*endif*/
}
/*endif*/
if ((test_list & PERFORM_TEST_4))
{
printf("Test 4: CED detection, when stimulated with V.21 preamble\n");
- false_hit = FALSE;
- false_miss = FALSE;
+ false_hit = false;
+ false_miss = false;
/* Send 255 bits of preamble (0.85s, the minimum specified preamble for T.30), and then
some random bits. Check the preamble detector comes on, and goes off at reasonable times. */
printf("Test 5A: ANS and ANS/ detection with reversal interval\n");
tone_type = MODEM_CONNECT_TONES_ANS_PR;
awgn_init_dbm0(&chan_noise_source, 7162534, -60.0f);
- false_hit = FALSE;
- false_miss = FALSE;
+ false_hit = false;
+ false_miss = false;
for (interval = 400; interval < 800; interval++)
{
printf("Reversal interval = %d\n", interval);
if (interval < (450 - 25) || interval > (450 + 25))
{
if (hits != 0)
- false_hit = TRUE;
+ false_hit = true;
/*endif*/
}
else if (interval > (450 - 25) && interval < (450 + 25))
{
if (hits == 0)
- false_miss = TRUE;
+ false_miss = true;
/*endif*/
}
/*endif*/
printf("Test 5B: ANS and ANS/ detection with mixed reversal intervals\n");
awgn_init_dbm0(&chan_noise_source, 7162534, -60.0f);
tone_type = MODEM_CONNECT_TONES_ANS_PR;
- false_hit = FALSE;
- false_miss = FALSE;
+ false_hit = false;
+ false_miss = false;
interval = 450;
printf("Reversal interval = %d\n", interval);
/* Use the transmitter to test the receiver */
printf("Test 6a: ANSam detection with AM pitch\n");
tone_type = MODEM_CONNECT_TONES_ANSAM;
awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f);
- false_hit = FALSE;
- false_miss = FALSE;
+ false_hit = false;
+ false_miss = false;
for (pitch = 5; pitch < 25; pitch++)
{
/* Use the transmitter to test the receiver */
if (pitch < (15 - 10) || pitch > (15 + 10))
{
if (hit == tone_type)
- false_hit = TRUE;
+ false_hit = true;
/*endif*/
}
else if (pitch > (15 - AM_FREQ_TOLERANCE) && pitch < (15 + AM_FREQ_TOLERANCE))
{
if (hit != tone_type)
- false_miss = TRUE;
+ false_miss = true;
/*endif*/
}
/*endif*/
printf("Test 6b: ANSam/ (Modulated EC-disable) detection with AM pitch\n");
tone_type = MODEM_CONNECT_TONES_ANSAM_PR;
awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f);
- false_hit = FALSE;
- false_miss = FALSE;
+ false_hit = false;
+ false_miss = false;
for (pitch = 5; pitch < 25; pitch++)
{
/* Use the transmitter to test the receiver */
if (pitch < (15 - 10) || pitch > (15 + 10))
{
if (hit == tone_type)
- false_hit = TRUE;
+ false_hit = true;
/*endif*/
}
else if (pitch > (15 - AM_FREQ_TOLERANCE) && pitch < (15 + AM_FREQ_TOLERANCE))
{
if (hit != tone_type)
- false_miss = TRUE;
+ false_miss = true;
/*endif*/
}
/*endif*/
tone_type = MODEM_CONNECT_TONES_ANSAM;
pitch = 2100;
awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f);
- false_hit = FALSE;
- false_miss = FALSE;
+ false_hit = false;
+ false_miss = false;
for (depth = 0; depth < 40; depth++)
{
/* Use the transmitter to test the receiver */
if (depth < 10)
{
if (hit == tone_type)
- false_hit = TRUE;
+ false_hit = true;
/*endif*/
}
else if (depth > 15)
{
if (hit != tone_type)
- false_miss = TRUE;
+ false_miss = true;
/*endif*/
}
/*endif*/
tone_type = MODEM_CONNECT_TONES_ANSAM_PR;
pitch = 2100;
awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f);
- false_hit = FALSE;
- false_miss = FALSE;
+ false_hit = false;
+ false_miss = false;
for (depth = 0; depth < 40; depth++)
{
/* Use the transmitter to test the receiver */
if (depth < 10)
{
if (hit == tone_type)
- false_hit = TRUE;
+ false_hit = true;
/*endif*/
}
else if (depth > 15)
{
if (hit != tone_type)
- false_miss = TRUE;
+ false_miss = true;
/*endif*/
}
/*endif*/
SNDFILE *resulthandle;
int16_t residue_sound[8000];
int residue_cur = 0;
-int do_codec_munge = TRUE;
-int use_gui = FALSE;
+int do_codec_munge = true;
+int use_gui = false;
static const int16_t tone_1khz[] = {10362, 7327, 0, -7327, -10362, -7327, 0, 7327};
#endif
line_model_no = 0;
- use_gui = FALSE;
+ use_gui = false;
for (i = 1; i < argc; i++)
{
if (strcmp(argv[i], "-g") == 0)
{
- use_gui = TRUE;
+ use_gui = true;
continue;
}
line_model_no = atoi(argv[1]);
power_meter_init(&power_after, 5);
/* Measure the echo power before adaption */
- modem_echo_can_adaption_mode(ctx, FALSE);
+ modem_echo_can_adaption_mode(ctx, false);
for (i = 0; i < 8000*5; i++)
{
tx = tone_1khz[i & 7];
/* Converge the canceller */
signal_restart(&local_css);
- modem_echo_can_adaption_mode(ctx, TRUE);
+ modem_echo_can_adaption_mode(ctx, true);
for (i = 0; i < 800*2; i++)
{
clean = modem_echo_can_update(ctx, 0, 0);
}
/* Now lets see how well adapted we are */
- modem_echo_can_adaption_mode(ctx, FALSE);
+ modem_echo_can_adaption_mode(ctx, false);
for (i = 0; i < 8000*5; i++)
{
tx = tone_1khz[i & 7];
int encoded_fd;
const char *encoded_file_name;
const char *in_file_name;
- int log_encoded_data;
+ bool log_encoded_data;
int opt;
bit_rate = 32000;
encoded_file_name = NULL;
in_file_name = IN_FILE_NAME;
- log_encoded_data = FALSE;
+ log_encoded_data = false;
while ((opt = getopt(argc, argv, "2d:i:l")) != -1)
{
switch (opt)
in_file_name = optarg;
break;
case 'l':
- log_encoded_data = TRUE;
+ log_encoded_data = true;
break;
default:
//usage();
int block_len;
int loss_rate;
int dropit;
- int block_real;
- int block_synthetic;
int tone;
int i;
+ int opt;
+ bool block_real;
+ bool block_synthetic;
uint32_t phase_acc;
int32_t phase_rate;
- int opt;
loss_rate = 25;
block_len = 160;
- block_real = FALSE;
- block_synthetic = FALSE;
+ block_real = false;
+ block_synthetic = false;
tone = -1;
while ((opt = getopt(argc, argv, "b:l:rst:")) != -1)
{
loss_rate = atoi(optarg);
break;
case 'r':
- block_real = TRUE;
+ block_real = true;
break;
case 's':
- block_synthetic = TRUE;
+ block_synthetic = true;
break;
case 't':
tone = atoi(optarg);
exit(2);
}
sig = power_surge_detector_init(NULL, -50.0f, 5.0f);
- prev_signal_present = FALSE;
+ prev_signal_present = false;
phase_rate = dds_phase_rate(450.0f);
phase_acc = 0;
exit(2);
}
sig = power_surge_detector_init(NULL, -50.0f, 6.0f);
- prev_signal_present = FALSE;
+ prev_signal_present = false;
sample = 0;
while ((inframes = sf_readf_short(inhandle, amp, 8000)))
0,
0,
0,
- TRUE);
+ true);
tone_gen_init(&gen, &tone_desc);
len = tone_gen(&gen, amp, 1000);
for (i = 0; i < len; i++)
int main(int argc, char *argv[])
{
- int basic_tests;
- int decode;
+ bool basic_tests;
+ bool decode;
int opt;
const char *in_file;
- basic_tests = TRUE;
- decode = FALSE;
+ basic_tests = true;
+ decode = false;
in_file = IN_FILE_NAME;
while ((opt = getopt(argc, argv, "d:")) != -1)
{
{
case 'd':
in_file = optarg;
- basic_tests = FALSE;
- decode = TRUE;
+ basic_tests = false;
+ decode = true;
break;
default:
//usage();
psuedo_terminal_close(modem);
return -1;
}
- modem->threadAbort = CreateEvent(NULL, TRUE, FALSE, NULL);
+ modem->threadAbort = CreateEvent(NULL, true, false, NULL);
#else
modem->slot = next_id++;
snprintf(modem->devlink, sizeof(modem->devlink), "/dev/spandsp/%d", modem->slot);
int main(int argc, char *argv[])
{
- int threaded_messages;
- int threaded_streams;
+ bool threaded_messages;
+ bool threaded_streams;
int opt;
- threaded_messages = FALSE;
- threaded_streams = FALSE;
+ threaded_messages = false;
+ threaded_streams = false;
while ((opt = getopt(argc, argv, "ms")) != -1)
{
switch (opt)
{
case 'm':
- threaded_messages = TRUE;
+ threaded_messages = true;
break;
case 's':
- threaded_streams = TRUE;
+ threaded_streams = true;
break;
}
}
0,
0,
0,
- FALSE);
+ false);
}
}
/*- End of function --------------------------------------------------------*/
if (data != (void *) 0x12345678)
{
- callback_ok = FALSE;
+ callback_ok = false;
return;
}
if ((callback_roll & 1))
else
ch = r2_mf_tone_codes[callback_roll >> 1];
if (ch == digit)
- callback_ok = TRUE;
+ callback_ok = true;
else
- callback_ok = FALSE;
+ callback_ok = false;
if (r2_mf_tone_codes[callback_roll >> 1])
callback_roll++;
else
- callback_ok = FALSE;
+ callback_ok = false;
}
/*- End of function --------------------------------------------------------*/
printf(" Passed\n");
printf("Test 8: Callback digit delivery mode.\n");
- callback_ok = FALSE;
+ callback_ok = false;
callback_roll = 0;
mf_state = r2_mf_rx_init(NULL, fwd, digit_delivery, (void *) 0x12345678);
my_mf_gen_init(0.0, -3, 0.0, -3, 68, fwd);
now = time(NULL);
printf("R2 forward tones\n");
- test_a_tone_set(TRUE);
+ test_a_tone_set(true);
printf("R2 backward tones\n");
- test_a_tone_set(FALSE);
+ test_a_tone_set(false);
duration = time(NULL) - now;
printf("Tests passed in %lds\n", duration);
return 0;
exit(2);
}
- r2_mf_tx_init(&gen, FALSE);
+ r2_mf_tx_init(&gen, false);
for (digit = 0; digits[digit]; digit++)
{
r2_mf_tx_put(&gen, digits[digit]);
sf_writef_short(outhandle, amp, len);
}
- r2_mf_tx_init(&gen, TRUE);
+ r2_mf_tx_init(&gen, true);
for (digit = 0; digits[digit]; digit++)
{
r2_mf_tx_put(&gen, digits[digit]);
#endif
#if defined(ENABLE_GUI)
- use_gui = FALSE;
+ use_gui = false;
#endif
model_no = MODEL_NO;
speed_pattern_no = SPEED_PATTERN_NO;
{
case 'g':
#if defined(ENABLE_GUI)
- use_gui = TRUE;
+ use_gui = true;
#else
fprintf(stderr, "Graphical monitoring not available\n");
exit(2);
static int rx_handler_callbacks = 0;
static int tx_handler_callbacks = 0;
-static int use_gui = FALSE;
+static bool use_gui = false;
static void plot_frequency_response(void)
{
template_t template[10];
int opt;
- use_gui = FALSE;
+ use_gui = false;
while ((opt = getopt(argc, argv, "g")) != -1)
{
switch (opt)
{
case 'g':
- use_gui = TRUE;
+ use_gui = true;
break;
default:
//usage();
}
printf("Test with swept tone.\n");
- s = swept_tone_init(NULL, 200.0f, 3900.0f, -10.0f, 60*SAMPLE_RATE, TRUE);
+ s = swept_tone_init(NULL, 200.0f, 3900.0f, -10.0f, 60*SAMPLE_RATE, true);
for (j = 0; j < 60*SAMPLE_RATE; j += BLOCK_LEN)
{
len = swept_tone(s, buf, BLOCK_LEN);
double when = 0.0;
-int t38_mode = FALSE;
+int t38_mode = false;
struct modem_s modem[10];
char *decode_test_file = NULL;
int countdown = 0;
int answered = 0;
-int done = FALSE;
+int done = false;
int test_seq_ptr = 0;
modem = (modem_t *) user_data;
#if defined(WIN32)
- o.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
+ o.hEvent = CreateEvent(NULL, true, false, NULL);
/* Initialize the rest of the OVERLAPPED structure to zero. */
o.Internal = 0;
o.InternalHigh = 0;
o.OffsetHigh = 0;
assert(o.hEvent);
if (!WriteFile(modem->master, buf, (DWORD) len, &res, &o))
- GetOverlappedResult(modem->master, &o, &res, TRUE);
+ GetOverlappedResult(modem->master, &o, &res, true);
CloseHandle(o.hEvent);
#else
res = write(modem->master, buf, len);
answered = 1;
break;
case AT_MODEM_CONTROL_HANGUP:
- //done = TRUE;
+ //done = true;
break;
case AT_MODEM_CONTROL_OFFHOOK:
break;
ret = MODEM_POLL_ERROR;
arHandles[0] = modem->threadAbort;
- o.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
+ o.hEvent = CreateEvent(NULL, true, false, NULL);
arHandles[1] = o.hEvent;
/* Initialize the rest of the OVERLAPPED structure to zero. */
else
{
/* IO is pending, wait for it to finish */
- dwWait = WaitForMultipleObjects(2, arHandles, FALSE, INFINITE);
+ dwWait = WaitForMultipleObjects(2, arHandles, false, INFINITE);
if (dwWait == WAIT_OBJECT_0 + 1 && !modem->block_read)
ret = MODEM_POLL_READ;
}
/* Set up the test environment */
t38_version = 1;
- without_pacing = FALSE;
- use_tep = FALSE;
+ without_pacing = false;
+ use_tep = false;
wave_handle = NULL;
if (log_audio)
{
if (t38_mode)
{
- if ((t38_state = t38_terminal_init(NULL, FALSE, t38_tx_packet_handler, t31_state)) == NULL)
+ if ((t38_state = t38_terminal_init(NULL, false, t38_tx_packet_handler, t31_state)) == NULL)
{
fprintf(stderr, "Cannot start the T.38 channel\n");
exit(2);
}
else
{
- fax_state = fax_init(NULL, FALSE);
+ fax_state = fax_init(NULL, false);
t30 = fax_get_t30_state(fax_state);
}
t30_set_rx_file(t30, OUTPUT_FILE_NAME, -1);
{
if (t38_mode)
{
- if ((t38_state = t38_terminal_init(NULL, TRUE, t38_tx_packet_handler, t31_state)) == NULL)
+ if ((t38_state = t38_terminal_init(NULL, true, t38_tx_packet_handler, t31_state)) == NULL)
{
fprintf(stderr, "Cannot start the T.38 channel\n");
exit(2);
}
else
{
- fax_state = fax_init(NULL, TRUE);
+ fax_state = fax_init(NULL, true);
t30 = fax_get_t30_state(fax_state);
}
t30_set_tx_file(t30, INPUT_FILE_NAME, -1, -1);
span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME);
span_log_set_tag(logging, "T.31");
- t31_set_mode(t31_state, TRUE);
+ t31_set_mode(t31_state, true);
t38_set_t38_version(t38_core, t38_version);
}
if ((ret & MODEM_POLL_READ))
{
#if defined(WIN32)
- o.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
+ o.hEvent = CreateEvent(NULL, true, false, NULL);
/* Initialize the rest of the OVERLAPPED structure to zero. */
o.Internal = 0;
o.OffsetHigh = 0;
assert(o.hEvent);
if (!ReadFile(modem->master, buf, avail, &read_bytes, &o))
- GetOverlappedResult(modem->master, &o, &read_bytes, TRUE);
+ GetOverlappedResult(modem->master, &o, &read_bytes, true);
CloseHandle (o.hEvent);
if ((len = read_bytes))
#else
#endif
decode_test_file = NULL;
- log_audio = FALSE;
- test_sending = FALSE;
- t38_mode = FALSE;
- use_ecm = FALSE;
- use_gui = FALSE;
+ log_audio = false;
+ test_sending = false;
+ t38_mode = false;
+ use_ecm = false;
+ use_gui = false;
g1050_model_no = 0;
g1050_speed_pattern_no = 1;
while ((opt = getopt(argc, argv, "d:eglM:rS:st")) != -1)
decode_test_file = optarg;
break;
case 'e':
- use_ecm = TRUE;
+ use_ecm = true;
break;
case 'g':
#if defined(ENABLE_GUI)
- use_gui = TRUE;
+ use_gui = true;
#else
fprintf(stderr, "Graphical monitoring not available\n");
exit(2);
#endif
break;
case 'l':
- log_audio = TRUE;
+ log_audio = true;
break;
case 'M':
g1050_model_no = optarg[0] - 'A' + 1;
break;
case 'r':
- test_sending = FALSE;
+ test_sending = false;
break;
case 'S':
g1050_speed_pattern_no = atoi(optarg);
break;
case 's':
- test_sending = TRUE;
+ test_sending = true;
break;
case 't':
- t38_mode = TRUE;
+ t38_mode = true;
break;
default:
//usage();
double when = 0.0;
-int t38_mode = FALSE;
+int t38_mode = false;
#define EXCHANGE(a,b) {a, sizeof(a) - 1, b, sizeof(b) - 1}
#define RESPONSE(b) {"", 0, b, sizeof(b) - 1}
int command_response_test_step = -1;
char response_buf[1000];
int response_buf_ptr = 0;
-int answered = FALSE;
-int kick = FALSE;
-int dled = FALSE;
-int done = FALSE;
-int sequence_terminated = FALSE;
+int answered = false;
+int kick = false;
+int dled = false;
+int done = false;
+int sequence_terminated = false;
static const struct command_response_s *fax_test_seq;
t31_call_event(t31_state, AT_CALL_EVENT_CONNECTED);
break;
case AT_MODEM_CONTROL_ANSWER:
- answered = TRUE;
+ answered = true;
break;
case AT_MODEM_CONTROL_HANGUP:
- done = TRUE;
+ done = true;
break;
case AT_MODEM_CONTROL_OFFHOOK:
break;
response_buf[response_buf_ptr] = '\0';
test_seq_ptr++;
if (fax_test_seq[test_seq_ptr].command == NULL && fax_test_seq[test_seq_ptr].command == NULL)
- sequence_terminated = TRUE;
+ sequence_terminated = true;
if (fax_test_seq[test_seq_ptr].command)
- kick = TRUE;
+ kick = true;
break;
}
- dled = FALSE;
+ dled = false;
}
else
{
if (buf[i] == DLE)
- dled = TRUE;
+ dled = true;
}
}
i++;
printf("\nMatched\n");
test_seq_ptr++;
if (fax_test_seq[test_seq_ptr].command == NULL && fax_test_seq[test_seq_ptr].command == NULL)
- sequence_terminated = TRUE;
+ sequence_terminated = true;
response_buf_ptr = 0;
response_buf[response_buf_ptr] = '\0';
if (fax_test_seq[test_seq_ptr].command)
- kick = TRUE;
+ kick = true;
else
- dled = FALSE;
+ dled = false;
}
return 0;
}
/* Set up the test environment */
t38_version = 1;
- without_pacing = FALSE;
- use_tep = FALSE;
+ without_pacing = false;
+ use_tep = false;
wave_handle = NULL;
if (log_audio)
{
if (t38_mode)
{
- if ((t38_state = t38_terminal_init(NULL, FALSE, t38_tx_packet_handler, t31_state)) == NULL)
+ if ((t38_state = t38_terminal_init(NULL, false, t38_tx_packet_handler, t31_state)) == NULL)
{
fprintf(stderr, "Cannot start the T.38 channel\n");
exit(2);
}
else
{
- fax_state = fax_init(NULL, FALSE);
+ fax_state = fax_init(NULL, false);
t30 = fax_get_t30_state(fax_state);
}
t30_set_rx_file(t30, OUTPUT_FILE_NAME, -1);
{
if (t38_mode)
{
- if ((t38_state = t38_terminal_init(NULL, TRUE, t38_tx_packet_handler, t31_state)) == NULL)
+ if ((t38_state = t38_terminal_init(NULL, true, t38_tx_packet_handler, t31_state)) == NULL)
{
fprintf(stderr, "Cannot start the T.38 channel\n");
exit(2);
}
else
{
- fax_state = fax_init(NULL, TRUE);
+ fax_state = fax_init(NULL, true);
t30 = fax_get_t30_state(fax_state);
}
t30_set_tx_file(t30, INPUT_FILE_NAME, -1, -1);
span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME);
span_log_set_tag(logging, "T.31");
- t31_set_mode(t31_state, TRUE);
+ t31_set_mode(t31_state, true);
t38_set_t38_version(t38_core, t38_version);
}
- fast_send = FALSE;
- fast_send_tcf = TRUE;
+ fast_send = false;
+ fast_send_tcf = true;
fast_blocks = 0;
- kick = TRUE;
+ kick = true;
#if defined(ENABLE_GUI)
if (use_gui)
start_media_monitor();
if (kick)
{
/* Work through the script */
- kick = FALSE;
+ kick = false;
if (fax_test_seq[test_seq_ptr].command > (const char *) 2)
{
if (fax_test_seq[test_seq_ptr].command[0])
if (fax_test_seq[test_seq_ptr].command == (const char *) 2)
{
printf("Fast send TCF\n");
- fast_send = TRUE;
- fast_send_tcf = TRUE;
+ fast_send = true;
+ fast_send_tcf = true;
fast_blocks = 100;
}
else
{
printf("Fast send image\n");
- fast_send = TRUE;
- fast_send_tcf = FALSE;
+ fast_send = true;
+ fast_send_tcf = false;
fast_blocks = 100;
}
}
}
t31_at_rx(t31_state, (char *) fast_buf, 36);
if (--fast_blocks == 0)
- fast_send = FALSE;
+ fast_send = false;
}
if (t38_mode)
int opt;
decode_test_file = NULL;
- log_audio = FALSE;
- test_sending = FALSE;
- t38_mode = FALSE;
- use_gui = FALSE;
+ log_audio = false;
+ test_sending = false;
+ t38_mode = false;
+ use_gui = false;
g1050_model_no = 0;
g1050_speed_pattern_no = 1;
while ((opt = getopt(argc, argv, "d:glM:rS:st")) != -1)
break;
case 'g':
#if defined(ENABLE_GUI)
- use_gui = TRUE;
+ use_gui = true;
#else
fprintf(stderr, "Graphical monitoring not available\n");
exit(2);
#endif
break;
case 'l':
- log_audio = TRUE;
+ log_audio = true;
break;
case 'M':
g1050_model_no = optarg[0] - 'A' + 1;
break;
case 'r':
- test_sending = FALSE;
+ test_sending = false;
break;
case 'S':
g1050_speed_pattern_no = atoi(optarg);
break;
case 's':
- test_sending = TRUE;
+ test_sending = true;
break;
case 't':
- t38_mode = TRUE;
+ t38_mode = true;
break;
default:
//usage();
const char *country;
const char *model;
const char *real_country;
- int first_hit;
+ bool first_hit;
printf("Sweep through all the possible countries\n");
for (i = 0; i < 256; i++)
msg[0] = i;
msg[1] = '\x00';
msg[2] = '\x00';
- first_hit = TRUE;
+ first_hit = true;
for (j = 0; j < 65536; j++)
{
msg[1] = (j >> 8) & 0xFF;
printf("%s\n", real_country);
else
printf("???\n");
- first_hit = FALSE;
+ first_hit = false;
}
printf(" 0x%02x 0x%02x 0x%02x '%s'\n", msg[0], msg[1], msg[2], vendor);
}
#define MAX_FIELDS 42
#define MAX_FIELD_LEN 8192
+static bool succeeded = true;
static int t38_version;
-static int succeeded = TRUE;
static int ok_indicator_packets;
static int bad_indicator_packets;
static int ok_data_packets;
t = (t38_core_state_t *) user_data;
span_log(t38_core_get_logging_state(s), SPAN_LOG_FLOW, "Send seq %d, len %d, count %d\n", s->tx_seq_no, len, count);
if (t38_core_rx_ifp_packet(t, buf, len, seq_no) < 0)
- succeeded = FALSE;
+ succeeded = false;
seq_no++;
return 0;
}
for (i = 0, seq_no = 0; i < concat_len; i += len)
{
if ((len = t38_core_rx_ifp_stream(b, &concat[i], concat_len - i, seq_no)) < 0)
- succeeded = FALSE;
+ succeeded = false;
seq_no++;
}
t38_set_t38_version(t38_core_a, t38_version);
t38_set_t38_version(t38_core_b, t38_version);
- t38_set_pace_transmission(t38_core_a, FALSE);
- t38_set_pace_transmission(t38_core_b, FALSE);
+ t38_set_pace_transmission(t38_core_a, false);
+ t38_set_pace_transmission(t38_core_b, false);
t38_set_data_transport_protocol(t38_core_a, T38_TRANSPORT_TCP);
t38_set_data_transport_protocol(t38_core_b, T38_TRANSPORT_TCP);
t38_set_t38_version(t38_core_a, t38_version);
- t38_set_pace_transmission(t38_core_a, FALSE);
+ t38_set_pace_transmission(t38_core_a, false);
t38_set_data_transport_protocol(t38_core_a, T38_TRANSPORT_TCP);
t38_set_t38_version(t38_core_a, t38_version);
t38_set_t38_version(t38_core_b, t38_version);
- t38_set_pace_transmission(t38_core_a, FALSE);
- t38_set_pace_transmission(t38_core_b, FALSE);
+ t38_set_pace_transmission(t38_core_a, false);
+ t38_set_pace_transmission(t38_core_b, false);
t38_set_data_transport_protocol(t38_core_a, T38_TRANSPORT_TCP_TPKT);
t38_set_data_transport_protocol(t38_core_b, T38_TRANSPORT_TCP_TPKT);
}
t38_set_t38_version(t38_core_a, t38_version);
- t38_set_pace_transmission(t38_core_a, FALSE);
+ t38_set_pace_transmission(t38_core_a, false);
t38_set_data_transport_protocol(t38_core_a, T38_TRANSPORT_TCP_TPKT);
static int log_audio;
static int use_transmit_on_idle;
-static int done = FALSE;
+static int done = false;
-static int started = FALSE;
+static int started = false;
static int64_t current = 0;
static int phase_b_handler(t30_state_t *s, void *user_data, int result)
{
int i;
- started = TRUE;
+ started = true;
printf("%5d >>> ", seq_no);
for (i = 0; i < len; i++)
uint32_t dest_addr;
uint16_t dest_port;
- caller = FALSE;
- use_ecm = FALSE;
+ caller = false;
+ use_ecm = false;
t38_version = 0;
options = 0;
input_file_name = INPUT_FILE_NAME;
- fill_removal = FALSE;
- use_tep = FALSE;
- use_transmit_on_idle = TRUE;
+ fill_removal = false;
+ use_tep = false;
+ use_transmit_on_idle = true;
supported_modems = T30_SUPPORT_V27TER | T30_SUPPORT_V29 | T30_SUPPORT_V17;
- t38_terminal_operation = TRUE;
- log_audio = FALSE;
+ t38_terminal_operation = true;
+ log_audio = false;
src_addr = 0;
src_port = 0;
dest_addr = 0;
switch (opt)
{
case 'c':
- caller = TRUE;
+ caller = true;
break;
case 'D':
dest_addr = parse_inet_addr(optarg);
dest_port = atoi(optarg);
break;
case 'e':
- use_ecm = TRUE;
+ use_ecm = true;
break;
case 'F':
- fill_removal = TRUE;
+ fill_removal = true;
break;
case 'G':
- t38_terminal_operation = FALSE;
+ t38_terminal_operation = false;
break;
case 'i':
input_file_name = optarg;
break;
case 'l':
- log_audio = TRUE;
+ log_audio = true;
break;
case 'm':
supported_modems = atoi(optarg);
src_port = atoi(optarg);
break;
case 't':
- use_tep = TRUE;
+ use_tep = true;
break;
case 'v':
t38_version = atoi(optarg);
span_log_set_protocol(&logging, "Buffer");
printf("1 - Impose no minimum for the bits per row\n");
- t38_non_ecm_buffer_init(&buffer, TRUE, 0);
+ t38_non_ecm_buffer_init(&buffer, true, 0);
n = 0;
bit_no = 0;
/* We should get ones until the buffers recognises an EOL */
t38_non_ecm_buffer_report_output_status(&buffer, &logging);
printf("2 - Impose no minimum for the bits per row, different alignment\n");
- t38_non_ecm_buffer_init(&buffer, TRUE, 0);
+ t38_non_ecm_buffer_init(&buffer, true, 0);
n = 0;
memset(buf, 0, sizeof(buf));
/* The first one in this should be seen as the first EOL */
t38_non_ecm_buffer_report_output_status(&buffer, &logging);
printf("3 - Demand a fairly high minimum for the bits per row\n");
- t38_non_ecm_buffer_init(&buffer, TRUE, 400);
+ t38_non_ecm_buffer_init(&buffer, true, 400);
n = 0;
memset(buf, 0, sizeof(buf));
/* The first one in this should be seen as the first EOL */
t38_non_ecm_buffer_report_output_status(&buffer, &logging);
printf("4 - Take some time to get to the first row of the image, output ahead\n");
- t38_non_ecm_buffer_init(&buffer, TRUE, 400);
+ t38_non_ecm_buffer_init(&buffer, true, 400);
n = 0;
/* Get some initial bits from an empty buffer. These should be ones */
for (i = 0; i < 1000; i++)
t38_non_ecm_buffer_report_output_status(&buffer, &logging);
printf("5 - Take some time to get to the first row of the image, output behind\n");
- t38_non_ecm_buffer_init(&buffer, TRUE, 400);
+ t38_non_ecm_buffer_init(&buffer, true, 400);
n = 0;
/* Inject some ones. */
memset(buf, 0xFF, 100);
t38_non_ecm_buffer_report_output_status(&buffer, &logging);
printf("6 - TCF without leading ones\n");
- t38_non_ecm_buffer_init(&buffer, FALSE, 400);
+ t38_non_ecm_buffer_init(&buffer, false, 400);
n = 0;
/* Get some initial bits from an empty buffer. These should be ones */
for (i = 0; i < 1000; i++)
t38_non_ecm_buffer_report_output_status(&buffer, &logging);
printf("7 - TCF with leading ones\n");
- t38_non_ecm_buffer_init(&buffer, FALSE, 400);
+ t38_non_ecm_buffer_init(&buffer, false, 400);
n = 0;
/* Get some initial bits from an empty buffer. These should be ones */
for (i = 0; i < 1000; i++)
/* The default luminant is D50 */
set_lab_illuminant(&lab_param, 96.422f, 100.000f, 82.521f);
- set_lab_gamut(&lab_param, 0, 100, -85, 85, -75, 125, FALSE);
+ set_lab_gamut(&lab_param, 0, 100, -85, 85, -75, 125, false);
source_file = (argc > 1) ? argv[1] : IN_FILE_NAME;
/* sRGB to ITU */
/* The default luminant is D50 */
set_lab_illuminant(&lab, 96.422f, 100.000f, 82.521f);
- set_lab_gamut(&lab, 0, 100, -85, 85, -75, 125, FALSE);
+ set_lab_gamut(&lab, 0, 100, -85, 85, -75, 125, false);
lab_to_srgb(&lab, colour_map, colour_map, 256);
for (i = 0; i < (1 << bits_per_pixel); i++)
printf("Map %3d - %5d %5d %5d\n", i, colour_map[3*i], colour_map[3*i + 1], colour_map[3*i + 2]);
{
printf("There is no colour map\n");
}
- process_raw = FALSE;
+ process_raw = false;
printf("Compression is ");
switch (compression)
{
return 0;
case COMPRESSION_T85:
printf("T.85\n");
- process_raw = TRUE;
+ process_raw = true;
break;
case COMPRESSION_T43:
printf("T.43\n");
- process_raw = TRUE;
+ process_raw = true;
break;
case COMPRESSION_JPEG:
printf("JPEG");
if (photometric == PHOTOMETRIC_ITULAB)
{
printf(" ITULAB");
- process_raw = TRUE;
+ process_raw = true;
}
printf("\n");
break;
printf("CIELAB\n");
/* The default luminant is D50 */
set_lab_illuminant(&lab_param, 96.422f, 100.000f, 82.521f);
- set_lab_gamut(&lab_param, 0, 100, -128, 127, -128, 127, TRUE);
+ set_lab_gamut(&lab_param, 0, 100, -128, 127, -128, 127, true);
lab_to_srgb(&lab_param, data, data, w*h);
break;
case PHOTOMETRIC_ITULAB:
/* The default luminant is D50 */
set_lab_illuminant(&lab_param, 96.422f, 100.000f, 82.521f);
- set_lab_gamut(&lab_param, 0, 100, -85, 85, -75, 125, FALSE);
+ set_lab_gamut(&lab_param, 0, 100, -85, 85, -75, 125, false);
break;
}
//if (!t42_srgb_to_itulab_jpeg(logging, &lab_param, (tdata_t) &outptr, &outsize, data, off, w, h, 3))
totdata = h*bytes_per_row;
/* The default luminant is D50 */
set_lab_illuminant(&lab_param, 96.422f, 100.000f, 82.521f);
- set_lab_gamut(&lab_param, 0, 100, -85, 85, -75, 125, FALSE);
+ set_lab_gamut(&lab_param, 0, 100, -85, 85, -75, 125, false);
#if 0
start = rdtscll();
data2 = NULL;
/* TIFF-FX related extensions to the tag set supported by libtiff */
static const TIFFFieldInfo tiff_fx_tiff_field_info[] =
{
- {TIFFTAG_INDEXED, 1, 1, TIFF_SHORT, FIELD_CUSTOM, FALSE, FALSE, (char *) "Indexed"},
- {TIFFTAG_GLOBALPARAMETERSIFD, 1, 1, TIFF_IFD8, FIELD_CUSTOM, FALSE, FALSE, (char *) "GlobalParametersIFD"},
- {TIFFTAG_PROFILETYPE, 1, 1, TIFF_LONG, FIELD_CUSTOM, FALSE, FALSE, (char *) "ProfileType"},
- {TIFFTAG_FAXPROFILE, 1, 1, TIFF_BYTE, FIELD_CUSTOM, FALSE, FALSE, (char *) "FaxProfile"},
- {TIFFTAG_CODINGMETHODS, 1, 1, TIFF_LONG, FIELD_CUSTOM, FALSE, FALSE, (char *) "CodingMethods"},
- {TIFFTAG_VERSIONYEAR, 4, 4, TIFF_BYTE, FIELD_CUSTOM, FALSE, FALSE, (char *) "VersionYear"},
- {TIFFTAG_MODENUMBER, 1, 1, TIFF_BYTE, FIELD_CUSTOM, FALSE, FALSE, (char *) "ModeNumber"},
- {TIFFTAG_DECODE, TIFF_VARIABLE, TIFF_VARIABLE, TIFF_SRATIONAL, FIELD_CUSTOM, FALSE, TRUE, (char *) "Decode"},
- {TIFFTAG_IMAGEBASECOLOR, TIFF_VARIABLE, TIFF_VARIABLE, TIFF_SHORT, FIELD_CUSTOM, FALSE, TRUE, (char *) "ImageBaseColor"},
- {TIFFTAG_T82OPTIONS, 1, 1, TIFF_LONG, FIELD_CUSTOM, FALSE, FALSE, (char *) "T82Options"},
- {TIFFTAG_STRIPROWCOUNTS, TIFF_VARIABLE, TIFF_VARIABLE, TIFF_LONG, FIELD_CUSTOM, FALSE, TRUE, (char *) "StripRowCounts"},
- {TIFFTAG_IMAGELAYER, 2, 2, TIFF_LONG, FIELD_CUSTOM, FALSE, FALSE, (char *) "ImageLayer"},
+ {TIFFTAG_INDEXED, 1, 1, TIFF_SHORT, FIELD_CUSTOM, false, false, (char *) "Indexed"},
+ {TIFFTAG_GLOBALPARAMETERSIFD, 1, 1, TIFF_IFD8, FIELD_CUSTOM, false, false, (char *) "GlobalParametersIFD"},
+ {TIFFTAG_PROFILETYPE, 1, 1, TIFF_LONG, FIELD_CUSTOM, false, false, (char *) "ProfileType"},
+ {TIFFTAG_FAXPROFILE, 1, 1, TIFF_BYTE, FIELD_CUSTOM, false, false, (char *) "FaxProfile"},
+ {TIFFTAG_CODINGMETHODS, 1, 1, TIFF_LONG, FIELD_CUSTOM, false, false, (char *) "CodingMethods"},
+ {TIFFTAG_VERSIONYEAR, 4, 4, TIFF_BYTE, FIELD_CUSTOM, false, false, (char *) "VersionYear"},
+ {TIFFTAG_MODENUMBER, 1, 1, TIFF_BYTE, FIELD_CUSTOM, false, false, (char *) "ModeNumber"},
+ {TIFFTAG_DECODE, TIFF_VARIABLE, TIFF_VARIABLE, TIFF_SRATIONAL, FIELD_CUSTOM, false, true, (char *) "Decode"},
+ {TIFFTAG_IMAGEBASECOLOR, TIFF_VARIABLE, TIFF_VARIABLE, TIFF_SHORT, FIELD_CUSTOM, false, true, (char *) "ImageBaseColor"},
+ {TIFFTAG_T82OPTIONS, 1, 1, TIFF_LONG, FIELD_CUSTOM, false, false, (char *) "T82Options"},
+ {TIFFTAG_STRIPROWCOUNTS, TIFF_VARIABLE, TIFF_VARIABLE, TIFF_LONG, FIELD_CUSTOM, false, true, (char *) "StripRowCounts"},
+ {TIFFTAG_IMAGELAYER, 2, 2, TIFF_LONG, FIELD_CUSTOM, false, false, (char *) "ImageLayer"},
};
static TIFFFieldArray tifffxFieldArray;
#endif
/* The default luminant is D50 */
set_lab_illuminant(&lab_param, 96.422f, 100.000f, 82.521f);
- set_lab_gamut(&lab, 0, 100, -85, 85, -75, 125, FALSE);
+ set_lab_gamut(&lab, 0, 100, -85, 85, -75, 125, false);
lab_to_srgb(&lab, meta->colour_map, meta->colour_map, 256);
for (i = 0; i < entries; i++)
printf("Map %3d - %5d %5d %5d\n", i, meta->colour_map[3*i], meta->colour_map[3*i + 1], meta->colour_map[3*i + 2]);
/* The default luminant is D50 */
set_lab_illuminant(&lab_param, 96.422f, 100.000f, 82.521f);
- set_lab_gamut(&lab_param, 0, 100, -85, 85, -75, 125, FALSE);
+ set_lab_gamut(&lab_param, 0, 100, -85, 85, -75, 125, false);
outptr = NULL;
for (page_no = 0; ; page_no++)
printf("Bi-level\n");
/* We have finished acquiring the image. Now we need to push it out */
- meta.pre_compressed = FALSE;
+ meta.pre_compressed = false;
meta.image_width = in_meta.image_width;
meta.image_length = in_meta.image_length;
meta.x_resolution = in_meta.x_resolution;
off = in_meta.samples_per_pixel*in_meta.image_width*in_meta.image_length;
/* We have finished acquiring the image. Now we need to push it out */
- meta.pre_compressed = FALSE;
+ meta.pre_compressed = false;
meta.image_width = in_meta.image_width;
meta.image_length = in_meta.image_length;
meta.x_resolution = in_meta.x_resolution;
free(data);
data = (uint8_t *) outptr;
- meta.pre_compressed = FALSE;
+ meta.pre_compressed = false;
meta.image_width = in_meta.image_width;
meta.image_length = in_meta.image_length;
meta.x_resolution = in_meta.x_resolution;
/* Convert this to sRGB first */
/* The default luminant is D50 */
set_lab_illuminant(&lab_param, 96.422f, 100.000f, 82.521f);
- set_lab_gamut(&lab_param, 0, 100, -128, 127, -128, 127, TRUE);
+ set_lab_gamut(&lab_param, 0, 100, -128, 127, -128, 127, true);
lab_to_srgb(&lab_param, data, data, in_meta.image_width*in_meta.image_length);
break;
case PHOTOMETRIC_RGB:
#if 0
/* The default luminant is D50 */
set_lab_illuminant(&lab_param, 96.422f, 100.000f, 82.521f);
- set_lab_gamut(&lab_param, 0, 100, -85, 85, -75, 125, FALSE);
+ set_lab_gamut(&lab_param, 0, 100, -85, 85, -75, 125, false);
if (!t42_srgb_to_itulab_jpeg(&logging2, &lab_param, (tdata_t) &outptr, &outsize, data, off, in_meta.image_width, in_meta.image_length, 3))
{
printf("Failed to convert to ITULAB (B).\n");
off = outsize;
#endif
#endif
- meta.pre_compressed = FALSE;
+ meta.pre_compressed = false;
meta.image_width = in_meta.image_width;
meta.image_length = in_meta.image_length;
meta.x_resolution = in_meta.x_resolution;
/* Convert this to sRGB first */
/* The default luminant is D50 */
set_lab_illuminant(&lab_param, 96.422f, 100.000f, 82.521f);
- set_lab_gamut(&lab_param, 0, 100, -128, 127, -128, 127, TRUE);
+ set_lab_gamut(&lab_param, 0, 100, -128, 127, -128, 127, true);
lab_to_srgb(&lab_param, data, data, in_meta.image_width*in_meta.image_length);
break;
case PHOTOMETRIC_SEPARATED:
/* The default luminant is D50 */
set_lab_illuminant(&lab_param, 96.422f, 100.000f, 82.521f);
- set_lab_gamut(&lab_param, 0, 100, -85, 85, -75, 125, FALSE);
+ set_lab_gamut(&lab_param, 0, 100, -85, 85, -75, 125, false);
//if (!t42_srgb_to_itulab_jpeg(&logging2, &lab_param, (tdata_t) &outptr, &outsize, data, off, in_meta.image_width, in_meta.image_length, 3))
{
printf("Failed to convert to ITULAB (D).\n");
off = outsize;
in_meta.bits_per_sample = 8;
}
- meta.pre_compressed = FALSE;
+ meta.pre_compressed = false;
meta.image_width = in_meta.image_width;
meta.image_length = in_meta.image_length;
meta.x_resolution = in_meta.x_resolution;
/* We now have the image in memory in ITULAB form */
- meta.pre_compressed = FALSE;
+ meta.pre_compressed = false;
meta.compressed_image_len = off;
meta.image_width = in_meta.image_width;
meta.image_length = in_meta.image_length;
totdata = meta.image_length*bytes_per_row;
/* The default luminant is D50 */
set_lab_illuminant(&lab_param, 96.422f, 100.000f, 82.521f);
- set_lab_gamut(&lab_param, 0, 100, -85, 85, -75, 125, FALSE);
+ set_lab_gamut(&lab_param, 0, 100, -85, 85, -75, 125, false);
#if 0
start = rdtscll();
data2 = NULL;
}
}
- end_of_page = FALSE;
+ end_of_page = false;
#if 1
printf("Testing image_function->compress->decompress->image_function\n");
/* Send end gets image from a function */
switch (block_size)
{
case 0:
- end_of_page = FALSE;
+ end_of_page = false;
for (;;)
{
bit = t4_t6_encode_get_bit(send_state);
int res;
int compression;
int compression_step;
- int add_page_headers;
- int overlay_page_headers;
int min_row_bits;
- int restart_pages;
int block_size;
char buf[1024];
uint8_t block[1024];
int len;
int i;
int bit_error_rate;
- int dump_as_xxx;
int tests_failed;
+ bool restart_pages;
+ bool add_page_headers;
+ bool overlay_page_headers;
+ bool dump_as_xxx;
unsigned int last_pkt_no;
unsigned int pkt_no;
int page_ended;
tests_failed = 0;
compression = -1;
compression_step = 0;
- add_page_headers = FALSE;
- overlay_page_headers = FALSE;
- restart_pages = FALSE;
+ add_page_headers = false;
+ overlay_page_headers = false;
+ restart_pages = false;
in_file_name = IN_FILE_NAME;
decode_file_name = NULL;
page_header_tz = NULL;
min_row_bits = 50;
block_size = 1;
bit_error_rate = 0;
- dump_as_xxx = FALSE;
+ dump_as_xxx = false;
while ((opt = getopt(argc, argv, "b:c:d:ehHri:m:t:x")) != -1)
{
switch (opt)
bit_error_rate = 0x3FF;
break;
case 'h':
- add_page_headers = TRUE;
- overlay_page_headers = FALSE;
+ add_page_headers = true;
+ overlay_page_headers = false;
break;
case 'H':
- add_page_headers = TRUE;
- overlay_page_headers = TRUE;
+ add_page_headers = true;
+ overlay_page_headers = true;
break;
case 'r':
- restart_pages = TRUE;
+ restart_pages = true;
break;
case 'i':
in_file_name = optarg;
page_header_tz = optarg;
break;
case 'x':
- dump_as_xxx = TRUE;
+ dump_as_xxx = true;
break;
default:
//usage();
}
t4_rx_start_page(receive_state);
detect_non_ecm_page_end(-1, compression);
- page_ended = FALSE;
+ page_ended = false;
switch (block_size)
{
case 0:
#define MSG_SIZE 10000
-#define FALSE 0
-#define TRUE (!FALSE)
-
uint8_t msg[MSG_SIZE];
int32_t msg_len;
printf("Arithmetic decoder tests from ITU-T T.82/7.1\n");
printf("Decoding byte by byte...\n");
- test_failed = FALSE;
+ test_failed = false;
if ((sd = t81_t82_arith_decode_init(NULL)) == NULL)
{
fprintf(stderr, "Failed to allocate arithmetic decoder!\n");
printf("Bad pixel %d, byte %" PRIdPTR ".\n\n",
i*16 + j + 1,
sd->pscd_ptr - sd->pscd_end);
- test_failed = TRUE;
+ test_failed = true;
break;
}
if (pix != ((pix_7_1[i] >> (15 - j)) & 1))
printf("Bad PIX (%d) at pixel %d.\n\n",
pix,
i*16 + j + 1);
- test_failed = TRUE;
+ test_failed = true;
break;
}
}
{
printf("%" PRIdPTR " bytes left after decoder finished.\n\n",
sd->pscd_end - sd->pscd_ptr - 2);
- test_failed = TRUE;
+ test_failed = true;
}
if (test_failed)
{
printf("Test passed\n");
printf("Decoding chunk by chunk...\n");
- test_failed = FALSE;
+ test_failed = false;
t81_t82_arith_decode_init(sd);
sd->pscd_ptr = sde_7_1;
sd->pscd_end = sde_7_1 + SDE_7_1_FULL_LEN;
printf("Bad pixel %d, byte %" PRIdPTR ".\n\n",
i*16 + j + 1,
sd->pscd_ptr - sd->pscd_end);
- test_failed = TRUE;
+ test_failed = true;
break;
}
if (pix != ((pix_7_1[i] >> (15 - j)) & 1))
printf("Bad PIX (%d) at pixel %d.\n\n",
pix,
i*16 + j + 1);
- test_failed = TRUE;
+ test_failed = true;
break;
}
}
{
printf("%" PRIdPTR " bytes left after decoder finished.\n\n",
sd->pscd_end - sd->pscd_ptr - 2);
- test_failed = TRUE;
+ test_failed = true;
}
if (test_failed)
{
#define TESTBUF_SIZE 400000
#define TEST_IMAGE_SIZE (1951*1960/8)
-#define FALSE 0
-#define TRUE (!FALSE)
-
uint8_t testbuf[TESTBUF_SIZE];
uint8_t test_image[TEST_IMAGE_SIZE];
float rate;
float sample_rate;
const char *in_file_name;
- int sweep_rate;
+ bool sweep_rate;
int opt;
rate = 1.8f;
- sweep_rate = FALSE;
+ sweep_rate = false;
in_file_name = IN_FILE_NAME;
while ((opt = getopt(argc, argv, "i:r:s")) != -1)
{
rate = atof(optarg);
break;
case 's':
- sweep_rate = TRUE;
+ sweep_rate = true;
break;
default:
//usage();
#include "spandsp.h"
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#ifndef TRUE
-#define TRUE (!FALSE)
-#endif
-
int main(int argc, char *argv[])
{
struct tm tms;
200,
300,
400,
- FALSE);
+ false);
tone_gen_init(&tone_state, &tone_desc);
for (i = 0; i < 1000; i++)
300,
200,
100,
- TRUE);
+ true);
tone_gen_init(&tone_state, &tone_desc);
for (i = 0; i < 1000; i++)
200,
300,
400,
- TRUE);
+ true);
tone_gen_init(&tone_state, &tone_desc);
for (i = 0; i < 1000; i++)
200,
300,
400,
- TRUE);
+ true);
tone_gen_init(&tone_state, &tone_desc);
for (i = 0; i < 1000; i++)
0,
0,
0,
- FALSE);
+ false);
tone_gen_init(&tone_state, &tone_desc);
for (i = 0; i < 1000; i++)
0,
0,
0,
- FALSE);
+ false);
tone_gen_init(&tone_state, &tone_desc);
for (i = 0; i < 1000; i++)
200,
300,
400,
- TRUE);
+ true);
tone_gen_init(&tone_state, &tone_desc);
for (i = 0; i < 1000; i++)
200,
300,
400,
- TRUE);
+ true);
tone_gen_init(&tone_state, &tone_desc);
for (i = 0; i < 1000; i++)
SNDFILE *out_handle;
-int use_receiver_not_ready = FALSE;
-int test_local_interrupt = FALSE;
+bool use_receiver_not_ready = false;
+bool test_local_interrupt = false;
const char *output_tiff_file_name;
-int log_audio = FALSE;
+bool log_audio = false;
fax_state_t *fax;
faxtester_state_t state;
if (i == 'A')
{
printf("%c: Initiating interrupt request\n", i);
- t30_local_interrupt_request(s, TRUE);
+ t30_local_interrupt_request(s, true);
}
else
{
case T30_PRI_EOM:
case T30_PRI_EOP:
printf("%c: Accepting interrupt request\n", i);
- t30_local_interrupt_request(s, TRUE);
+ t30_local_interrupt_request(s, true);
break;
case T30_PIN:
break;
static void t30_real_time_frame_handler(t30_state_t *s,
void *user_data,
- int direction,
+ bool incoming,
const uint8_t *msg,
int len)
{
{
fprintf(stderr,
"T.30: Real time frame handler - %s, %s, length = %d\n",
- (direction) ? "line->T.30" : "T.30->line",
+ (incoming) ? "line->T.30" : "T.30->line",
t30_frametype(msg[2]),
len);
}
{
t30_set_tx_file(s, next_tx_file, -1, -1);
next_tx_file[0] = '\0';
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
/*- End of function --------------------------------------------------------*/
logging_state_t *logging;
t30 = fax_get_t30_state(fax);
- fax_set_transmit_on_idle(fax, TRUE);
- fax_set_tep_mode(fax, TRUE);
+ fax_set_transmit_on_idle(fax, true);
+ fax_set_tep_mode(fax, true);
#if 0
t30_set_tx_ident(t30, "1234567890");
t30_set_tx_sub_address(t30, "Sub-address");
t30_set_tx_nsf(t30, (const uint8_t *) "\x50\x00\x00\x00Spandsp NSF\x00", 16);
//t30_set_tx_nss(t30, (const uint8_t *) "\x50\x00\x00\x00Spandsp NSS\x00", 16);
t30_set_tx_nsc(t30, (const uint8_t *) "\x50\x00\x00\x00Spandsp NSC\x00", 16);
- t30_set_ecm_capability(t30, TRUE);
+ t30_set_ecm_capability(t30, true);
t30_set_supported_t30_features(t30,
T30_SUPPORT_IDENTIFICATION
| T30_SUPPORT_SELECTIVE_POLLING
/* Add a bit of waiting at the end, to ensure everything gets flushed through,
any timers can expire, etc. */
faxtester_set_timeout(s, -1);
- faxtester_set_rx_type(s, T30_MODEM_NONE, 0, FALSE, FALSE);
- faxtester_set_tx_type(s, T30_MODEM_PAUSE, 0, 120000, FALSE);
- s->final_delayed = TRUE;
+ faxtester_set_rx_type(s, T30_MODEM_NONE, 0, false, false);
+ faxtester_set_tx_type(s, T30_MODEM_PAUSE, 0, 120000, false);
+ s->final_delayed = true;
return 1;
}
/* Finished */
{
hdlc = (strcasecmp((const char *) type, "PREAMBLE") == 0);
short_train = (strcasecmp((const char *) type, "TCF") != 0);
- faxtester_set_tx_type(s, T30_MODEM_NONE, 0, FALSE, FALSE);
+ faxtester_set_tx_type(s, T30_MODEM_NONE, 0, false, false);
if (strcasecmp((const char *) modem, "V.21") == 0)
{
- faxtester_set_rx_type(s, T30_MODEM_V21, 300, FALSE, TRUE);
+ faxtester_set_rx_type(s, T30_MODEM_V21, 300, false, true);
}
else if (strcasecmp((const char *) modem, "V.17/14400") == 0)
{
}
else if (strcasecmp((const char *) modem, "V.29/9600") == 0)
{
- faxtester_set_rx_type(s, T30_MODEM_V29, 9600, FALSE, hdlc);
+ faxtester_set_rx_type(s, T30_MODEM_V29, 9600, false, hdlc);
}
else if (strcasecmp((const char *) modem, "V.29/7200") == 0)
{
- faxtester_set_rx_type(s, T30_MODEM_V29, 7200, FALSE, hdlc);
+ faxtester_set_rx_type(s, T30_MODEM_V29, 7200, false, hdlc);
}
else if (strcasecmp((const char *) modem, "V.27ter/4800") == 0)
{
- faxtester_set_rx_type(s, T30_MODEM_V27TER, 4800, FALSE, hdlc);
+ faxtester_set_rx_type(s, T30_MODEM_V27TER, 4800, false, hdlc);
}
else if (strcasecmp((const char *) modem, "V.27ter/2400") == 0)
{
- faxtester_set_rx_type(s, T30_MODEM_V27TER, 2400, FALSE, hdlc);
+ faxtester_set_rx_type(s, T30_MODEM_V27TER, 2400, false, hdlc);
}
else
{
else if (strcasecmp((const char *) type, "CNG") == 0)
{
/* Look for CNG */
- faxtester_set_rx_type(s, T30_MODEM_CNG, 0, FALSE, FALSE);
- faxtester_set_tx_type(s, T30_MODEM_NONE, 0, FALSE, FALSE);
+ faxtester_set_rx_type(s, T30_MODEM_CNG, 0, false, false);
+ faxtester_set_tx_type(s, T30_MODEM_NONE, 0, false, false);
}
else if (strcasecmp((const char *) type, "CED") == 0)
{
/* Look for CED */
- faxtester_set_rx_type(s, T30_MODEM_CED, 0, FALSE, FALSE);
- faxtester_set_tx_type(s, T30_MODEM_NONE, 0, FALSE, FALSE);
+ faxtester_set_rx_type(s, T30_MODEM_CED, 0, false, false);
+ faxtester_set_tx_type(s, T30_MODEM_NONE, 0, false, false);
}
else if (strcasecmp((const char *) type, "HDLC") == 0)
{
{
hdlc = (strcasecmp((const char *) type, "PREAMBLE") == 0);
short_train = (strcasecmp((const char *) type, "TCF") != 0);
- faxtester_set_rx_type(s, T30_MODEM_NONE, 0, FALSE, FALSE);
+ faxtester_set_rx_type(s, T30_MODEM_NONE, 0, false, false);
if (strcasecmp((const char *) modem, "V.21") == 0)
{
- faxtester_set_tx_type(s, T30_MODEM_V21, 300, FALSE, TRUE);
+ faxtester_set_tx_type(s, T30_MODEM_V21, 300, false, true);
}
else if (strcasecmp((const char *) modem, "V.17/14400") == 0)
{
}
else if (strcasecmp((const char *) modem, "V.29/9600") == 0)
{
- faxtester_set_tx_type(s, T30_MODEM_V29, 9600, FALSE, hdlc);
+ faxtester_set_tx_type(s, T30_MODEM_V29, 9600, false, hdlc);
}
else if (strcasecmp((const char *) modem, "V.29/7200") == 0)
{
- faxtester_set_tx_type(s, T30_MODEM_V29, 7200, FALSE, hdlc);
+ faxtester_set_tx_type(s, T30_MODEM_V29, 7200, false, hdlc);
}
else if (strcasecmp((const char *) modem, "V.27ter/4800") == 0)
{
- faxtester_set_tx_type(s, T30_MODEM_V27TER, 4800, FALSE, hdlc);
+ faxtester_set_tx_type(s, T30_MODEM_V27TER, 4800, false, hdlc);
}
else if (strcasecmp((const char *) modem, "V.27ter/2400") == 0)
{
- faxtester_set_tx_type(s, T30_MODEM_V27TER, 2400, FALSE, hdlc);
+ faxtester_set_tx_type(s, T30_MODEM_V27TER, 2400, false, hdlc);
}
else
{
}
else if (strcasecmp((const char *) type, "CALL") == 0)
{
- fax = fax_init(NULL, FALSE);
+ fax = fax_init(NULL, false);
fax_prepare();
next_tx_file[0] = '\0';
t30 = fax_get_t30_state(fax);
}
else if (strcasecmp((const char *) type, "ANSWER") == 0)
{
- fax = fax_init(NULL, TRUE);
+ fax = fax_init(NULL, true);
fax_prepare();
next_tx_file[0] = '\0';
t30 = fax_get_t30_state(fax);
}
else if (strcasecmp((const char *) type, "CNG") == 0)
{
- faxtester_set_rx_type(s, T30_MODEM_NONE, 0, FALSE, FALSE);
- faxtester_set_tx_type(s, T30_MODEM_CNG, 0, FALSE, FALSE);
+ faxtester_set_rx_type(s, T30_MODEM_NONE, 0, false, false);
+ faxtester_set_tx_type(s, T30_MODEM_CNG, 0, false, false);
}
else if (strcasecmp((const char *) type, "CED") == 0)
{
- faxtester_set_rx_type(s, T30_MODEM_NONE, 0, FALSE, FALSE);
- faxtester_set_tx_type(s, T30_MODEM_CED, 0, FALSE, FALSE);
+ faxtester_set_rx_type(s, T30_MODEM_NONE, 0, false, false);
+ faxtester_set_tx_type(s, T30_MODEM_CED, 0, false, false);
}
else if (strcasecmp((const char *) type, "WAIT") == 0)
{
delay = (value) ? atoi((const char *) value) : 1;
- faxtester_set_rx_type(s, T30_MODEM_NONE, 0, FALSE, FALSE);
- faxtester_set_tx_type(s, T30_MODEM_PAUSE, 0, delay, FALSE);
+ faxtester_set_rx_type(s, T30_MODEM_NONE, 0, false, false);
+ faxtester_set_tx_type(s, T30_MODEM_PAUSE, 0, delay, false);
}
else if (strcasecmp((const char *) type, "PREAMBLE") == 0)
{
i = string_to_msg(buf, mask, (const char *) value);
bit_reverse(buf, buf, abs(i));
if (crc_error && strcasecmp((const char *) crc_error, "0") == 0)
- faxtester_send_hdlc_msg(s, buf, abs(i), FALSE);
+ faxtester_send_hdlc_msg(s, buf, abs(i), false);
else
- faxtester_send_hdlc_msg(s, buf, abs(i), TRUE);
+ faxtester_send_hdlc_msg(s, buf, abs(i), true);
}
else if (strcasecmp((const char *) type, "TCF") == 0)
{
total_audio_time = 0;
- faxtester_set_transmit_on_idle(&state, TRUE);
+ faxtester_set_transmit_on_idle(&state, true);
faxtester_set_real_time_frame_handler(&state, faxtester_real_time_frame_handler, NULL);
faxtester_set_front_end_step_complete_handler(&state, faxtester_front_end_step_complete_handler, NULL);
faxtester_set_front_end_step_timeout_handler(&state, faxtester_front_end_step_timeout_handler, NULL);
- fax = fax_init(NULL, FALSE);
+ fax = fax_init(NULL, false);
fax_prepare();
next_tx_file[0] = '\0';
xml_file_name = "../spandsp/tsb85.xml";
test_name = "MRGN01";
- log_audio = FALSE;
+ log_audio = false;
while ((opt = getopt(argc, argv, "lx:")) != -1)
{
switch (opt)
{
case 'l':
- log_audio = TRUE;
+ log_audio = true;
break;
case 'x':
xml_file_name = optarg;
test_name = argv[0];
strcpy(image_path, ".");
- faxtester_init(&state, TRUE);
+ faxtester_init(&state, true);
memset(&expected_rx_info, 0, sizeof(expected_rx_info));
span_log_set_level(&state.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME | SPAN_LOG_FLOW);
span_log_set_tag(&state.logging, "B");
#include <sys/types.h>
#include <inttypes.h>
#include <memory.h>
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
+#else
+#include <spandsp/stdbool.h>
+#endif
#include "udptl.h"
-#if !defined(FALSE)
-#define FALSE 0
-#endif
-#if !defined(TRUE)
-#define TRUE (!FALSE)
-#endif
-
static int decode_length(const uint8_t *buf, int limit, int *len, int *pvalue)
{
if (*len >= limit)
s->rx[x].fec_span = span;
memset(repaired, 0, sizeof(repaired));
- repaired[x] = TRUE;
+ repaired[x] = true;
/* The number of entries is defined as a length, but will only ever be a small
value. Treat it as such. */
}
}
s->rx[which].buf_len = s->rx[l].fec_len[m];
- repaired[which] = TRUE;
+ repaired[which] = true;
}
}
}
#define OUT_FILE_NAME "v17.wav"
char *decode_test_file = NULL;
-int use_gui = FALSE;
+bool use_gui = false;
int symbol_no = 0;
SNDFILE *outhandle;
int outframes;
int samples;
- int tep;
int block_no;
int noise_level;
int signal_level;
int bits_per_test;
int line_model_no;
- int log_audio;
int channel_codec;
int rbs_pattern;
int opt;
+ bool tep;
+ bool log_audio;
logging_state_t *logging;
channel_codec = MUNGE_CODEC_NONE;
rbs_pattern = 0;
test_bps = 14400;
- tep = FALSE;
+ tep = false;
line_model_no = 0;
decode_test_file = NULL;
- use_gui = FALSE;
+ use_gui = false;
noise_level = -70;
signal_level = -13;
bits_per_test = 50000;
- log_audio = FALSE;
+ log_audio = false;
while ((opt = getopt(argc, argv, "b:B:c:d:glm:n:r:s:t")) != -1)
{
switch (opt)
break;
case 'g':
#if defined(ENABLE_GUI)
- use_gui = TRUE;
+ use_gui = true;
#else
fprintf(stderr, "Graphical monitoring not available\n");
exit(2);
#endif
break;
case 'l':
- log_audio = TRUE;
+ log_audio = true;
break;
case 'm':
line_model_no = atoi(optarg);
signal_level = atoi(optarg);
break;
case 't':
- tep = TRUE;
+ tep = true;
break;
default:
//usage();
/* Bump the receiver AGC gain by 1dB, to compensate for the above */
rx->agc_scaling_save *= 1.122f;
#endif
- v17_tx_restart(tx, test_bps, tep, TRUE);
+ v17_tx_restart(tx, test_bps, tep, true);
v17_tx_power(tx, signal_level);
- v17_rx_restart(rx, test_bps, TRUE);
+ v17_rx_restart(rx, test_bps, true);
//rx.eq_put_step = rand()%(192*10/3);
bert_init(&bert, bits_per_test, BERT_PATTERN_ITU_O152_11, test_bps, 20);
bert_set_report(&bert, 10000, reporter, NULL);
#include "spandsp.h"
#include "spandsp-sim.h"
-#define FALSE 0
-#define TRUE (!FALSE)
-
#define OUTPUT_FILE_NAME "v18.wav"
#define SAMPLES_PER_CHUNK 160
-int log_audio = FALSE;
+int log_audio = false;
SNDFILE *outhandle = NULL;
char result[2][1024];
-int unexpected_echo = FALSE;
+int unexpected_echo = false;
char *decode_test_file = NULL;
}
else
{
- good_message_received = TRUE;
+ good_message_received = true;
}
}
/*- End of function --------------------------------------------------------*/
int j;
printf("Testing %s\n", v18_mode_to_str(mode));
- v18[0] = v18_init(NULL, TRUE, mode, V18_AUTOMODING_GLOBAL, put_text_msg, NULL);
+ v18[0] = v18_init(NULL, true, mode, V18_AUTOMODING_GLOBAL, put_text_msg, NULL);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, mode, V18_AUTOMODING_GLOBAL, put_text_msg, NULL);
+ v18[1] = v18_init(NULL, false, mode, V18_AUTOMODING_GLOBAL, put_text_msg, NULL);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
}
/* Fake an OK condition for the first message test */
- good_message_received = TRUE;
+ good_message_received = true;
push = 0;
if (v18_put(v18[0], qbf_tx, -1) != strlen(qbf_tx))
{
printf("No message received\n");
exit(2);
}
- good_message_received = FALSE;
+ good_message_received = false;
if (v18_put(v18[0], qbf_tx, -1) != strlen(qbf_tx))
{
printf("V.18 put failed\n");
TUT should continue to probe until the test is terminated.
Comments: This feature should also be verified by observation during the automoding tests.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_01_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_01_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_01_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_01_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Comments: The TUT should indicate that carrier has been lost at some time after the 1650Hz
signal is lost.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_02_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_02_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_02_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_02_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Comments: The TUT should indicate that carrier has been lost at some time after the carrier
signal is removed and not disconnect.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_03_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_03_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_03_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_03_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
automatically hang up when busy tone is detected. PABX busy tones may differ in
frequency and cadence from national parameters.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_04_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_04_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_04_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_04_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
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.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_05_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_05_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_05_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_05_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
mode. There may be other cases, e.g. where the V.18 DCE is used in a gateway,
when automatic disconnection is required.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_06_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_06_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_06_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_06_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
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.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_07_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_07_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_07_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_07_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
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.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_08_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_08_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_08_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_08_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Pass criteria: TBD
Comment: TBD
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_09_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_09_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_09_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_09_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
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.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_01_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_01_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_01_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_01_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
2) The TUT should reply with transmission of TXP as defined in 5.1.2.
3) Verify that TXP sequence has correct bit pattern.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_02_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_02_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_02_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_02_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Pass criteria: The TUT should stop sending TXP at the end of the current sequence when ANS
tone ceases.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_03_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_03_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_03_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_03_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
with the V.18 operational requirements.
Comments: The TUT should indicate that V.18 mode has been selected.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_04_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_04_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_04_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_04_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
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.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_05_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_05_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_05_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_05_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
by the TUT to comply with Annex E.
Comments: The TUT should indicate that V.23 mode has been selected.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_06_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_06_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_06_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_06_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
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.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_07_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_07_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_07_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_07_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
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.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_08_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_08_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_08_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_08_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
2) Data should be transmitted and received at 300 bit/s to comply with Annex F.
Comments: The TUT should indicate that V.21 mode has been selected.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_09_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_09_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_09_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_09_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
by the TUT to comply with Annex E.
Comments: The TUT should indicate that V.23 mode has been selected.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_10_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_10_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_10_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_10_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Comments: The TUT should indicate that V.23 mode has been selected at least 3s after
the start of the 390Hz tone.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_11_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_11_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_11_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_11_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
automode answer state. The TUT may then select either 45.45 or 50 bit/s for the
transmission.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_12_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_12_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_12_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_12_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
TUT should comply with ITU-T Q.24 for the Danish Administration while
receiving for best possible performance.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_13_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_13_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_13_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_13_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
the number lost should be minimal. The data bits and parity are specified in
Annex C.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_14_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_14_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_14_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_14_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
the CI signal.
Comments: Echoes of the CI sequences may be detected at 300 bit/s.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_15_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_15_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_15_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_15_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
2) Data should be transmitted and received at 300 bit/s complying with Annex F.
Comments: The TUT should indicate that V.21 mode has been selected.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_16_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_16_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_16_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_16_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Pass criteria: TUT should not respond to the 980Hz tone and resume sending CI signals after a
maximum of 2.4s from the end of the 980Hz tone.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_17_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_17_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_17_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_17_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Comments: This implies timer Tr has expired 2s after the start of the 980Hz tone and
then 1650Hz has been detected for 0.5s.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_18_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_18_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_18_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_18_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
2) Data should be transmitted and received at 300 bit/s complying with Annex D.
Comments: The TUT should indicate that Bell 103 mode has been selected.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_19_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_19_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_19_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_19_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
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.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_20_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_20_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_20_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_20_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
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.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_21_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_21_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_21_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_21_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Comments: Ideally the TUT should detect the presence of a fax machine and report it back to
the user.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_22_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_22_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_22_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_22_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Comments: Ideally the TUT should report the presence of speech back to the user, e.g. via
circuit 135.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_23_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_23_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_23_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_23_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
2) The TUT should reply with transmission of CM as defined in 5.2.13.
3) Verify that CM sequence has correct bit pattern.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_24_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_24_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_24_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_24_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
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).
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_25_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_25_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_25_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_25_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
answers the call. It will then monitor for any signal.
Pass criteria: The TUT should start probing 3s after answering the call.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_01_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_01_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_01_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_01_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Comments: The ANSam tone is a modulated 2100Hz tone. It may have phase reversals. The
XCI signal is tested in a separate test.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_02_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_02_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_02_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_02_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
V.18 mode connection is completed.
Comments: The TUT should indicate V.18 mode.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_03_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_03_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_03_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_03_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Pass criteria: The TUT should start probing 3s after ANSam disappears.
Comments: It is assumed that timer Ta is restarted on return to Monitor A.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_04_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_04_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_04_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_04_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Pass criteria: TUT should respond with 1650Hz within 400+-100ms of start of 980Hz.
Comments: The TUT should indicate that V.21 mode has been selected.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_05_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_05_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_05_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_05_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Pass criteria: TUT should respond with 390Hz after 1.7(+0.2-0.0)s of start of 1300Hz.
Comments: The TUT should indicate that V.23 mode has been selected.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_06_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_06_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_06_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_06_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Pass criteria: TUT should respond with 980Hz within 400+-100ms of start of 1650Hz.
Comments: The TUT should indicate that V.21 mode has been selected.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_07_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_07_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_07_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_07_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
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.56s.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_08_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_08_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_08_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_08_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
700ms followed by 1s of silence.
Comments: The probe sent by the TUT will depend on the country setting.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_09_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_09_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_09_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_09_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Pass criteria: The TUT should respond with a 1650Hz tone in 1.5+-0.1s.
Comments: The TUT should indicate that V.21 mode has been selected.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_10_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_10_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_10_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_10_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
be lost during the detection process. However, the number lost should be minimal.
The data bits and parity are specified in Annex C.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_11_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_11_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_11_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_11_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
(1650Hz) 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).
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_12_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_12_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_12_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_12_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
when timer Tr will start. It is assumed that timer Ta is restarted on re-entering the
Monitor A state.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_13_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_13_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_13_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_13_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Comments: It is assumed that timer Ta (3s) is restarted on re-entering the Monitor A
state.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_14_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_14_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_14_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_14_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
automode answer state. The TUT may then select either 45.45 or 50 bit/s for the
transmission.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_15_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_15_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_15_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_15_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
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.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_16_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_16_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_16_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_16_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Pass criteria: TUT should respond with 2225Hz tone after 0.7+-0.1s.
Comments: The TUT should indicate that Bell 103 mode has been selected.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_17_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_17_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_17_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_17_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Comments: The TUT should indicate that Bell 103 mode has been selected. Bell 103 modems
use 2225Hz as both answer tone and higher frequency of the upper channel.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_18_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_18_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_18_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_18_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Pass criteria: The TUT should respond with 980Hz after 0.4+-0.2s.
Comments: The TUT should indicate that V.21 mode has been selected.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_19_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_19_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_19_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_19_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
700ms followed by 1s of silence.
Comments: The probe sent by the TUT will depend on the country setting.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_20_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_20_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_20_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_20_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Pass criteria: The TUT should respond with 390Hz after 1.7+-0.1s.
Comments: The TUT should indicate that V.23 mode has been selected.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_21_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_21_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_21_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_21_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
silent for 500ms 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.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_22_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_22_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_22_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_22_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Pass criteria: The TUT should use the orders described in Appendix I.
Comments: The order of the probes is not mandatory.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_23_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_23_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_23_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_23_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
modes followed by a pause of Tm (default 3)s.
Comments: The carrierless modes are those described in Annexes A, B and C.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_24_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_24_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_24_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_24_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Pass criteria: The TUT should transmit silence on detecting the 1270Hz tone and then continue
probing starting with the V.23 probe 20s after the end of the 1270Hz signal.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_25_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_25_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_25_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_25_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
75+-5ms and then the 1650Hz, 1300Hz and 2225Hz probes for time Tc.
Comments: The carrier modes are those described in Annexes D, E, and F.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_26_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_26_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_26_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_26_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
390Hz. When the 1300Hz probe is not being transmitted, a 390Hz tone may be
interpreted as a 400Hz network tone.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_27_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_27_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_27_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_27_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Comments: It is most likely that the TUT will return to probing time Ta (3s) after the
1270Hz tone ceases. This condition needs further clarification.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_28_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_28_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_28_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_28_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Comments: The TUT may not respond to any signals while a carrierless mode probe is being
sent since these modes are half duplex.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_29_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_29_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_29_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_29_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
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.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_30_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_30_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_30_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_30_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Comments: This is an optional test as detection of the fax calling tone is not required by
ITU-T V.18.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_31_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_31_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_31_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_31_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Comments: Ideally the TUT should report the presence of speech back to the user. This is an
optional test.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_32_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_32_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_32_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_32_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
V.18 mode connection is completed.
Comments: The TUT should indicate V.18 mode.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_33_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_33_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_33_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_33_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
for 1 minute.
Pass criteria: The TUT should not start probing.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_21_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_21_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_21_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_21_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Comments: In automode answer, the 1300Hz calling causes the DCE to start probing. In
monitor mode it should only report detection to the DTE.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_22_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_22_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_22_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_22_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Comments: In automode answer, the 980Hz calling causes the DCE to start probing. In monitor
mode it should only report detection to the DTE.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_23_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_23_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_23_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_23_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
printf("1-1 %d '%s'\n", len, msg);
if (user_data == NULL)
strcat(result[1], (const char *) msg);
- //else
- // v18_put(v18[1], "abcdefghij", 10);
+ else
+ v18_put(v18[1], "abcdefghij", 10);
}
/*- End of function --------------------------------------------------------*/
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 300ms after a character.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_5BIT_4545, V18_AUTOMODING_GLOBAL, x_01_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_5BIT_4545, V18_AUTOMODING_GLOBAL, x_01_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_5BIT_4545, V18_AUTOMODING_GLOBAL, x_01_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_5BIT_4545, V18_AUTOMODING_GLOBAL, x_01_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
transmit the string "abcdef" at each rate.
Pass criteria: The tester will measure the bit timings and confirm the rates.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_5BIT_4545, V18_AUTOMODING_GLOBAL, x_02_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_5BIT_4545, V18_AUTOMODING_GLOBAL, x_02_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_5BIT_4545, V18_AUTOMODING_GLOBAL, x_02_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_5BIT_4545, V18_AUTOMODING_GLOBAL, x_02_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Comments: The probe message must be long enough for the tester to establish the bit rate. "GA"
may not be sufficient.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_5BIT_4545, V18_AUTOMODING_USA, x_03_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_5BIT_4545, V18_AUTOMODING_USA, x_03_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_5BIT_4545, V18_AUTOMODING_USA, x_03_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_5BIT_4545, V18_AUTOMODING_USA, x_03_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
{
strcat(result[0], (const char *) msg);
printf("Unexpected ECHO received (%d) '%s'\n", len, msg);
- unexpected_echo = TRUE;
+ unexpected_echo = true;
}
else
{
assumed that the character conversion is the same for Baudot at 50 bit/s and any
other supported speed.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_5BIT_4545 | V18_MODE_REPETITIVE_SHIFTS_OPTION, V18_AUTOMODING_GLOBAL, x_04_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_5BIT_4545 | V18_MODE_REPETITIVE_SHIFTS_OPTION, V18_AUTOMODING_GLOBAL, x_04_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_5BIT_4545 | V18_MODE_REPETITIVE_SHIFTS_OPTION, V18_AUTOMODING_GLOBAL, x_04_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_5BIT_4545 | V18_MODE_REPETITIVE_SHIFTS_OPTION, V18_AUTOMODING_GLOBAL, x_04_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
result[0][0] =
result[1][0] = '\0';
- unexpected_echo = FALSE;
+ unexpected_echo = false;
for (i = 0; i < 127; i++)
msg[i] = i + 1;
msg[127] = '\0';
display will show when its receiver is re-enabled.
Pass criteria: The receiver should be re-enabled after 300ms.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_05_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_05_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_05_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_05_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
receiving character from the TUT. It is assumed that the echo delay in the test
system is negligible.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_06_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_06_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_06_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_06_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
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 300ms after a character.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_07_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_07_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_07_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_07_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
2) The tester should confirm that 1 start bit, 7 data bits, 1 even parity bit and 2 stop
bits are used.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_08_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_08_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_08_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_08_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
that there are no duplicate characters on the TUT display.
3) The received string should be correctly displayed despite the incorrect parity.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_09_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_09_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_09_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_09_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Comments: This test is only applicable to Minitel Dialogue terminals. Prestel and Minitel
Normal terminals cannot operate in this mode.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_10_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_10_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_10_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_10_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
4) The last five characters on the TUT display should be "12345" (no "6")
correctly displayed despite the incorrect parity.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_11_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_11_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_11_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_11_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
Pass criteria: The tester should confirm UTF8 encoded UNICODE characters are used with the
controls specified in ITU-T T.140.
*/
- v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_12_put_text_msg, (void *) (intptr_t) 0);
+ v18[0] = v18_init(NULL, true, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_12_put_text_msg, (void *) (intptr_t) 0);
logging = v18_get_logging_state(v18[0]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "Tester");
- v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_12_put_text_msg, (void *) (intptr_t) 1);
+ v18[1] = v18_init(NULL, false, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_12_put_text_msg, (void *) (intptr_t) 1);
logging = v18_get_logging_state(v18[1]);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
span_log_set_tag(logging, "TUT");
fprintf(stderr, " Cannot open audio file '%s'\n", decode_test_file);
exit(2);
}
- v18_state = v18_init(NULL, FALSE, mode, V18_AUTOMODING_GLOBAL, put_v18_msg, NULL);
+ v18_state = v18_init(NULL, false, mode, V18_AUTOMODING_GLOBAL, 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, "");
{
int i;
int res;
- int hit;
+ bool hit;
const char *match;
int test_standard;
int opt;
decode_test_file = optarg;
break;
case 'l':
- log_audio = TRUE;
+ log_audio = true;
break;
case 's':
test_standard = atoi(optarg);
}
}
- hit = FALSE;
+ hit = false;
for (i = 0; test_list[i].title[0]; i++)
{
if (test_list[i].func
&&
test_list[i].title[strlen(match)] == ' ')))
{
- hit = TRUE;
+ hit = true;
printf("%s\n", test_list[i].title);
res = test_list[i].func();
if (res < 0)
#define OUT_FILE_NAME "v22bis.wav"
char *decode_test_file = NULL;
-int use_gui = FALSE;
+bool use_gui = false;
int rx_bits = 0;
int bits_per_test;
int noise_level;
int signal_level;
- int log_audio;
int channel_codec;
int rbs_pattern;
int guard_tone_option;
int opt;
+ bool log_audio;
channel_codec = MUNGE_CODEC_NONE;
rbs_pattern = 0;
signal_level = -13;
bits_per_test = 50000;
guard_tone_option = V22BIS_GUARD_TONE_1800HZ;
- log_audio = FALSE;
+ log_audio = false;
while ((opt = getopt(argc, argv, "b:B:c:d:gG:lm:n:r:s:")) != -1)
{
switch (opt)
break;
case 'g':
#if defined(ENABLE_GUI)
- use_gui = TRUE;
+ use_gui = true;
#else
fprintf(stderr, "Graphical monitoring not available\n");
exit(2);
guard_tone_option = atoi(optarg);
break;
case 'l':
- log_audio = TRUE;
+ log_audio = true;
break;
case 'm':
line_model_no = atoi(optarg);
#define OUT_FILE_NAME "v27ter.wav"
char *decode_test_file = NULL;
-int use_gui = FALSE;
+bool use_gui = false;
int symbol_no = 0;
SNDFILE *outhandle;
int outframes;
int samples;
- int tep;
int test_bps;
int noise_level;
int signal_level;
int bits_per_test;
int line_model_no;
int block_no;
- int log_audio;
int channel_codec;
int rbs_pattern;
int opt;
+ bool tep;
+ bool log_audio;
logging_state_t *logging;
channel_codec = MUNGE_CODEC_NONE;
rbs_pattern = 0;
test_bps = 4800;
- tep = FALSE;
+ tep = false;
line_model_no = 0;
decode_test_file = NULL;
- use_gui = FALSE;
+ use_gui = false;
noise_level = -70;
signal_level = -13;
bits_per_test = 50000;
- log_audio = FALSE;
+ log_audio = false;
while ((opt = getopt(argc, argv, "b:B:c:d:glm:n:r:s:t")) != -1)
{
switch (opt)
break;
case 'g':
#if defined(ENABLE_GUI)
- use_gui = TRUE;
+ use_gui = true;
#else
fprintf(stderr, "Graphical monitoring not available\n");
exit(2);
#endif
break;
case 'l':
- log_audio = TRUE;
+ log_audio = true;
break;
case 'm':
line_model_no = atoi(optarg);
signal_level = atoi(optarg);
break;
case 't':
- tep = TRUE;
+ tep = true;
break;
default:
//usage();
signal_level--;
v27ter_tx_restart(tx, test_bps, tep);
v27ter_tx_power(tx, signal_level);
- v27ter_rx_restart(rx, test_bps, FALSE);
+ v27ter_rx_restart(rx, test_bps, false);
bert_init(&bert, bits_per_test, BERT_PATTERN_ITU_O152_11, test_bps, 20);
bert_set_report(&bert, 10000, reporter, NULL);
one_way_line_model_release(line_model);
#define OUT_FILE_NAME "v29.wav"
char *decode_test_file = NULL;
-int use_gui = FALSE;
+bool use_gui = false;
int symbol_no = 0;
int rx_bits = 0;
SNDFILE *outhandle;
int outframes;
int samples;
- int tep;
int test_bps;
int noise_level;
int signal_level;
int bits_per_test;
int line_model_no;
int block_no;
- int log_audio;
int channel_codec;
int rbs_pattern;
int opt;
+ bool tep;
+ bool log_audio;
logging_state_t *logging;
channel_codec = MUNGE_CODEC_NONE;
rbs_pattern = 0;
test_bps = 9600;
- tep = FALSE;
+ tep = false;
line_model_no = 0;
decode_test_file = NULL;
- use_gui = FALSE;
+ use_gui = false;
noise_level = -70;
signal_level = -13;
bits_per_test = 50000;
- log_audio = FALSE;
+ log_audio = false;
while ((opt = getopt(argc, argv, "b:B:c:d:glm:n:r:s:t")) != -1)
{
switch (opt)
break;
case 'g':
#if defined(ENABLE_GUI)
- use_gui = TRUE;
+ use_gui = true;
#else
fprintf(stderr, "Graphical monitoring not available\n");
exit(2);
#endif
break;
case 'l':
- log_audio = TRUE;
+ log_audio = true;
break;
case 'm':
line_model_no = atoi(optarg);
signal_level = atoi(optarg);
break;
case 't':
- tep = TRUE;
+ tep = true;
break;
default:
//usage();
signal_level--;
v29_tx_restart(tx, test_bps, tep);
v29_tx_power(tx, signal_level);
- v29_rx_restart(rx, test_bps, FALSE);
+ v29_rx_restart(rx, test_bps, false);
#if defined(SPANDSP_EXPOSE_INTERNAL_STRUCTURES)
rx->eq_put_step = rand()%(48*10/3);
#endif
{
if (++count == 5)
{
- v42_set_local_busy_status(s, TRUE);
+ v42_set_local_busy_status(s, true);
xxx = 1;
}
}
else
{
if (xxx && ++count == 45)
- v42_set_local_busy_status(caller, FALSE);
+ v42_set_local_busy_status(caller, false);
}
}
/*- End of function --------------------------------------------------------*/
{
int i;
int bit;
- int insert_caller_bit_errors;
- int insert_answerer_bit_errors;
+ bool insert_caller_bit_errors;
+ bool insert_answerer_bit_errors;
int opt;
- insert_caller_bit_errors = FALSE;
- insert_answerer_bit_errors = FALSE;
- variable_length = FALSE;
+ insert_caller_bit_errors = false;
+ insert_answerer_bit_errors = false;
+ variable_length = false;
while ((opt = getopt(argc, argv, "bv")) != -1)
{
switch (opt)
insert_answerer_bit_errors = 10000;
break;
case 'v':
- variable_length = TRUE;
+ variable_length = true;
break;
default:
//usage();
}
}
- caller = v42_init(&callerx, TRUE, TRUE, v42_get_frames, v42_put_frames, (void *) &callerx);
- answerer = v42_init(&answererx, FALSE, TRUE, v42_get_frames, v42_put_frames, (void *) &answererx);
+ caller = v42_init(&callerx, true, true, v42_get_frames, v42_put_frames, (void *) &callerx);
+ answerer = v42_init(&answererx, false, true, v42_get_frames, v42_put_frames, (void *) &answererx);
v42_set_status_callback(caller, v42_status, (void *) caller);
v42_set_status_callback(answerer, v42_status, (void *) answerer);
v42_restart(caller);
int v42bis_fd;
int out_fd;
int do_compression;
- int do_decompression;
- int stutter_compression;
+ bool do_decompression;
+ bool stutter_compression;
int stutter_time;
int seg;
int opt;
const char *decompressed_file;
argv0 = argv[0];
- do_compression = FALSE;
- do_decompression = FALSE;
- stutter_compression = FALSE;
+ do_compression = false;
+ do_decompression = false;
+ stutter_compression = false;
while ((opt = getopt(argc, argv, "cds")) != -1)
{
switch (opt)
{
case 'c':
- do_compression = TRUE;
+ do_compression = true;
break;
case 'd':
- do_decompression = TRUE;
+ do_decompression = true;
break;
case 's':
- stutter_compression = TRUE;
+ stutter_compression = true;
break;
default:
//usage();
#include "spandsp.h"
#include "spandsp-sim.h"
-#define FALSE 0
-#define TRUE (!FALSE)
-
#define SAMPLES_PER_CHUNK 160
#define OUTPUT_FILE_NAME "v8.wav"
negotiations_ok = 0;
v8_call_parms.modem_connect_tone = MODEM_CONNECT_TONES_NONE;
- v8_call_parms.send_ci = TRUE;
+ 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.nsf = -1;
v8_call_parms.t66 = -1;
v8_caller = v8_init(NULL,
- TRUE,
+ true,
&v8_call_parms,
handler,
(void *) "caller");
v8_answer_parms.modem_connect_tone = MODEM_CONNECT_TONES_ANSAM_PR;
- v8_answer_parms.send_ci = TRUE;
+ 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.nsf = -1;
v8_answer_parms.t66 = -1;
v8_answerer = v8_init(NULL,
- FALSE,
+ false,
&v8_answer_parms,
handler,
(void *) "answerer");
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.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.nsf = -1;
v8_answer_parms.t66 = -1;
v8_answerer = v8_init(NULL,
- FALSE,
+ false,
&v8_answer_parms,
handler,
(void *) "answerer");
negotiations_ok = 0;
v8_call_parms.modem_connect_tone = MODEM_CONNECT_TONES_NONE;
- v8_call_parms.send_ci = TRUE;
+ 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.nsf = -1;
v8_call_parms.t66 = -1;
v8_caller = v8_init(NULL,
- TRUE,
+ true,
&v8_call_parms,
handler,
(void *) "caller");
SNDFILE *inhandle;
SNDFILE *outhandle;
int opt;
- int log_audio;
+ bool log_audio;
char *decode_test_file;
v8_state_t *v8_caller;
v8_state_t *v8_answerer;
logging_state_t *logging;
decode_test_file = NULL;
- log_audio = FALSE;
+ log_audio = false;
while ((opt = getopt(argc, argv, "d:l")) != -1)
{
switch (opt)
decode_test_file = optarg;
break;
case 'l':
- log_audio = TRUE;
+ log_audio = true;
break;
default:
//usage();
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.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.nsf = -1;
v8_call_parms.t66 = -1;
v8_caller = v8_init(NULL,
- TRUE,
+ true,
&v8_call_parms,
handler,
(void *) "caller");
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.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.nsf = -1;
v8_answer_parms.t66 = -1;
v8_answerer = v8_init(NULL,
- FALSE,
+ false,
&v8_answer_parms,
handler,
(void *) "answerer");