#include <inttypes.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "floating_fudge.h"
#include <assert.h>
#include <fcntl.h>
#include <time.h>
#include <unistd.h>
#include "spandsp.h"
#include "fax_tester.h"
Defines | |
#define | HDLC_FRAMING_OK_THRESHOLD 5 |
Functions | |
void | faxtester_send_hdlc_flags (faxtester_state_t *s, int flags) |
void | faxtester_send_hdlc_msg (faxtester_state_t *s, const uint8_t *msg, int len, int crc_ok) |
void | faxtester_set_non_ecm_image_buffer (faxtester_state_t *s, const uint8_t *buf, int len) |
void | faxtester_set_ecm_image_buffer (faxtester_state_t *s, const uint8_t *buf, int len, int block, int frame_size, int crc_hit) |
int | faxtester_rx (faxtester_state_t *s, int16_t *amp, int len) |
Apply T.30 receive processing to a block of audio samples. | |
int | faxtester_tx (faxtester_state_t *s, int16_t *amp, int max_len) |
Apply T.30 transmit processing to generate a block of audio samples. | |
void | faxtest_set_rx_silence (faxtester_state_t *s) |
void | faxtester_set_rx_type (void *user_data, int type, int bit_rate, int short_train, int use_hdlc) |
void | faxtester_set_tx_type (void *user_data, int type, int bit_rate, int short_train, int use_hdlc) |
void | faxtester_set_timeout (faxtester_state_t *s, int timeout) |
void | faxtester_set_transmit_on_idle (faxtester_state_t *s, int transmit_on_idle) |
Select whether silent audio will be sent when FAX transmit is idle. | |
void | faxtester_set_tep_mode (faxtester_state_t *s, int use_tep) |
Select whether TEP will be sent for the image modems. | |
void | faxtester_set_real_time_frame_handler (faxtester_state_t *s, faxtester_real_time_frame_handler_t *handler, void *user_data) |
void | faxtester_set_front_end_step_complete_handler (faxtester_state_t *s, faxtester_front_end_step_complete_handler_t *handler, void *user_data) |
void | faxtester_set_front_end_step_timeout_handler (faxtester_state_t *s, faxtester_front_end_step_complete_handler_t *handler, void *user_data) |
faxtester_state_t * | faxtester_init (faxtester_state_t *s, int calling_party) |
Initialise a FAX context. | |
int | faxtester_release (faxtester_state_t *s) |
Release a FAX context. | |
int | faxtester_free (faxtester_state_t *s) |
Free a FAX context. | |
void | faxtester_set_flush_handler (faxtester_state_t *s, faxtester_flush_handler_t *handler, void *user_data) |
int faxtester_free | ( | faxtester_state_t * | s | ) |
Free a FAX context.
Free a FAX context.
s | The FAX tester context. |
faxtester_state_t* faxtester_init | ( | faxtester_state_t * | s, | |
int | calling_party | |||
) |
Initialise a FAX context.
Initialise a FAX context.
s | The FAX tester context. | |
calling_party | TRUE if the context is for a calling party. FALSE if the context is for an answering party. |
References faxtester_state_s::logging, and faxtester_state_s::modems.
int faxtester_release | ( | faxtester_state_t * | s | ) |
Release a FAX context.
Release a FAX context.
s | The FAX tester context. |
int faxtester_rx | ( | faxtester_state_t * | s, | |
int16_t * | amp, | |||
int | len | |||
) |
Apply T.30 receive processing to a block of audio samples.
Apply T.30 receive processing to a block of audio samples.
s | The FAX tester context. | |
amp | The audio sample buffer. | |
len | The number of samples in the buffer. |
References fax_modems_state_t::dc_restore, faxtester_state_s::modems, fax_modems_state_t::rx_handler, fax_modems_state_t::rx_signal_present, fax_modems_state_t::rx_user_data, and faxtester_state_s::wait_for_silence.
void faxtester_set_tep_mode | ( | faxtester_state_t * | s, | |
int | use_tep | |||
) |
Select whether TEP will be sent for the image modems.
Select whether talker echo protection tone will be sent for the image modems.
s | The FAX tester context. | |
use_tep | TRUE if TEP should be sent. |
References faxtester_state_s::modems, and fax_modems_state_t::use_tep.
void faxtester_set_transmit_on_idle | ( | faxtester_state_t * | s, | |
int | transmit_on_idle | |||
) |
Select whether silent audio will be sent when FAX transmit is idle.
Select whether silent audio will be sent when FAX transmit is idle.
s | The FAX tester context. | |
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. |
References faxtester_state_s::modems, and fax_modems_state_t::transmit_on_idle.
int faxtester_tx | ( | faxtester_state_t * | s, | |
int16_t * | amp, | |||
int | max_len | |||
) |
Apply T.30 transmit processing to generate a block of audio samples.
Apply T.30 transmit processing to generate a block of audio samples.
s | The FAX tester context. | |
amp | The audio sample buffer. | |
max_len | The number of samples to be generated. |
References faxtester_state_s::modems, faxtester_state_s::transmit, fax_modems_state_t::transmit_on_idle, fax_modems_state_t::tx_handler, and fax_modems_state_t::tx_user_data.