t30.h File Reference

Go to the source code of this file.

Classes

struct  t30_state_s
struct  t30_stats_t

Defines

#define _T30_H_
#define MAXFRAME   252

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 void( t30_flush_handler_t )(t30_state_t *s, void *user_data, int which)

Enumerations

enum  {
  T30_ERR_OK = 0, T30_ERR_CEDTONE, T30_ERR_T0EXPIRED, T30_ERR_T1EXPIRED,
  T30_ERR_T3EXPIRED, T30_ERR_HDLCCARR, T30_ERR_CANNOTTRAIN, T30_ERR_OPERINTFAIL,
  T30_ERR_INCOMPATIBLE, T30_ERR_NOTRXCAPABLE, T30_ERR_NOTTXCAPABLE, T30_ERR_UNEXPECTED,
  T30_ERR_NORESSUPPORT, T30_ERR_NOSIZESUPPORT, T30_ERR_FILEERROR, T30_ERR_NOPAGE,
  T30_ERR_BADTIFF, T30_ERR_UNSUPPORTED, T30_ERR_BADDCSTX, T30_ERR_BADPGTX,
  T30_ERR_ECMPHDTX, T30_ERR_ECMRNRTX, T30_ERR_GOTDCNTX, T30_ERR_INVALRSPTX,
  T30_ERR_NODISTX, T30_ERR_NXTCMDTX, 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_NXTCMDRX, 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_BADPARM, T30_ERR_BADSTATE,
  T30_ERR_CMDDATA, T30_ERR_DISCONNECT, T30_ERR_INVALARG, T30_ERR_INVALFUNC,
  T30_ERR_NODATA, T30_ERR_NOMEM, T30_ERR_NOPOLL, T30_ERR_NOSTATE,
  T30_ERR_RETRYDCN
}
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
}

Functions

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.
int fax_init (t30_state_t *s, int calling_party, void *user_data)
 Initialise a T.30 context.
void fax_release (t30_state_t *s)
 Release a T.30 context.
int t30_set_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_get_sub_address (t30_state_t *s, char *sub_address)
 Get the sub-address associated with a T.30 context.
int t30_get_header_info (t30_state_t *s, char *info)
 Get the header information associated with a T.30 context.
int t30_get_local_ident (t30_state_t *s, char *id)
 Get the local identifier associated with a T.30 context.
int t30_get_far_ident (t30_state_t *s, char *id)
 Get the remote identifier 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 fax_set_flush_handler (t30_state_t *s, t30_flush_handler_t *handler, void *user_data)
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_local_interrupt_request (t30_state_t *s, int state)
 Request a local interrupt of FAX exchange.
char * t30_completion_code_to_str (int err)
 Convert a phase E completion code to a short text description.
int fax_rx (t30_state_t *s, int16_t *buf, int len)
 Apply FAX receive processing to a block of audio samples.
int fax_tx (t30_state_t *s, int16_t *buf, int max_len)
 Apply FAX transmit processing to generate a block of audio samples.


Detailed Description


Typedef Documentation

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.


Enumeration Type Documentation

anonymous enum

T.30 protocol completion codes, at phase E.

anonymous enum

I/O modes for the T.30 protocol.


Function Documentation

int fax_init ( t30_state_t s,
int  calling_party,
void *  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.
user_data An opaque pointer which is associated with the T.30 context, and supplied in callbacks.
Returns:
0 for OK, else -1.

void fax_release ( t30_state_t s  ) 

Release a T.30 context.

Release a T.30 context.

Parameters:
s The T.30 context.

int fax_rx ( t30_state_t s,
int16_t *  buf,
int  len 
)

Apply FAX receive processing to a block of audio samples.

Apply FAX receive processing to a block of audio samples.

Parameters:
s The T.30 context.
buf The audio sample buffer.
len The number of samples in the buffer.
Returns:
The number of samples unprocessed. This should only be non-zero if the software has reached the end of the FAX call.

int fax_tx ( t30_state_t s,
int16_t *  buf,
int  max_len 
)

Apply FAX transmit processing to generate a block of audio samples.

Apply FAX transmit processing to generate a block of audio samples.

Parameters:
s The T.30 context.
buf The audio sample buffer.
max_len The number of samples to be generated.
Returns:
The number of samples actually generated. This will be zero when there is nothing to send.

char* t30_completion_code_to_str ( int  err  ) 

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

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

Parameters:
err The error code.
Returns:
A pointer to the description.

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.

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.

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

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

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

int 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_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_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.

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.

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

int t30_set_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_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.


Generated on Fri Nov 10 09:40:24 2006 for libspandsp by  doxygen 1.5.1