Go to the source code of this file.
Classes | |
| struct | t31_audio_front_end_state_t |
| struct | t31_t38_front_end_state_t |
| struct | t31_state_s |
Defines | |
| #define | _SPANDSP_T31_H_ |
| #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) |
| int | t31_rx (t31_state_t *s, int16_t amp[], int len) |
| Process a block of received T.31 modem audio samples. | |
| int | t31_tx (t31_state_t *s, int16_t amp[], int max_len) |
| Generate a block of 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. | |
| 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. | |
| int | t31_release (t31_state_t *s) |
| Release a T.31 context. | |
| 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.
| s | The T.31 context. | |
| at_tx_handler | A callback routine to handle AT interpreter channel output. | |
| at_tx_user_data | An opaque pointer passed in called to at_tx_handler. | |
| modem_control_handler | A callback routine to handle control of the modem (off-hook, etc). | |
| modem_control_user_data | An opaque pointer passed in called to modem_control_handler. | |
| tx_t38_packet_handler | ??? | |
| tx_t38_packet_user_data | ??? |
References at_init(), t31_state_s::at_state, t31_state_s::audio, t31_state_s::call_samples, at_state_s::do_hangup, at_state_s::dte_inactivity_timeout, t31_audio_front_end_state_t::last_sample, at_state_s::line_ptr, t31_state_s::logging, t31_state_s::modem, t31_state_s::modem_control_handler, t31_state_s::modem_control_user_data, t31_audio_front_end_state_t::modems, power_meter_init(), power_meter_level_dbm0(), queue_init(), QUEUE_READ_ATOMIC, QUEUE_WRITE_ATOMIC, t31_audio_front_end_state_t::rx_power, t31_state_s::rx_queue, at_state_s::rx_signal_present, at_state_s::rx_trained, t31_state_s::silence_awaited, t31_audio_front_end_state_t::silence_heard, t31_audio_front_end_state_t::silence_threshold_power, t31_set_t38_config(), t31_t38_front_end_state_t::t38, t31_state_s::t38_fe, t31_state_s::t38_mode, and at_state_s::transmit.
| int t31_release | ( | t31_state_t * | s | ) |
Release a T.31 context.
Release a T.31 context.
| s | The T.31 context. |
References t31_state_s::at_state.
| int t31_rx | ( | t31_state_t * | s, | |
| int16_t | amp[], | |||
| int | len | |||
| ) |
Process a block of received T.31 modem audio samples.
Process a block of received T.31 modem audio samples.
| s | The T.31 modem context. | |
| amp | The audio sample buffer. | |
| len | The number of samples in the buffer. |
References t31_state_s::at_state, t31_state_s::audio, t31_state_s::call_samples, t31_state_s::dte_data_timeout, t31_audio_front_end_state_t::last_sample, t31_state_s::modem, t31_audio_front_end_state_t::modems, power_meter_update(), fax_modems_state_t::rx_handler, t31_audio_front_end_state_t::rx_power, fax_modems_state_t::rx_user_data, t31_audio_front_end_state_t::silence_heard, t31_audio_front_end_state_t::silence_threshold_power, and at_state_s::transmit.
| 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.
| s | The T.31 modem context. | |
| without_pacing | TRUE if data is to be sent as fast as possible. FALSE if it is to be paced. |
References t38_core_state_s::data_end_tx_count, t38_core_state_s::indicator_tx_count, t31_t38_front_end_state_t::ms_per_tx_chunk, t31_t38_front_end_state_t::t38, and t31_state_s::t38_fe.
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).
| s | The T.31 modem context. | |
| use_tep | TRUE if TEP is to be ised. |
References t31_state_s::audio, t31_audio_front_end_state_t::modems, and fax_modems_state_t::use_tep.
| 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.
| s | The T.31 modem context. | |
| 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. |
References t31_state_s::audio, t31_audio_front_end_state_t::modems, and fax_modems_state_t::transmit_on_idle.
| int t31_tx | ( | t31_state_t * | s, | |
| int16_t | amp[], | |||
| int | max_len | |||
| ) |
Generate a block of T.31 modem audio samples.
Generate a block of T.31 modem audio samples.
| s | The T.31 modem context. | |
| amp | The audio sample buffer. | |
| max_len | The number of samples to be generated. |
References AT_MODEM_CONTROL_HANGUP, t31_state_s::at_state, t31_state_s::audio, at_state_s::do_hangup, t31_state_s::modem, t31_audio_front_end_state_t::modems, at_state_s::transmit, fax_modems_state_t::transmit_on_idle, fax_modems_state_t::tx_handler, and fax_modems_state_t::tx_user_data.
1.5.6