
Description | Example | Errors
Name: |
long ATFX_SPEED(dev) | |
Inputs: |
int dev |
fax channel device handle |
Returns: |
final transfer speed if successful | |
|
AT_FAILURE if error | |
Includes: |
srllib.h | |
|
dxxxlib.h | |
|
faxlib.h | |
Category: |
extended attribute | |
Mode: |
synchronous | |
|
||
The ATFX_SPEED( ) function returns the fax transfer speed (in baud) of the last transmitted page. This information is available after Phase B is completed. For transfers that do not renegotiate Phase B, issuing ATFX_SPEED( ) at the completion of a fax session returns the transfer baud rate for the entire session.
Parameter |
Description |
|
dev |
Specifies the channel device handle for the fax channel obtained when the channel was opened. |
The data provided by this function is updated each time the fax transfer completes Phase B of the T.30 protocol. After a fax session terminates, the value from the last fax transfer is available until the start of a new fax session.
For example, ATFX_SPEED( ) returns the equate DF_14400BAUD to indicate 14.4 Kbps transfer speed.
To monitor the transfer speed for each completed Phase B negotiation, you must enable Phase B events (DF_PHASEB in the fx_rcvfax( ), fx_rcvfax2( ) or fx_sendfax( ) function) and issue ATFX_SPEED( ) when the Phase B event (TFX_PHASEB) occurs.
If the application has enabled the generation of Phase B events, you can determine the baud rate set for the transmission by calling the ATFX_SPEED( ) function in the handler routine for the Phase B event.
#include <stdio.h>
#include <windows.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <faxlib.h>
DF_IOTT iott[10];
int dev;
/* Handler for Phase B events. */
int phb_hdlr( );
main( )
{
/*
* Open the channel using fx_open( ) and obtain the Dialogic
* FAX device handle in dev.
*/
.
.
/*
* Install handler to service TFX_PHASEB events.
*/
if (sr_enbhdlr(dev, TFX_PHASEB, phb_hdlr) == -1) {
printf("Failed to install Phase B handler \n");
return;
}
/*
* Call fx_sendfax( ) in asynchronous mode after setting
* up the DF_IOTT array. Set DF_PHASEB bit in mode field
* to enable generation of Phase B events.
*/
if (fx_sendfax(dev, iott, EV_ASYNC|DF_PHASEB) == -1) {
printf("Error - %s (error code %d)\n",
ATDV_ERRMSGP(dev),ATDV_LASTERR(dev));
if (ATDV_LASTERR(dev)==EDX_SYSTEM) {
/* Perform system error processing */
}
}
.
.
}
/*
* Handler registered with SRL to handle TFX_PHASEB events.
*/
int phb_hdlr( )
{
int dev = sr_getevtdev( );
/* Remote data rate capability. */
printf("Data rate for fax transmission: %ld\n",
ATFX_SPEED(dev));
.
.
return(0);
}
If one of the following conditions is present, this function fails and returns AT_FAILURE:
Click here to contact Dialogic Customer Engineering
Copyright 2002, Intel Corporation