spandsp 3.0.0
fax_tester.h File Reference

Go to the source code of this file.

Classes

struct  faxtester_state_s

Typedefs

typedef struct faxtester_state_s faxtester_state_t
typedef void(*) faxtester_flush_handler_t(faxtester_state_t *s, void *user_data, int which)

Functions

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 faxtester_set_tx_type (void *user_data, int type, int bit_rate, int short_train, int use_hdlc)
void faxtester_set_rx_type (void *user_data, int type, int bit_rate, int short_train, int use_hdlc)
void faxtest_set_rx_silence (faxtester_state_t *s)
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_flush_handler (faxtester_state_t *s, faxtester_flush_handler_t handler, void *user_data)
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_timeout (faxtester_state_t *s, int timeout)
int faxtester_next_step (faxtester_state_t *s)
logging_state_tfaxtester_get_logging_state (faxtester_state_t *s)
 Get the logging context associated with a FAX tester context.
faxtester_state_t * faxtester_init (faxtester_state_t *s, const char *test_file, const char *test)
 Initialise a FAX tester context.
int faxtester_release (faxtester_state_t *s)
 Release a FAX context.
int faxtester_free (faxtester_state_t *s)
 Free a FAX context.

Function Documentation

◆ faxtester_free()

int faxtester_free ( faxtester_state_t * s)

Free a FAX context.

Free a FAX context.

Parameters
sThe FAX tester context.
Returns
0 for OK, else -1.

References faxtester_free(), and faxtester_release().

Referenced by faxtester_free().

◆ faxtester_get_logging_state()

logging_state_t * faxtester_get_logging_state ( faxtester_state_t * s)

Get the logging context associated with a FAX tester context.

Get the logging context associated with a FAX tester context.

Parameters
sThe FAX tester context.
Returns
A pointer to the logging context

References faxtester_get_logging_state(), and faxtester_state_s::logging.

Referenced by faxtester_get_logging_state().

◆ faxtester_init()

faxtester_state_t * faxtester_init ( faxtester_state_t * s,
const char * test_file,
const char * test )

Initialise a FAX tester context.

Initialise a FAX tester context.

Parameters
sThe FAX tester context.
test_fileThe name of the file of XML test scripts.
testThe name of the XML script test.
Returns
A pointer to the FAX context, or NULL if there was a problem.

References faxtester_init(), faxtester_state_s::image_path, faxtester_state_s::logging, and t38_non_ecm_buffer_get_bit().

Referenced by faxtester_init().

◆ faxtester_release()

int faxtester_release ( faxtester_state_t * s)

Release a FAX context.

Release a FAX context.

Parameters
sThe FAX tester context.
Returns
0 for OK, else -1.

References faxtester_state_s::doc, and faxtester_release().

Referenced by faxtester_free(), and faxtester_release().

◆ faxtester_rx()

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.

Parameters
sThe FAX tester context.
ampThe audio sample buffer.
lenThe number of samples in the buffer.
Returns
The number of samples unprocessed. This should only be non-zero if the software has reached the end of the FAX call.

References faxtester_rx(), fax_modems_state_s::rx_handler, and fax_modems_state_s::rx_signal_present.

Referenced by faxtester_rx().

◆ faxtester_set_tep_mode()

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.

Parameters
sThe FAX tester context.
use_teptrue if TEP should be sent.

References faxtester_set_tep_mode().

Referenced by faxtester_set_tep_mode().

◆ faxtester_set_transmit_on_idle()

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.

Parameters
sThe FAX tester context.
transmit_on_idleTrue 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_set_transmit_on_idle(), and fax_modems_state_s::transmit_on_idle.

Referenced by faxtester_set_transmit_on_idle().

◆ faxtester_tx()

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.

Parameters
sThe FAX tester context.
ampThe audio sample buffer.
max_lenThe number of samples to be generated.
Returns
The number of samples actually generated. This will be zero when there is nothing to send.

References faxtester_tx(), faxtester_state_s::transmit, fax_modems_state_s::transmit_on_idle, and fax_modems_state_s::tx_handler.

Referenced by faxtester_tx().