t30.h File Reference

Go to the source code of this file.

Classes

struct  t30_state_s
struct  t30_stats_t

Defines

#define _SPANDSP_T30_H_
#define T30_MAX_DIS_DTC_DCS_LEN   22
#define T30_MAX_IDENT_LEN   21
#define T30_MAX_LOCAL_NSF_LEN   100

Typedefs

typedef t30_state_s t30_state_t
typedef void( t30_phase_b_handler_t )(t30_state_t *s, void *user_data, int result)
 T.30 phase B callback handler.
typedef void( t30_phase_d_handler_t )(t30_state_t *s, void *user_data, int result)
 T.30 phase D callback handler.
typedef void( t30_phase_e_handler_t )(t30_state_t *s, void *user_data, int completion_code)
 T.30 phase E callback handler.
typedef int( t30_document_handler_t )(t30_state_t *s, void *user_data, int status)
 T.30 document handler.
typedef void( t30_set_handler_t )(void *user_data, int type, 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.

Enumerations

enum  {
  T30_ERR_OK = 0, T30_ERR_CEDTONE, T30_ERR_T0_EXPIRED, T30_ERR_T1_EXPIRED,
  T30_ERR_T3_EXPIRED, T30_ERR_HDLC_CARRIER, T30_ERR_CANNOT_TRAIN, T30_ERR_OPERINTFAIL,
  T30_ERR_INCOMPATIBLE, T30_ERR_RX_INCAPABLE, T30_ERR_TX_INCAPABLE, T30_ERR_NORESSUPPORT,
  T30_ERR_NOSIZESUPPORT, T30_ERR_UNEXPECTED, T30_ERR_FILEERROR, T30_ERR_NOPAGE,
  T30_ERR_BADTIFF, T30_ERR_BADDCSTX, T30_ERR_BADPGTX, T30_ERR_ECMPHDTX,
  T30_ERR_T5_EXPIRED, T30_ERR_GOTDCNTX, T30_ERR_INVALRSPTX, T30_ERR_NODISTX,
  T30_ERR_PHBDEADTX, T30_ERR_PHDDEADTX, T30_ERR_ECMPHDRX, T30_ERR_GOTDCSRX,
  T30_ERR_INVALCMDRX, T30_ERR_NOCARRIERRX, T30_ERR_NOEOLRX, T30_ERR_NOFAXRX,
  T30_ERR_T2EXPDCNRX, T30_ERR_T2EXPDRX, T30_ERR_T2EXPFAXRX, T30_ERR_T2EXPMPSRX,
  T30_ERR_T2EXPRRRX, T30_ERR_T2EXPRX, T30_ERR_DCNWHYRX, T30_ERR_DCNDATARX,
  T30_ERR_DCNFAXRX, T30_ERR_DCNPHDRX, T30_ERR_DCNRRDRX, T30_ERR_DCNNORTNRX,
  T30_ERR_BADPAGE, T30_ERR_BADTAG, T30_ERR_BADTIFFHDR, T30_ERR_NODATA,
  T30_ERR_NOMEM, T30_ERR_NOPOLL, T30_ERR_RETRYDCN, T30_ERR_CALLDROPPED
}
enum  {
  T30_MODEM_NONE = 0, T30_MODEM_PAUSE, T30_MODEM_CED, T30_MODEM_CNG,
  T30_MODEM_V21, T30_MODEM_V27TER_2400, T30_MODEM_V27TER_4800, T30_MODEM_V29_7200,
  T30_MODEM_V29_9600, T30_MODEM_V17_7200, T30_MODEM_V17_9600, T30_MODEM_V17_12000,
  T30_MODEM_V17_14400, T30_MODEM_DONE
}
enum  {
  T30_FRONT_END_SEND_STEP_COMPLETE = 0, T30_FRONT_END_SEND_COMPLETE, T30_FRONT_END_RECEIVE_COMPLETE, T30_FRONT_END_SIGNAL_PRESENT,
  T30_FRONT_END_SIGNAL_ABSENT
}
enum  {
  T30_SUPPORT_V27TER = 0x01, T30_SUPPORT_V29 = 0x02, T30_SUPPORT_V17 = 0x04, T30_SUPPORT_V34 = 0x08,
  T30_SUPPORT_IAF = 0x10
}
enum  {
  T30_SUPPORT_NO_COMPRESSION = 0x01, T30_SUPPORT_T4_1D_COMPRESSION = 0x02, T30_SUPPORT_T4_2D_COMPRESSION = 0x04, T30_SUPPORT_T6_COMPRESSION = 0x08,
  T30_SUPPORT_T85_COMPRESSION = 0x10, T30_SUPPORT_T43_COMPRESSION = 0x20, T30_SUPPORT_T45_COMPRESSION = 0x40
}
enum  {
  T30_SUPPORT_STANDARD_RESOLUTION = 0x01, T30_SUPPORT_FINE_RESOLUTION = 0x02, T30_SUPPORT_SUPERFINE_RESOLUTION = 0x04, T30_SUPPORT_R4_RESOLUTION = 0x10000,
  T30_SUPPORT_R8_RESOLUTION = 0x20000, T30_SUPPORT_R16_RESOLUTION = 0x40000, T30_SUPPORT_300_300_RESOLUTION = 0x100000, T30_SUPPORT_400_400_RESOLUTION = 0x200000,
  T30_SUPPORT_600_600_RESOLUTION = 0x400000, T30_SUPPORT_1200_1200_RESOLUTION = 0x800000, T30_SUPPORT_300_600_RESOLUTION = 0x1000000, T30_SUPPORT_400_800_RESOLUTION = 0x2000000,
  T30_SUPPORT_600_1200_RESOLUTION = 0x4000000
}
enum  {
  T30_SUPPORT_215MM_WIDTH = 0x01, T30_SUPPORT_255MM_WIDTH = 0x02, T30_SUPPORT_303MM_WIDTH = 0x04, T30_SUPPORT_UNLIMITED_LENGTH = 0x10000,
  T30_SUPPORT_A4_LENGTH = 0x20000, T30_SUPPORT_B4_LENGTH = 0x40000, T30_SUPPORT_US_LETTER_LENGTH = 0x80000, T30_SUPPORT_US_LEGAL_LENGTH = 0x100000
}
enum  { T30_SUPPORT_SEP = 0x01, T30_SUPPORT_PSA = 0x02 }
enum  {
  T30_IAF_MODE_T37 = 0x01, T30_IAF_MODE_T38 = 0x02, T30_IAF_MODE_FLOW_CONTROL = 0x04, T30_IAF_MODE_CONTINUOUS_FLOW = 0x08,
  T30_IAF_MODE_NO_TCF = 0x10, T30_IAF_MODE_NO_FILL_BITS = 0x20, T30_IAF_MODE_NO_INDICATORS = 0x40
}

Functions

int t30_init (t30_state_t *s, int 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.
void t30_release (t30_state_t *s)
 Release a T.30 context.
int t30_restart (t30_state_t *s)
 Restart a T.30 context.
t30_state_tt30_create (int 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)
 Create and initialise a T.30 context.
void t30_free (t30_state_t *s)
 Free a T.30 context.
void t30_terminate (t30_state_t *s)
 Cleanup a T.30 context if the call terminates.
const char * t30_frametype (uint8_t x)
 Return a text name for a T.30 frame type.
void t30_decode_dis_dtc_dcs (t30_state_t *s, const uint8_t *dis, int len)
 Decode a DIS, DTC or DCS frame, and log the contents.
const char * t30_completion_code_to_str (int result)
 Convert a phase E completion code to a short text description.
void t30_set_iaf_mode (t30_state_t *s, int iaf)
 Set Internet aware FAX (IAF) mode.
int t30_set_local_sub_address (t30_state_t *s, const char *sub_address)
 Set the sub-address associated with a T.30 context.
int t30_set_header_info (t30_state_t *s, const char *info)
 Set the header information associated with a T.30 context.
int t30_set_local_ident (t30_state_t *s, const char *id)
 Set the local identifier associated with a T.30 context.
int t30_set_local_nsf (t30_state_t *s, const uint8_t *nsf, int len)
size_t t30_get_sub_address (t30_state_t *s, char *sub_address)
 Get the sub-address associated with a T.30 context.
size_t t30_get_header_info (t30_state_t *s, char *info)
 Get the header information associated with a T.30 context.
size_t t30_get_local_ident (t30_state_t *s, char *id)
 Get the local identifier associated with a T.30 context.
size_t t30_get_far_ident (t30_state_t *s, char *id)
 Get the remote identifier associated with a T.30 context.
const char * t30_get_far_country (t30_state_t *s)
 Get the country of origin of the remote FAX machine associated with a T.30 context.
const char * t30_get_far_vendor (t30_state_t *s)
 Get the name of the vendor of the remote FAX machine associated with a T.30 context.
const char * t30_get_far_model (t30_state_t *s)
 Get the name of the model of the remote FAX machine associated with a T.30 context.
void t30_get_transfer_statistics (t30_state_t *s, t30_stats_t *t)
 Get the current transfer statistics.
void t30_set_phase_b_handler (t30_state_t *s, t30_phase_b_handler_t *handler, void *user_data)
 Set a callback function for T.30 phase B handling.
void t30_set_phase_d_handler (t30_state_t *s, t30_phase_d_handler_t *handler, void *user_data)
 Set a callback function for T.30 phase D handling.
void t30_set_phase_e_handler (t30_state_t *s, t30_phase_e_handler_t *handler, void *user_data)
 Set a callback function for T.30 phase E handling.
void t30_set_document_handler (t30_state_t *s, t30_document_handler_t *handler, void *user_data)
 Set a callback function for T.30 end of document handling.
void t30_set_rx_file (t30_state_t *s, const char *file, int stop_page)
 Set next receive file name.
void t30_set_tx_file (t30_state_t *s, const char *file, int start_page, int stop_page)
 Set next transmit file name.
void t30_set_supported_modems (t30_state_t *s, int supported_modems)
 Specify supported modems.
void t30_set_receiver_not_ready (t30_state_t *s, int count)
 Specify a period of responding with receiver not ready.
void t30_set_supported_compressions (t30_state_t *s, int supported_compressions)
 Specify supported compression types.
void t30_set_supported_resolutions (t30_state_t *s, int supported_resolutions)
 Specify supported resolutions.
void t30_set_supported_image_sizes (t30_state_t *s, int supported_image_sizes)
 Specify supported image sizes.
void t30_set_ecm_capability (t30_state_t *s, int enabled)
 Select ECM capability.
void t30_local_interrupt_request (t30_state_t *s, int state)
 Request a local interrupt of FAX exchange.
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_byte (void *user_data)
 Get a byte of received non-ECM image data.
int t30_non_ecm_get_chunk (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_byte (void *user_data, int byte)
 Process a byte of received non-ECM image data.
void t30_non_ecm_put_chunk (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, int ok, const uint8_t *msg, int len)
 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.


Detailed Description


Typedef Documentation

typedef int( t30_document_handler_t)(t30_state_t *s, void *user_data, int status)

T.30 document handler.

T.30 document handler.

Parameters:
s The T.30 context.
user_data An opaque pointer.
result The document event code.

typedef void( t30_phase_b_handler_t)(t30_state_t *s, void *user_data, int result)

T.30 phase B callback handler.

T.30 phase B callback handler.

Parameters:
s The T.30 context.
user_data An opaque pointer.
result The phase B event code.

typedef void( t30_phase_d_handler_t)(t30_state_t *s, void *user_data, int result)

T.30 phase D callback handler.

T.30 phase D callback handler.

Parameters:
s The T.30 context.
user_data An opaque pointer.
result The phase D event code.

typedef void( t30_phase_e_handler_t)(t30_state_t *s, void *user_data, int completion_code)

T.30 phase E callback handler.

T.30 phase E callback handler.

Parameters:
s The T.30 context.
user_data An opaque pointer.
completion_code The phase E completion code.

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.

Parameters:
user_data An opaque pointer.
msg The HDLC message.
len The length of the message.

typedef void( t30_set_handler_t)(void *user_data, int type, int short_train, int use_hdlc)

T.30 set a receive or transmit type handler.

T.30 set a receive or transmit type handler.

Parameters:
user_data An opaque pointer.
type The modem, tone or silence 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.


Enumeration Type Documentation

anonymous enum

T.30 protocol completion codes, at phase E.

Enumerator:
T30_ERR_CEDTONE  OK
T30_ERR_T0_EXPIRED  The CED tone exceeded 5s
T30_ERR_T1_EXPIRED  Timed out waiting for initial communication
T30_ERR_T3_EXPIRED  Timed out waiting for the first message
T30_ERR_HDLC_CARRIER  Timed out waiting for procedural interrupt
T30_ERR_CANNOT_TRAIN  The HDLC carrier did not stop in a timely manner
T30_ERR_OPERINTFAIL  Failed to train with any of the compatible modems
T30_ERR_INCOMPATIBLE  Operator intervention failed
T30_ERR_RX_INCAPABLE  Far end is not compatible
T30_ERR_TX_INCAPABLE  Far end is not able to receive
T30_ERR_NORESSUPPORT  Far end is not able to transmit
T30_ERR_NOSIZESUPPORT  Far end cannot receive at the resolution of the image
T30_ERR_UNEXPECTED  Far end cannot receive at the size of image
T30_ERR_FILEERROR  Unexpected message received
T30_ERR_NOPAGE  TIFF/F file cannot be opened
T30_ERR_BADTIFF  TIFF/F page not found
T30_ERR_BADDCSTX  TIFF/F format is not compatible
T30_ERR_BADPGTX  Received bad response to DCS or training
T30_ERR_ECMPHDTX  Received a DCN from remote after sending a page
T30_ERR_T5_EXPIRED  Invalid ECM response received from receiver
T30_ERR_GOTDCNTX  Timed out waiting for receiver ready (ECM mode)
T30_ERR_INVALRSPTX  Received a DCN while waiting for a DIS
T30_ERR_NODISTX  Invalid response after sending a page
T30_ERR_PHBDEADTX  Received other than DIS while waiting for DIS
T30_ERR_PHDDEADTX  Received no response to DCS, training or TCF
T30_ERR_ECMPHDRX  No response after sending a page
T30_ERR_GOTDCSRX  Invalid ECM response received from transmitter
T30_ERR_INVALCMDRX  DCS received while waiting for DTC
T30_ERR_NOCARRIERRX  Unexpected command after page received
T30_ERR_NOEOLRX  Carrier lost during fax receive
T30_ERR_NOFAXRX  Timed out while waiting for EOL (end Of line)
T30_ERR_T2EXPDCNRX  Timed out while waiting for first line
T30_ERR_T2EXPDRX  Timer T2 expired while waiting for DCN
T30_ERR_T2EXPFAXRX  Timer T2 expired while waiting for phase D
T30_ERR_T2EXPMPSRX  Timer T2 expired while waiting for fax page
T30_ERR_T2EXPRRRX  Timer T2 expired while waiting for next fax page
T30_ERR_T2EXPRX  Timer T2 expired while waiting for RR command
T30_ERR_DCNWHYRX  Timer T2 expired while waiting for NSS, DCS or MCF
T30_ERR_DCNDATARX  Unexpected DCN while waiting for DCS or DIS
T30_ERR_DCNFAXRX  Unexpected DCN while waiting for image data
T30_ERR_DCNPHDRX  Unexpected DCN while waiting for EOM, EOP or MPS
T30_ERR_DCNRRDRX  Unexpected DCN after EOM or MPS sequence
T30_ERR_DCNNORTNRX  Unexpected DCN after RR/RNR sequence
T30_ERR_BADPAGE  Unexpected DCN after requested retransmission
T30_ERR_BADTAG  TIFF/F page number tag missing
T30_ERR_BADTIFFHDR  Incorrect values for TIFF/F tags
T30_ERR_NODATA  Bad TIFF/F header - incorrect values in fields
T30_ERR_NOMEM  Data requested is not available (NSF, DIS, DCS)
T30_ERR_NOPOLL  Cannot allocate memory for more pages
T30_ERR_RETRYDCN  Poll not accepted
T30_ERR_CALLDROPPED  The call dropped prematurely

anonymous enum

I/O modes for the T.30 protocol.

anonymous enum

Enumerator:
T30_FRONT_END_RECEIVE_COMPLETE  The current receive has completed. This is only needed to report an unexpected end of the receive operation, as might happen with T.38 dying.

anonymous enum

Enumerator:
T30_IAF_MODE_CONTINUOUS_FLOW  Continuous flow mode means data is sent as fast as possible, usually across the Internet, where speed is not constrained by a PSTN modem.
T30_IAF_MODE_NO_TCF  No TCF means TCF is not exchanged. The end points must sort out usable speed issues locally.
T30_IAF_MODE_NO_FILL_BITS  No fill bits means do not insert fill bits, even if the T.30 messages request them.
T30_IAF_MODE_NO_INDICATORS  No indicators means do not send indicator messages when using T.38.


Function Documentation

const char* t30_completion_code_to_str ( int  result  ) 

Convert a phase E completion code to a short text description.

Convert a phase E completion code to a short text description.

Parameters:
result The result code.
Returns:
A pointer to the description.

t30_state_t* t30_create ( int  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 
)

Create and initialise a T.30 context.

Create and initialise a T.30 context.

Parameters:
calling_party TRUE if the context is for a calling party. FALSE if the context is for an answering party.
Returns:
A pointer to the FAX context, or NULL if one could not be created.

void t30_decode_dis_dtc_dcs ( t30_state_t s,
const uint8_t *  dis,
int  len 
)

Decode a DIS, DTC or DCS frame, and log the contents.

Decode a DIS, DTC or DCS frame, and log the contents.

Parameters:
s The T.30 context.
dis A pointer to the frame to be decoded.
len The length of the frame.

const char* t30_frametype ( uint8_t  x  ) 

Return a text name for a T.30 frame type.

Return a text name for a T.30 frame type.

Parameters:
x The frametype octet.
Returns:
A pointer to the text name for the frame type. If the frame type is not value, the string "???" is returned.

void t30_free ( t30_state_t s  ) 

Free a T.30 context.

Free a T.30 context.

Parameters:
s The T.30 context.

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.).

Parameters:
user_data The T.30 context.
status The type of status change which occured.

const char* t30_get_far_country ( t30_state_t s  ) 

Get the country of origin of the remote FAX machine associated with a T.30 context.

Get the country of origin of the remote FAX machine associated with a T.30 context.

Parameters:
s The T.30 context.
Returns:
a pointer to the country name, or NULL if the country is not known.

size_t t30_get_far_ident ( t30_state_t s,
char *  id 
)

Get the remote identifier associated with a T.30 context.

Get the remote FAX machine identifier associated with a T.30 context.

Parameters:
s The T.30 context.
id A pointer to a buffer for the identifier. The buffer should be at least 21 bytes long.
Returns:
the length of the string.

const char* t30_get_far_model ( t30_state_t s  ) 

Get the name of the model of the remote FAX machine associated with a T.30 context.

Get the name of the model of the remote FAX machine associated with a T.30 context.

Parameters:
s The T.30 context.
Returns:
a pointer to the model name, or NULL if the model is not known.

const char* t30_get_far_vendor ( t30_state_t s  ) 

Get the name of the vendor of the remote FAX machine associated with a T.30 context.

Get the name of the vendor of the remote FAX machine associated with a T.30 context.

Parameters:
s The T.30 context.
Returns:
a pointer to the vendor name, or NULL if the vendor is not known.

size_t t30_get_header_info ( t30_state_t s,
char *  info 
)

Get the header information associated with a T.30 context.

Get the header information associated with a T.30 context.

Parameters:
s The T.30 context.
sub_address A pointer to a buffer for the header information. The buffer should be at least 51 bytes long.
Returns:
the length of the string.

size_t t30_get_local_ident ( t30_state_t s,
char *  id 
)

Get the local identifier associated with a T.30 context.

Get the local FAX machine identifier associated with a T.30 context.

Parameters:
s The T.30 context.
id A pointer to a buffer for the identifier. The buffer should be at least 21 bytes long.
Returns:
the length of the string.

size_t t30_get_sub_address ( t30_state_t s,
char *  sub_address 
)

Get the sub-address associated with a T.30 context.

Get the sub-address associated with a T.30 context.

Parameters:
s The T.30 context.
sub_address A pointer to a buffer for the sub-address. The buffer should be at least 21 bytes long.
Returns:
the length of the string.

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.

Parameters:
s The T.30 context.
t A pointer to a buffer for the statistics.

void t30_hdlc_accept ( void *  user_data,
int  ok,
const uint8_t *  msg,
int  len 
)

Process a received HDLC frame.

Process a received HDLC frame.

Parameters:
s The T.30 context.
ok TRUE if the frame was received without error.
msg The HDLC message.
int The length of the message, in octets.

int t30_init ( t30_state_t s,
int  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.

Parameters:
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.
Returns:
0 for OK, else -1.

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.

Parameters:
s The T.30 context.
state TRUE to enable interrupt request, else FALSE.

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.

Parameters:
user_data An opaque pointer, which must point to the T.30 context.
Returns:
The next bit to transmit.

int t30_non_ecm_get_byte ( void *  user_data  ) 

Get a byte of received non-ECM image data.

Get a byte of received non-ECM image data.

Parameters:
user_data An opaque pointer, which must point to the T.30 context.
Returns:
The next byte to transmit.

int t30_non_ecm_get_chunk ( 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.

Parameters:
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.
Returns:
The actual length of the chunk.

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.

Parameters:
user_data An opaque pointer, which must point to the T.30 context.
bit The received bit.

void t30_non_ecm_put_byte ( void *  user_data,
int  byte 
)

Process a byte of received non-ECM image data.

Process a byte of received non-ECM image data.

Parameters:
user_data An opaque pointer, which must point to the T.30 context.
byte The received byte.

void t30_non_ecm_put_chunk ( 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.

Parameters:
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.

void t30_release ( t30_state_t s  ) 

Release a T.30 context.

Release a T.30 context.

Parameters:
s The T.30 context.

int t30_restart ( t30_state_t s  ) 

Restart a T.30 context.

Restart a T.30 context.

Parameters:
s The T.30 context.
Returns:
0 for OK, else -1.

void t30_set_document_handler ( t30_state_t s,
t30_document_handler_t handler,
void *  user_data 
)

Set a callback function for T.30 end of document handling.

Set a callback function for T.30 end of document handling.

Parameters:
s The T.30 context.
handler The callback function
user_data An opaque pointer passed to the callback function.

void t30_set_ecm_capability ( t30_state_t s,
int  enabled 
)

Select ECM capability.

Specify if error correction mode (ECM) is allowed by a T.30 context.

Parameters:
s The T.30 context.
enabled TRUE for ECM capable, FALSE for not ECM capable.

int t30_set_header_info ( t30_state_t s,
const char *  info 
)

Set the header information associated with a T.30 context.

Set the header information associated with a T.30 context.

Parameters:
s The T.30 context.
info A pointer to the information string.
Returns:
0 for OK, else -1.

void t30_set_iaf_mode ( t30_state_t s,
int  iaf 
)

Set Internet aware FAX (IAF) mode.

Set Internet aware FAX (IAF) mode.

Parameters:
s The T.30 context.
iaf TRUE for IAF, or FALSE for non-IAF.

int t30_set_local_ident ( t30_state_t s,
const char *  id 
)

Set the local identifier associated with a T.30 context.

Set the local identifier associated with a T.30 context.

Parameters:
s The T.30 context.
id A pointer to the identifier.
Returns:
0 for OK, else -1.

int t30_set_local_sub_address ( t30_state_t s,
const char *  sub_address 
)

Set the sub-address associated with a T.30 context.

Set the sub-address associated with a T.30 context.

Parameters:
s The T.30 context.
sub_address A pointer to the sub-address.
Returns:
0 for OK, else -1.

void t30_set_phase_b_handler ( t30_state_t s,
t30_phase_b_handler_t handler,
void *  user_data 
)

Set a callback function for T.30 phase B handling.

Set a callback function for T.30 phase B handling.

Parameters:
s The T.30 context.
handler The callback function
user_data An opaque pointer passed to the callback function.

void t30_set_phase_d_handler ( t30_state_t s,
t30_phase_d_handler_t handler,
void *  user_data 
)

Set a callback function for T.30 phase D handling.

Set a callback function for T.30 phase D handling.

Parameters:
s The T.30 context.
handler The callback function
user_data An opaque pointer passed to the callback function.

void t30_set_phase_e_handler ( t30_state_t s,
t30_phase_e_handler_t handler,
void *  user_data 
)

Set a callback function for T.30 phase E handling.

Set a callback function for T.30 phase E handling.

Parameters:
s The T.30 context.
handler The callback function
user_data An opaque pointer passed to the callback function.

void t30_set_receiver_not_ready ( t30_state_t s,
int  count 
)

Specify a period of responding with receiver not ready.

Specify a period of responding with receiver not ready.

Parameters:
s The T.30 context.
count The number of times to report receiver not ready.

void t30_set_rx_file ( t30_state_t s,
const char *  file,
int  stop_page 
)

Set next receive file name.

Specify the file name of the next TIFF file to be received by a T.30 context.

Parameters:
s The T.30 context.
file The file name
stop_page The maximum page to receive. -1 for no restriction.

void t30_set_supported_compressions ( t30_state_t s,
int  supported_compressions 
)

Specify supported compression types.

Specify which compression types are supported by a T.30 context.

Parameters:
s The T.30 context.
supported_compressions Bit field list of the supported compression types.

void t30_set_supported_image_sizes ( t30_state_t s,
int  supported_image_sizes 
)

Specify supported image sizes.

Specify which images sizes are supported by a T.30 context.

Parameters:
s The T.30 context.
supported_image_sizes Bit field list of the supported widths and lengths.

void t30_set_supported_modems ( t30_state_t s,
int  supported_modems 
)

Specify supported modems.

Specify which modem types are supported by a T.30 context.

Parameters:
s The T.30 context.
supported_modems Bit field list of the supported modems.

void t30_set_supported_resolutions ( t30_state_t s,
int  supported_resolutions 
)

Specify supported resolutions.

Specify which resolutions are supported by a T.30 context.

Parameters:
s The T.30 context.
supported_compressions Bit field list of the supported resolutions.

void t30_set_tx_file ( t30_state_t s,
const char *  file,
int  start_page,
int  stop_page 
)

Set next transmit file name.

Specify the file name of the next TIFF file to be transmitted by a T.30 context.

Parameters:
s The T.30 context.
file The file name
start_page The first page to send. -1 for no restriction.
stop_page The last page to send. -1 for no restriction.

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.

Parameters:
s The T.30 context.

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.

Parameters:
s The T.30 context.
samples The time change in 1/8000th second steps.


Generated on Tue Jul 24 11:29:29 2007 for libspandsp by  doxygen 1.5.2