spandsp 0.0.6

t31.h File Reference

Go to the source code of this file.

Defines

#define T31_TX_BUF_LEN   (4096)
#define T31_TX_BUF_HIGH_TIDE   (4096 - 1024)
#define T31_TX_BUF_LOW_TIDE   (1024)
#define T31_MAX_HDLC_LEN   284
#define T31_T38_MAX_HDLC_LEN   260

Typedefs

typedef struct t31_state_s t31_state_t
typedef int( t31_modem_control_handler_t )(t31_state_t *s, void *user_data, int op, const char *num)

Functions

void t31_call_event (t31_state_t *s, int event)
int t31_at_rx (t31_state_t *s, const char *t, int len)
 SPAN_DECLARE_NONSTD (int) t31_rx(t31_state_t *s
 Process a block of received T.31 modem audio samples.
int t31_t38_send_timeout (t31_state_t *s, int samples)
void t31_set_transmit_on_idle (t31_state_t *s, int transmit_on_idle)
 Select whether silent audio will be sent when transmit is idle.
void t31_set_tep_mode (t31_state_t *s, int use_tep)
 Select whether TEP mode will be used.
void t31_set_t38_config (t31_state_t *s, int without_pacing)
 Select whether T.38 data will be paced.
void t31_set_mode (t31_state_t *s, int t38_mode)
logging_state_tt31_get_logging_state (t31_state_t *s)
 Get a pointer to the logging context associated with a T.31 context.
t38_core_state_tt31_get_t38_core_state (t31_state_t *s)
t31_state_tt31_init (t31_state_t *s, at_tx_handler_t *at_tx_handler, void *at_tx_user_data, t31_modem_control_handler_t *modem_control_handler, void *modem_control_user_data, t38_tx_packet_handler_t *tx_t38_packet_handler, void *tx_t38_packet_user_data)
 Initialise a T.31 context.
int t31_release (t31_state_t *s)
 Release a T.31 context.
int t31_free (t31_state_t *s)
 Release a T.31 context.

Variables

int16_t amp []
int16_t int len
int16_t int max_len

Detailed Description


Typedef Documentation

typedef struct t31_state_s t31_state_t

T.31 descriptor. This defines the working state for a single instance of a T.31 FAX modem.


Function Documentation

SPAN_DECLARE_NONSTD ( int  )

Process a block of received T.31 modem audio samples.

Get the next bit of data from a T.38 rate adapting non-ECM buffer context.

Get a bit of received non-ECM image data.

Get the next bit of a transmitted serial bit stream.

Generate a block of T.31 modem audio samples.

Fake processing of a missing block of received T.31 modem audio samples.

Process a block of received T.31 modem audio samples.

Parameters:
sThe T.31 modem context.
ampThe audio sample buffer.
lenThe number of samples in the buffer.
Returns:
The number of samples unprocessed.

Fake processing of a missing block of received T.31 modem audio samples (e.g due to packet loss).

Parameters:
sThe T.31 modem context.
lenThe number of samples to fake.
Returns:
The number of samples unprocessed.

Generate a block of T.31 modem audio samples.

Parameters:
sThe T.31 modem context.
ampThe audio sample buffer.
max_lenThe number of samples to be generated.
Returns:
The number of samples actually generated.
int t31_free ( t31_state_t s)

Release a T.31 context.

Free a T.31 context.

Parameters:
sThe T.31 context.
Returns:
0 for OK

References t31_release().

logging_state_t* t31_get_logging_state ( t31_state_t s)

Get a pointer to the logging context associated with a T.31 context.

Get a pointer to the logging context associated with a T.31 context.

Parameters:
sThe T.31 context.
Returns:
A pointer to the logging context, or NULL.
t31_state_t* t31_init ( t31_state_t s,
at_tx_handler_t *  at_tx_handler,
void *  at_tx_user_data,
t31_modem_control_handler_t *  modem_control_handler,
void *  modem_control_user_data,
t38_tx_packet_handler_t *  tx_t38_packet_handler,
void *  tx_t38_packet_user_data 
)

Initialise a T.31 context.

Initialise a T.31 context. This must be called before the first use of the context, to initialise its contents.

Parameters:
sThe T.31 context.
at_tx_handlerA callback routine to handle AT interpreter channel output.
at_tx_user_dataAn opaque pointer passed in called to at_tx_handler.
modem_control_handlerA callback routine to handle control of the modem (off-hook, etc).
modem_control_user_dataAn opaque pointer passed in called to modem_control_handler.
tx_t38_packet_handler???
tx_t38_packet_user_data???
Returns:
A pointer to the T.31 context.

References at_init(), DEFAULT_DTE_TIMEOUT, MODEM_CONNECT_TONES_ANSAM_PR, power_meter_init(), power_meter_level_dbm0(), queue_init(), QUEUE_READ_ATOMIC, QUEUE_WRITE_ATOMIC, t31_set_t38_config(), and v8_init().

int t31_release ( t31_state_t s)

Release a T.31 context.

Release a T.31 context.

Parameters:
sThe T.31 context.
Returns:
0 for OK

Referenced by t31_free().

void t31_set_t38_config ( t31_state_t s,
int  without_pacing 
)

Select whether T.38 data will be paced.

Select whether T.38 data will be paced as it is transmitted.

Parameters:
sThe T.31 modem context.
without_pacingTRUE if data is to be sent as fast as possible. FALSE if it is to be paced.

References DATA_END_TX_COUNT, DATA_TX_COUNT, INDICATOR_TX_COUNT, MS_PER_TX_CHUNK, T38_PACKET_CATEGORY_CONTROL_DATA, T38_PACKET_CATEGORY_CONTROL_DATA_END, T38_PACKET_CATEGORY_IMAGE_DATA, T38_PACKET_CATEGORY_IMAGE_DATA_END, T38_PACKET_CATEGORY_INDICATOR, and t38_set_redundancy_control().

Referenced by t31_init().

void t31_set_tep_mode ( t31_state_t s,
int  use_tep 
)

Select whether TEP mode will be used.

Select whether TEP mode will be used (or time allowed for it (when transmitting).

Parameters:
sThe T.31 modem context.
use_tepTRUE if TEP is to be ised.
void t31_set_transmit_on_idle ( t31_state_t s,
int  transmit_on_idle 
)

Select whether silent audio will be sent when transmit is idle.

Select whether silent audio will be sent when transmit is idle.

Parameters:
sThe T.31 modem context.
transmit_on_idleTRUE 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.