spandsp 0.0.6
t30_state_s Struct Reference

#include <t30.h>

Classes

union  [union].t4
 T.4 context for reading or writing image data. More...

Public Attributes

union  t4
int operation_in_progress
 The type of FAX operation currently in progress.
int calling_party
 True if behaving as the calling party.
int iaf
 Internet aware FAX mode bit mask.
int supported_modems
 A bit mask of the currently supported modem types.
int supported_compressions
 A bit mask of the currently supported image compression modes.
int supported_resolutions
 A bit mask of the currently supported image resolutions.
int supported_image_sizes
 A bit mask of the currently supported image sizes.
int supported_t30_features
 A bit mask of the currently supported T.30 special features.
int ecm_allowed
 True is ECM mode handling is enabled.
int retransmit_capable
 True if we are capable of retransmitting pages.
char rx_dcs_string [T30_MAX_DIS_DTC_DCS_LEN *3+1]
 The received DCS, formatted as an ASCII string, for inclusion in the TIFF file.
char header_info [T30_MAX_PAGE_HEADER_INFO+1]
 The text which will be used in FAX page header. No text results in no header line.
int header_overlays_image
 True for FAX page headers to overlay (i.e. replace) the beginning of the page image. False for FAX page headers to add to the overall length of the page.
int use_own_tz
 Use private timezone if true.
tz_t tz
 Optional per instance time zone for the FAX page header timestamp.
int remote_interrupts_allowed
 True if remote T.30 procedural interrupts are allowed.
t30_exchanged_info_t rx_info
 The information fields received.
t30_exchanged_info_t tx_info
 The information fields to be transmitted.
const char * country
 The country of origin of the remote machine, if known, else NULL.
const char * vendor
 The vendor of the remote machine, if known, else NULL.
const char * model
 The model of the remote machine, if known, else NULL.
t30_phase_b_handler_t * phase_b_handler
 A pointer to a callback routine to be called when phase B events occur.
void * phase_b_user_data
 An opaque pointer supplied in event B callbacks.
t30_phase_d_handler_t * phase_d_handler
 A pointer to a callback routine to be called when phase D events occur.
void * phase_d_user_data
 An opaque pointer supplied in event D callbacks.
t30_phase_e_handler_t * phase_e_handler
 A pointer to a callback routine to be called when phase E events occur.
void * phase_e_user_data
 An opaque pointer supplied in event E callbacks.
t30_real_time_frame_handler_t * real_time_frame_handler
 A pointer to a callback routine to be called when frames are exchanged.
void * real_time_frame_user_data
 An opaque pointer supplied in real time frame callbacks.
t30_document_handler_t * document_handler
 A pointer to a callback routine to be called when document events (e.g. end of transmitted document) occur.
void * document_user_data
 An opaque pointer supplied in document callbacks.
t30_set_handler_t * set_rx_type_handler
 The handler for changes to the receive mode.
void * set_rx_type_user_data
 An opaque pointer passed to the handler for changes to the receive mode.
t30_set_handler_t * set_tx_type_handler
 The handler for changes to the transmit mode.
void * set_tx_type_user_data
 An opaque pointer passed to the handler for changes to the transmit mode.
t30_send_hdlc_handler_t * send_hdlc_handler
 The transmitted HDLC frame handler.
void * send_hdlc_user_data
 An opaque pointer passed to the transmitted HDLC frame handler.
uint8_t local_min_scan_time_code
 The DIS code for the minimum scan row time we require. This is usually 0ms, but if we are trying to simulate another type of FAX machine, we may need a non-zero value here.
int phase
 The current T.30 phase.
int next_phase
 The T.30 phase to change to when the current phase ends.
int state
 The current state of the T.30 state machine.
int step
 The step in sending a sequence of HDLC frames.
uint8_t dcs_frame [T30_MAX_DIS_DTC_DCS_LEN]
 The preparation buffer for the DCS message to be transmitted.
int dcs_len
 The length of the DCS message to be transmitted.
uint8_t local_dis_dtc_frame [T30_MAX_DIS_DTC_DCS_LEN]
 The preparation buffer for DIS or DTC message to be transmitted.
int local_dis_dtc_len
 The length of the DIS or DTC message to be transmitted.
uint8_t far_dis_dtc_frame [T30_MAX_DIS_DTC_DCS_LEN]
 The last DIS or DTC message received form the far end.
int far_dis_dtc_len
 The length of the last DIS or DTC message received form the far end.
int dis_received
 True if a valid DIS has been received from the far end.
int short_train
 True if the short training sequence should be used.
int image_carrier_attempted
 True if an image carrier appears to have been received, even if it did not successfully train.
int tcf_test_bits
 A count of the number of bits in the trainability test. This counts down to zero when sending TCF, and counts up when receiving it.
int tcf_current_zeros
 The current count of consecutive received zero bits, during the trainability test.
int tcf_most_zeros
 The maximum consecutive received zero bits seen to date, during the trainability test.
int current_fallback
 The current fallback step for the fast message transfer modem.
int current_permitted_modems
 The subset of supported modems allowed at the current time, allowing for negotiation.
int rx_signal_present
 True if a carrier is present. Otherwise false.
int rx_trained
 True if a modem has trained correctly.
int rx_frame_received
 True if a valid HDLC frame has been received in the current reception period.
int current_rx_type
 Current reception mode.
int current_tx_type
 Current transmission mode.
int timer_t0_t1
 T0 is the answer timeout when calling another FAX machine. Placing calls is handled outside the FAX processing, but this timeout keeps running until V.21 modulation is sent or received. T1 is the remote terminal identification timeout (in audio samples).
int timer_t2_t4
 T2, T2A and T2B are the HDLC command timeouts. T4, T4A and T4B are the HDLC response timeouts (in audio samples).
int timer_t2_t4_is
 A value specifying which of the possible timers is currently running in timer_t2_t4.
int timer_t3
 Procedural interrupt timeout (in audio samples).
int timer_t5
 This is only used in error correcting mode.
int timer_t6
 This is only used in full duplex (e.g. ISDN) modes.
int timer_t7
 This is only used in full duplex (e.g. ISDN) modes.
int timer_t8
 This is only used in full duplex (e.g. ISDN) modes.
int far_end_detected
 True once the far end FAX entity has been detected.
int end_of_procedure_detected
 True once the end of procedure condition has been detected.
int local_interrupt_pending
 True if a local T.30 interrupt is pending.
int line_encoding
 The image coding being used on the line.
int output_encoding
 The image coding being used for output files.
uint8_t min_scan_time_code
 The current DCS message minimum scan time code.
int x_resolution
 The X direction resolution of the current image, in pixels per metre.
int y_resolution
 The Y direction resolution of the current image, in pixels per metre.
t4_image_width_t image_width
 The width of the current image, in pixels.
int retries
 Current number of retries of the action in progress.
int error_correcting_mode
 True if error correcting mode is used.
int error_correcting_mode_retries
 The number of HDLC frame retries, if error correcting mode is used.
int ppr_count
 The current count of consecutive T30_PPR messages.
int receiver_not_ready_count
 The current count of consecutive T30_RNR messages.
int octets_per_ecm_frame
 The number of octets to be used per ECM frame.
uint8_t ecm_data [256][260]
 The ECM partial page buffer.
int16_t ecm_len [256]
 The lengths of the frames in the ECM partial page buffer.
uint8_t ecm_frame_map [3+32]
 A bit map of the OK ECM frames, constructed as a PPR frame.
int rx_page_number
 The current page number for receiving, in ECM or non-ECM mode. This is reset at the start of a call.
int tx_page_number
 The current page number for sending, in ECM or non-ECM mode. This is reset at the start of a call.
int ecm_block
 The current block number, in ECM mode.
int ecm_frames
 The number of frames in the current block number, in ECM mode.
int ecm_frames_this_tx_burst
 The number of frames sent in the current burst of image transmission, in ECM mode.
int ecm_current_tx_frame
 The current ECM frame, during ECM transmission.
int ecm_at_page_end
 True if we are at the end of an ECM page to se sent - i.e. there are no more partial pages still to come.
int last_rx_page_result
 The last result for a received non-ECM page - T30_MPS, T30_RTP, or T30_RTN.
int next_tx_step
 The transmission step queued to follow the one in progress.
uint8_t next_rx_step
 The FCF for the next receive step.
char rx_file [256]
 Image file name for image reception.
int rx_stop_page
 The last page we are prepared accept for a received image file. -1 means no restriction.
char tx_file [256]
 Image file name to be sent.
int tx_start_page
 The first page to be sent from the image file. -1 means no restriction.
int tx_stop_page
 The last page to be sent from the image file. -1 means no restriction.
int current_status
 The current completion status.
uint8_t last_pps_fcf2
 the FCF2 field of the last PPS message we received.
int rx_ecm_block_ok
 True if all frames of the current received ECM block are now OK.
int ecm_progress
 A count of successfully received ECM frames, to assess progress as a basis for deciding whether to continue error correction when PPRs keep repeating.
int rtp_events
 The number of RTP events.
int rtn_events
 The number of RTN events.
logging_state_t logging
 Error and flow logging control.

Detailed Description

T.30 FAX channel descriptor. This defines the state of a single working instance of a T.30 FAX channel.

Member Data Documentation

◆ calling_party

int t30_state_s::calling_party

True if behaving as the calling party.

Referenced by t30_init(), and t30_restart().

◆ country

const char* t30_state_s::country

The country of origin of the remote machine, if known, else NULL.

Referenced by t30_get_rx_country().

◆ current_fallback

int t30_state_s::current_fallback

The current fallback step for the fast message transfer modem.

Referenced by t30_get_transfer_statistics(), and t30_restart().

◆ current_status

int t30_state_s::current_status

The current completion status.

Referenced by t30_get_transfer_statistics(), t30_restart(), and t30_set_status().

◆ dis_received

int t30_state_s::dis_received

True if a valid DIS has been received from the far end.

Referenced by t30_front_end_status().

◆ document_handler

t30_document_handler_t* t30_state_s::document_handler

A pointer to a callback routine to be called when document events (e.g. end of transmitted document) occur.

Referenced by t30_set_document_handler().

◆ document_user_data

void* t30_state_s::document_user_data

An opaque pointer supplied in document callbacks.

Referenced by t30_set_document_handler().

◆ ecm_allowed

int t30_state_s::ecm_allowed

True is ECM mode handling is enabled.

Referenced by t30_set_ecm_capability().

◆ ecm_progress

int t30_state_s::ecm_progress

A count of successfully received ECM frames, to assess progress as a basis for deciding whether to continue error correction when PPRs keep repeating.

Referenced by t30_restart().

◆ end_of_procedure_detected

int t30_state_s::end_of_procedure_detected

True once the end of procedure condition has been detected.

Referenced by t30_restart(), and t30_terminate().

◆ error_correcting_mode

int t30_state_s::error_correcting_mode

True if error correcting mode is used.

Referenced by t30_front_end_status(), and t30_get_transfer_statistics().

◆ error_correcting_mode_retries

int t30_state_s::error_correcting_mode_retries

The number of HDLC frame retries, if error correcting mode is used.

Referenced by t30_get_transfer_statistics().

◆ far_dis_dtc_frame

uint8_t t30_state_s::far_dis_dtc_frame[T30_MAX_DIS_DTC_DCS_LEN]

The last DIS or DTC message received form the far end.

Referenced by t30_restart().

◆ far_dis_dtc_len

int t30_state_s::far_dis_dtc_len

The length of the last DIS or DTC message received form the far end.

Referenced by t30_restart().

◆ far_end_detected

int t30_state_s::far_end_detected

True once the far end FAX entity has been detected.

Referenced by t30_restart(), and t30_timer_update().

◆ header_info

char t30_state_s::header_info[T30_MAX_PAGE_HEADER_INFO+1]

The text which will be used in FAX page header. No text results in no header line.

Referenced by t30_get_tx_page_header_info(), and t30_set_tx_page_header_info().

◆ header_overlays_image

int t30_state_s::header_overlays_image

True for FAX page headers to overlay (i.e. replace) the beginning of the page image. False for FAX page headers to add to the overall length of the page.

Referenced by t30_set_tx_page_header_overlays_image().

◆ iaf

int t30_state_s::iaf

Internet aware FAX mode bit mask.

Referenced by t30_front_end_status(), and t30_set_iaf_mode().

◆ image_carrier_attempted

int t30_state_s::image_carrier_attempted

True if an image carrier appears to have been received, even if it did not successfully train.

Referenced by t30_front_end_status().

◆ last_rx_page_result

int t30_state_s::last_rx_page_result

The last result for a received non-ECM page - T30_MPS, T30_RTP, or T30_RTN.

Referenced by t30_front_end_status().

◆ local_interrupt_pending

int t30_state_s::local_interrupt_pending

True if a local T.30 interrupt is pending.

Referenced by t30_local_interrupt_request(), and t30_restart().

◆ local_min_scan_time_code

uint8_t t30_state_s::local_min_scan_time_code

The DIS code for the minimum scan row time we require. This is usually 0ms, but if we are trying to simulate another type of FAX machine, we may need a non-zero value here.

Referenced by t30_init(), and t30_set_minimum_scan_line_time().

◆ logging

◆ model

const char* t30_state_s::model

The model of the remote machine, if known, else NULL.

Referenced by t30_get_rx_model().

◆ next_phase

int t30_state_s::next_phase

The T.30 phase to change to when the current phase ends.

Referenced by t30_restart().

◆ next_rx_step

uint8_t t30_state_s::next_rx_step

The FCF for the next receive step.

Referenced by t30_front_end_status().

◆ next_tx_step

int t30_state_s::next_tx_step

The transmission step queued to follow the one in progress.

Referenced by t30_front_end_status().

◆ operation_in_progress

int t30_state_s::operation_in_progress

The type of FAX operation currently in progress.

Referenced by t30_get_transfer_statistics().

◆ output_encoding

int t30_state_s::output_encoding

The image coding being used for output files.

Referenced by t30_init(), and t30_set_rx_encoding().

◆ phase

int t30_state_s::phase

The current T.30 phase.

Referenced by t30_call_active(), t30_front_end_status(), t30_restart(), and t30_terminate().

◆ phase_b_handler

t30_phase_b_handler_t* t30_state_s::phase_b_handler

A pointer to a callback routine to be called when phase B events occur.

Referenced by t30_set_phase_b_handler().

◆ phase_b_user_data

void* t30_state_s::phase_b_user_data

An opaque pointer supplied in event B callbacks.

Referenced by t30_set_phase_b_handler().

◆ phase_d_handler

t30_phase_d_handler_t* t30_state_s::phase_d_handler

A pointer to a callback routine to be called when phase D events occur.

Referenced by t30_set_phase_d_handler().

◆ phase_d_user_data

void* t30_state_s::phase_d_user_data

An opaque pointer supplied in event D callbacks.

Referenced by t30_set_phase_d_handler().

◆ phase_e_handler

t30_phase_e_handler_t* t30_state_s::phase_e_handler

A pointer to a callback routine to be called when phase E events occur.

Referenced by t30_set_phase_e_handler().

◆ phase_e_user_data

void* t30_state_s::phase_e_user_data

An opaque pointer supplied in event E callbacks.

Referenced by t30_set_phase_e_handler().

◆ ppr_count

int t30_state_s::ppr_count

The current count of consecutive T30_PPR messages.

Referenced by t30_restart().

◆ real_time_frame_handler

t30_real_time_frame_handler_t* t30_state_s::real_time_frame_handler

A pointer to a callback routine to be called when frames are exchanged.

Referenced by t30_set_real_time_frame_handler().

◆ real_time_frame_user_data

void* t30_state_s::real_time_frame_user_data

An opaque pointer supplied in real time frame callbacks.

Referenced by t30_set_real_time_frame_handler().

◆ receiver_not_ready_count

int t30_state_s::receiver_not_ready_count

The current count of consecutive T30_RNR messages.

Referenced by t30_restart(), and t30_set_receiver_not_ready().

◆ remote_interrupts_allowed

int t30_state_s::remote_interrupts_allowed

True if remote T.30 procedural interrupts are allowed.

Referenced by t30_remote_interrupts_allowed().

◆ retries

int t30_state_s::retries

Current number of retries of the action in progress.

Referenced by t30_front_end_status().

◆ rtn_events

int t30_state_s::rtn_events

The number of RTN events.

Referenced by t30_get_transfer_statistics(), and t30_restart().

◆ rtp_events

int t30_state_s::rtp_events

The number of RTP events.

Referenced by t30_get_transfer_statistics(), and t30_restart().

◆ rx_file

char t30_state_s::rx_file[256]

Image file name for image reception.

Referenced by t30_set_rx_file().

◆ rx_frame_received

int t30_state_s::rx_frame_received

True if a valid HDLC frame has been received in the current reception period.

Referenced by t30_restart().

◆ rx_info

◆ rx_page_number

int t30_state_s::rx_page_number

The current page number for receiving, in ECM or non-ECM mode. This is reset at the start of a call.

Referenced by t30_get_transfer_statistics(), and t30_restart().

◆ rx_signal_present

int t30_state_s::rx_signal_present

True if a carrier is present. Otherwise false.

Referenced by t30_front_end_status(), and t30_restart().

◆ rx_stop_page

int t30_state_s::rx_stop_page

The last page we are prepared accept for a received image file. -1 means no restriction.

Referenced by t30_set_rx_file().

◆ rx_trained

int t30_state_s::rx_trained

True if a modem has trained correctly.

Referenced by t30_restart().

◆ send_hdlc_handler

t30_send_hdlc_handler_t* t30_state_s::send_hdlc_handler

The transmitted HDLC frame handler.

Referenced by t30_init().

◆ send_hdlc_user_data

void* t30_state_s::send_hdlc_user_data

An opaque pointer passed to the transmitted HDLC frame handler.

Referenced by t30_init().

◆ set_rx_type_handler

t30_set_handler_t* t30_state_s::set_rx_type_handler

The handler for changes to the receive mode.

Referenced by t30_init().

◆ set_rx_type_user_data

void* t30_state_s::set_rx_type_user_data

An opaque pointer passed to the handler for changes to the receive mode.

Referenced by t30_init().

◆ set_tx_type_handler

t30_set_handler_t* t30_state_s::set_tx_type_handler

The handler for changes to the transmit mode.

Referenced by t30_init().

◆ set_tx_type_user_data

void* t30_state_s::set_tx_type_user_data

An opaque pointer passed to the handler for changes to the transmit mode.

Referenced by t30_init().

◆ short_train

int t30_state_s::short_train

True if the short training sequence should be used.

Referenced by t30_front_end_status().

◆ state

int t30_state_s::state

◆ step

int t30_state_s::step

The step in sending a sequence of HDLC frames.

Referenced by t30_front_end_status().

◆ supported_compressions

int t30_state_s::supported_compressions

A bit mask of the currently supported image compression modes.

Referenced by t30_init(), and t30_set_supported_compressions().

◆ supported_image_sizes

int t30_state_s::supported_image_sizes

A bit mask of the currently supported image sizes.

Referenced by t30_init(), and t30_set_supported_image_sizes().

◆ supported_modems

int t30_state_s::supported_modems

A bit mask of the currently supported modem types.

Referenced by fax_init(), fax_restart(), t30_init(), and t30_set_supported_modems().

◆ supported_resolutions

int t30_state_s::supported_resolutions

A bit mask of the currently supported image resolutions.

Referenced by t30_init(), and t30_set_supported_resolutions().

◆ supported_t30_features

int t30_state_s::supported_t30_features

A bit mask of the currently supported T.30 special features.

Referenced by t30_set_supported_t30_features().

◆ tcf_current_zeros

int t30_state_s::tcf_current_zeros

The current count of consecutive received zero bits, during the trainability test.

Referenced by t30_non_ecm_put_byte(), and t30_non_ecm_put_chunk().

◆ tcf_most_zeros

int t30_state_s::tcf_most_zeros

The maximum consecutive received zero bits seen to date, during the trainability test.

Referenced by t30_non_ecm_put_byte(), and t30_non_ecm_put_chunk().

◆ tcf_test_bits

int t30_state_s::tcf_test_bits

A count of the number of bits in the trainability test. This counts down to zero when sending TCF, and counts up when receiving it.

Referenced by t30_non_ecm_get_byte(), t30_non_ecm_get_chunk(), t30_non_ecm_put_byte(), and t30_non_ecm_put_chunk().

◆ timer_t0_t1

int t30_state_s::timer_t0_t1

T0 is the answer timeout when calling another FAX machine. Placing calls is handled outside the FAX processing, but this timeout keeps running until V.21 modulation is sent or received. T1 is the remote terminal identification timeout (in audio samples).

Referenced by t30_restart(), and t30_timer_update().

◆ timer_t2_t4

int t30_state_s::timer_t2_t4

T2, T2A and T2B are the HDLC command timeouts. T4, T4A and T4B are the HDLC response timeouts (in audio samples).

Referenced by t30_timer_update().

◆ timer_t2_t4_is

int t30_state_s::timer_t2_t4_is

A value specifying which of the possible timers is currently running in timer_t2_t4.

Referenced by t30_timer_update().

◆ timer_t3

int t30_state_s::timer_t3

Procedural interrupt timeout (in audio samples).

Referenced by t30_local_interrupt_request(), and t30_timer_update().

◆ timer_t5

int t30_state_s::timer_t5

This is only used in error correcting mode.

Referenced by t30_timer_update().

◆ tx_file

char t30_state_s::tx_file[256]

Image file name to be sent.

Referenced by t30_set_tx_file().

◆ tx_info

◆ tx_page_number

int t30_state_s::tx_page_number

The current page number for sending, in ECM or non-ECM mode. This is reset at the start of a call.

Referenced by t30_get_transfer_statistics(), and t30_restart().

◆ tx_start_page

int t30_state_s::tx_start_page

The first page to be sent from the image file. -1 means no restriction.

Referenced by t30_set_tx_file().

◆ tx_stop_page

int t30_state_s::tx_stop_page

The last page to be sent from the image file. -1 means no restriction.

Referenced by t30_set_tx_file().

◆ tz

tz_t t30_state_s::tz

Optional per instance time zone for the FAX page header timestamp.

Referenced by t30_set_tx_page_header_tz().

◆ use_own_tz

int t30_state_s::use_own_tz

Use private timezone if true.

Referenced by t30_set_tx_page_header_tz().

◆ vendor

const char* t30_state_s::vendor

The vendor of the remote machine, if known, else NULL.

Referenced by t30_get_rx_vendor().


The documentation for this struct was generated from the following file: