spandsp 3.0.0
|
Go to the source code of this file.
Classes | |
struct | t30_exchanged_info_t |
struct | t30_stats_t |
Macros | |
#define | T30_MAX_DIS_DTC_DCS_LEN 22 |
#define | T30_MAX_IDENT_LEN 20 |
#define | T30_MAX_PAGE_HEADER_INFO 50 |
Typedefs | |
typedef struct t30_state_s | t30_state_t |
typedef int(* | t30_phase_b_handler_t) (void *user_data, int result) |
T.30 phase B callback handler. | |
typedef int(* | t30_phase_d_handler_t) (void *user_data, int result) |
T.30 phase D callback handler. | |
typedef void(* | t30_phase_e_handler_t) (void *user_data, int completion_code) |
T.30 phase E callback handler. | |
typedef void(* | t30_real_time_frame_handler_t) (void *user_data, bool direction, const uint8_t msg[], int len) |
T.30 real time frame handler. | |
typedef int(* | t30_document_handler_t) (void *user_data, int status) |
T.30 document handler. | |
typedef void(* | t30_set_handler_t) (void *user_data, int type, int bit_rate, int short_train, int use_hdlc) |
T.30 set a receive or transmit type handler. | |
typedef void(* | t30_send_hdlc_handler_t) (void *user_data, const uint8_t msg[], int len) |
T.30 send HDLC handler. | |
typedef int(* | t30_document_get_handler_t) (void *user_data, uint8_t msg[], int len) |
T.30 send document handler. | |
typedef int(* | t30_document_put_handler_t) (void *user_data, const uint8_t msg[], int len) |
T.30 deliver handler. | |
Functions | |
t30_state_t * | t30_init (t30_state_t *s, bool calling_party, t30_set_handler_t set_rx_type_handler, void *set_rx_type_user_data, t30_set_handler_t set_tx_type_handler, void *set_tx_type_user_data, t30_send_hdlc_handler_t send_hdlc_handler, void *send_hdlc_user_data) |
Initialise a T.30 context. | |
int | t30_release (t30_state_t *s) |
Release a T.30 context. | |
int | t30_free (t30_state_t *s) |
Free a T.30 context. | |
int | t30_restart (t30_state_t *s, bool calling_party) |
Restart a T.30 context. | |
int | t30_call_active (t30_state_t *s) |
Check if a T.30 call is still active. | |
void | t30_terminate (t30_state_t *s) |
Cleanup a T.30 context if the call terminates. | |
void | t30_front_end_status (void *user_data, int status) |
Inform the T.30 engine of a status change in the front end (end of tx, rx signal change, etc.). | |
int | t30_non_ecm_get_bit (void *user_data) |
Get a bit of received non-ECM image data. | |
int | t30_non_ecm_get (void *user_data, uint8_t buf[], int max_len) |
Get a bit of received non-ECM image data. | |
void | t30_non_ecm_put_bit (void *user_data, int bit) |
Process a bit of received non-ECM image data. | |
void | t30_non_ecm_put (void *user_data, const uint8_t buf[], int len) |
Process a chunk of received non-ECM image data. | |
void | t30_hdlc_accept (void *user_data, const uint8_t msg[], int len, int ok) |
Process a received HDLC frame. | |
void | t30_timer_update (t30_state_t *s, int samples) |
Report the passage of time to the T.30 engine. | |
void | t30_get_transfer_statistics (t30_state_t *s, t30_stats_t *t) |
Get the current transfer statistics. | |
void | t30_local_interrupt_request (t30_state_t *s, int state) |
Request a local interrupt of FAX exchange. | |
void | t30_remote_interrupts_allowed (t30_state_t *s, int state) |
Allow remote interrupts of FAX exchange. | |
#define T30_MAX_DIS_DTC_DCS_LEN 22 |
The maximum length of a DIS, DTC or DCS frame
Referenced by t30_build_dis_or_dtc().
#define T30_MAX_IDENT_LEN 20 |
The maximum length of the body of an ident string
Referenced by t30_set_tx_ident(), t30_set_tx_password(), t30_set_tx_polled_sub_address(), t30_set_tx_selective_polling_address(), t30_set_tx_sender_ident(), and t30_set_tx_sub_address().
#define T30_MAX_PAGE_HEADER_INFO 50 |
The maximum length of the user string to insert in page headers
Referenced by t30_set_tx_page_header_info().
typedef int(* t30_document_get_handler_t) (void *user_data, uint8_t msg[], int len) |
T.30 send document handler.
T.30 send document handler.
user_data | An opaque pointer. |
msg | The document chunk. |
len | The length of the chunk. |
typedef int(* t30_document_handler_t) (void *user_data, int status) |
T.30 document handler.
T.30 document handler.
user_data | An opaque pointer. |
result | The document event code. |
typedef int(* t30_document_put_handler_t) (void *user_data, const uint8_t msg[], int len) |
T.30 deliver handler.
T.30 deliver document handler.
user_data | An opaque pointer. |
msg | The document chunk. |
len | The length of the chunk. |
typedef int(* t30_phase_b_handler_t) (void *user_data, int result) |
T.30 phase B callback handler.
T.30 phase B callback handler. This handler can be used to process addition information available in some FAX calls, such as passwords. The callback handler can access whatever additional information might have been received, using t30_get_received_info().
user_data | An opaque pointer. |
result | The phase B event code. |
typedef int(* t30_phase_d_handler_t) (void *user_data, int result) |
T.30 phase D callback handler.
T.30 phase D callback handler.
user_data | An opaque pointer. |
result | The phase D event code. |
typedef void(* t30_phase_e_handler_t) (void *user_data, int completion_code) |
T.30 phase E callback handler.
T.30 phase E callback handler.
user_data | An opaque pointer. |
completion_code | The phase E completion code. |
typedef void(* t30_real_time_frame_handler_t) (void *user_data, bool direction, const uint8_t msg[], int len) |
T.30 real time frame handler.
T.30 real time frame handler.
user_data | An opaque pointer. |
incoming | True for incoming, false for outgoing. |
msg | The HDLC message. |
len | The length of the message. |
typedef void(* t30_send_hdlc_handler_t) (void *user_data, const uint8_t msg[], int len) |
T.30 send HDLC handler.
T.30 send HDLC handler.
user_data | An opaque pointer. |
msg | The HDLC message. |
len | The length of the message. -1 to flush the HDLC queue. |
typedef void(* t30_set_handler_t) (void *user_data, int type, int bit_rate, int short_train, int use_hdlc) |
T.30 set a receive or transmit type handler.
T.30 set a receive or transmit type handler.
user_data | An opaque pointer. |
type | The modem, tone or silence to be sent or received. |
bit_rate | The bit rate of the modem to be sent or received. |
short_train | True if the short training sequence should be used (where one exists). |
use_hdlc | False for bit stream, true for HDLC framing. |
anonymous enum |
T.30 protocol completion codes, at phase E.
anonymous enum |
I/O modes for the T.30 protocol. These are allocated such that the lower 4 bits represents the variant of the modem - e.g. the particular bit rate selected.
anonymous enum |
anonymous enum |
anonymous enum |
anonymous enum |
int t30_call_active | ( | t30_state_t * | s | ) |
Check if a T.30 call is still active.
Check if a T.30 call is still active. This may be used to regularly poll if the job has finished.
s | The T.30 context. |
References t30_state_s::phase.
int t30_free | ( | t30_state_t * | s | ) |
Free a T.30 context.
Free a T.30 context.
s | The T.30 context. |
References t30_release().
void t30_front_end_status | ( | void * | user_data, |
int | status ) |
Inform the T.30 engine of a status change in the front end (end of tx, rx signal change, etc.).
Inform the T.30 engine of a status change in the front end (end of tx, rx signal change, etc.).
user_data | The T.30 context. |
status | The type of status change which occured. |
References t30_state_s::dis_received, t30_state_s::ecm_at_page_end, t30_state_s::error_correcting_mode, t30_state_s::iaf, t30_state_s::image_carrier_attempted, t30_state_s::last_rx_page_result, t30_state_s::logging, t30_state_s::next_rx_step, t30_state_s::next_tx_step, t30_state_s::phase, t30_state_s::retries, t30_state_s::rx_signal_present, t30_state_s::short_train, SIG_STATUS_CARRIER_DOWN, SIG_STATUS_CARRIER_UP, SIG_STATUS_FRAMING_OK, span_log(), t30_state_s::state, t30_state_s::step, T30_EOM, T30_EOP, T30_EOS, T30_FRONT_END_RECEIVE_COMPLETE, T30_IAF_MODE_NO_TCF, T30_MPS, T30_NULL, T30_PRI_EOM, T30_PRI_EOP, and T30_PRI_MPS.
Referenced by fax_tx().
void t30_get_transfer_statistics | ( | t30_state_t * | s, |
t30_stats_t * | t ) |
Get the current transfer statistics.
Get the current transfer statistics for the file being sent or received.
s | The T.30 context. |
t | A pointer to a buffer for the statistics. |
References t30_stats_t::bad_rows, t4_stats_t::bad_rows, t30_stats_t::bit_rate, t30_stats_t::compression, t4_stats_t::compression, t30_state_s::current_fallback, t30_state_s::current_status, t30_stats_t::current_status, t30_state_s::error_correcting_mode, t30_stats_t::error_correcting_mode, t30_state_s::error_correcting_mode_retries, t30_stats_t::error_correcting_mode_retries, t30_stats_t::image_length, t4_stats_t::image_length, t30_stats_t::image_size, t30_stats_t::image_type, t4_stats_t::image_type, t30_stats_t::image_width, t4_stats_t::image_width, t30_stats_t::image_x_resolution, t4_stats_t::image_x_resolution, t30_stats_t::image_y_resolution, t4_stats_t::image_y_resolution, t30_stats_t::length, t4_stats_t::length, t4_stats_t::line_image_size, t30_stats_t::longest_bad_row_run, t4_stats_t::longest_bad_row_run, t30_state_s::operation_in_progress, t30_stats_t::pages_in_file, t4_stats_t::pages_in_file, t30_stats_t::pages_rx, t30_stats_t::pages_tx, t30_state_s::rtn_events, t30_stats_t::rtn_events, t30_state_s::rtp_events, t30_stats_t::rtp_events, t30_state_s::rx_page_number, t30_state_s::t4, t4_rx_get_transfer_statistics(), t4_tx_get_transfer_statistics(), t30_state_s::tx_page_number, t30_stats_t::type, t4_stats_t::type, t30_stats_t::width, t4_stats_t::width, t30_stats_t::x_resolution, t4_stats_t::x_resolution, t30_stats_t::y_resolution, and t4_stats_t::y_resolution.
void t30_hdlc_accept | ( | void * | user_data, |
const uint8_t | msg[], | ||
int | len, | ||
int | ok ) |
Process a received HDLC frame.
Process a received HDLC frame.
user_data | The T.30 context. |
msg | The HDLC message. |
len | The length of the message, in octets. |
ok | True if the frame was received without error. |
Referenced by fax_init().
t30_state_t * t30_init | ( | t30_state_t * | s, |
bool | calling_party, | ||
t30_set_handler_t | set_rx_type_handler, | ||
void * | set_rx_type_user_data, | ||
t30_set_handler_t | set_tx_type_handler, | ||
void * | set_tx_type_user_data, | ||
t30_send_hdlc_handler_t | send_hdlc_handler, | ||
void * | send_hdlc_user_data ) |
Initialise a T.30 context.
Initialise a T.30 context.
s | The T.30 context. |
calling_party | True if the context is for a calling party. False if the context is for an answering party. |
set_rx_type_handler | |
set_rx_type_user_data | |
set_tx_type_handler | |
set_tx_type_user_data | |
send_hdlc_handler | |
send_hdlc_user_data |
References t30_state_s::local_min_scan_time_code, t30_state_s::logging, t30_state_s::send_hdlc_handler, t30_state_s::send_hdlc_user_data, t30_state_s::set_rx_type_handler, t30_state_s::set_rx_type_user_data, t30_state_s::set_tx_type_handler, t30_state_s::set_tx_type_user_data, t30_state_s::supported_bilevel_resolutions, t30_state_s::supported_compressions, t30_state_s::supported_image_sizes, t30_state_s::supported_modems, t30_state_s::supported_output_compressions, t30_restart(), T30_SUPPORT_V17, T30_SUPPORT_V27TER, T30_SUPPORT_V29, T4_COMPRESSION_JPEG, T4_COMPRESSION_T4_1D, T4_COMPRESSION_T4_2D, T4_RESOLUTION_200_100, T4_RESOLUTION_200_200, T4_RESOLUTION_200_400, T4_RESOLUTION_R8_FINE, T4_RESOLUTION_R8_STANDARD, and T4_RESOLUTION_R8_SUPERFINE.
Referenced by fax_init(), and t38_terminal_init().
void t30_local_interrupt_request | ( | t30_state_t * | s, |
int | state ) |
Request a local interrupt of FAX exchange.
Request a local interrupt of FAX exchange.
s | The T.30 context. |
state | True to enable interrupt request, else false. |
References t30_state_s::local_interrupt_pending, T30_PIN, T30_PIP, and t30_state_s::timer_t3.
int t30_non_ecm_get | ( | void * | user_data, |
uint8_t | buf[], | ||
int | max_len ) |
Get a bit of received non-ECM image data.
Get a chunk of received non-ECM image data.
user_data | An opaque pointer, which must point to the T.30 context. |
buf | The buffer to contain the data. |
max_len | The maximum length of the chunk. |
References t30_state_s::logging, span_log(), t30_state_s::state, t30_state_s::t4, t4_tx_get(), and t30_state_s::tcf_test_bits.
int t30_non_ecm_get_bit | ( | void * | user_data | ) |
Get a bit of received non-ECM image data.
Get a bit of received non-ECM image data.
user_data | An opaque pointer, which must point to the T.30 context. |
References t30_state_s::logging, SIG_STATUS_END_OF_DATA, span_log(), t30_state_s::state, t30_state_s::t4, t4_tx_get_bit(), and t30_state_s::tcf_test_bits.
Referenced by fax_init().
void t30_non_ecm_put | ( | void * | user_data, |
const uint8_t | buf[], | ||
int | len ) |
Process a chunk of received non-ECM image data.
Process a chunk of received non-ECM image data.
user_data | An opaque pointer, which must point to the T.30 context. |
buf | The buffer containing the received data. |
len | The length of the data in buf. |
References t30_state_s::logging, span_log(), t30_state_s::state, t30_state_s::t4, T4_DECODE_MORE_DATA, T4_DECODE_OK, t4_rx_put(), t30_state_s::tcf_current_zeros, t30_state_s::tcf_most_zeros, and t30_state_s::tcf_test_bits.
void t30_non_ecm_put_bit | ( | void * | user_data, |
int | bit ) |
Process a bit of received non-ECM image data.
Process a bit of received non-ECM image data.
user_data | An opaque pointer, which must point to the T.30 context. |
bit | The received bit. |
References t30_state_s::logging, span_log(), t30_state_s::state, t30_state_s::t4, T4_DECODE_MORE_DATA, T4_DECODE_OK, t4_rx_put_bit(), t30_state_s::tcf_current_zeros, t30_state_s::tcf_most_zeros, and t30_state_s::tcf_test_bits.
Referenced by fax_init().
int t30_release | ( | t30_state_t * | s | ) |
Release a T.30 context.
Release a T.30 context.
s | The T.30 context. |
Referenced by fax_release(), t30_free(), and t38_terminal_release().
void t30_remote_interrupts_allowed | ( | t30_state_t * | s, |
int | state ) |
Allow remote interrupts of FAX exchange.
Allow remote interrupts of FAX exchange.
s | The T.30 context. |
state | True to allow interruptd, else false. |
References t30_state_s::remote_interrupts_allowed.
int t30_restart | ( | t30_state_t * | s, |
bool | calling_party ) |
Restart a T.30 context.
Restart a T.30 context.
s | The T.30 context. |
calling_party | True if the context is for a calling party. False if the context is for an answering party. |
References t30_state_s::calling_party, t30_state_s::current_fallback, t30_state_s::current_status, DEFAULT_TIMER_T0, t30_state_s::ecm_progress, t30_state_s::end_of_procedure_detected, t30_state_s::far_dis_dtc_frame, t30_state_s::far_end_detected, t30_state_s::local_interrupt_pending, t30_state_s::next_phase, t30_state_s::phase, t30_state_s::ppr_count, t30_state_s::receiver_not_ready_count, t30_state_s::rtn_events, t30_state_s::rtp_events, t30_state_s::rx_frame_received, t30_state_s::rx_info, t30_state_s::rx_page_number, t30_state_s::rx_signal_present, t30_state_s::rx_trained, t30_state_s::state, t30_build_dis_or_dtc(), t30_state_s::timer_t0_t1, and t30_state_s::tx_page_number.
Referenced by fax_restart(), t30_init(), t38_terminal_init(), and t38_terminal_restart().
void t30_terminate | ( | t30_state_t * | s | ) |
Cleanup a T.30 context if the call terminates.
Cleanup a T.30 context if the call terminates.
s | The T.30 context. |
References t30_state_s::end_of_procedure_detected, t30_state_s::phase, t30_state_s::state, T30_ERR_CALLDROPPED, and t30_set_status().
void t30_timer_update | ( | t30_state_t * | s, |
int | samples ) |
Report the passage of time to the T.30 engine.
Report the passage of time to the T.30 engine.
s | The T.30 context. |
samples | The time change in 1/8000th second steps. |
References t30_state_s::far_end_detected, t30_state_s::timer_t0_t1, t30_state_s::timer_t2_t4, t30_state_s::timer_t2_t4_is, t30_state_s::timer_t3, and t30_state_s::timer_t5.
Referenced by fax_rx(), and fax_rx_fillin().