
Description | Cautions | Example | Errors | See Also
Name: |
int fx_getctinfo(chdev, ct_devinfop) | |
Inputs: |
int chdev |
|
CT_DEVINFO *ct_devinfop |
| |
Returns: |
0 on success | |
Includes: |
srllib.h | |
Category: |
SCbus routing | |
Mode: |
synchronous | |
The fx_getctinfo( ) function returns information about a fax channel device handle.
Parameter |
Description |
chdev: |
Specifies the valid fax channel device handle obtained when the channel was opened using fx_open( ). |
ct_devinfop: |
Specifies a pointer to the data structure CT_DEVINFO. |
On return from the function, the CT_DEVINFO structure contains the relevant information and is declared as follows:
typedef struct {
unsigned long ct_prodid;
unsigned char ct_devfamily;
unsigned char ct_devmode;
unsigned char ct_nettype;
unsigned char ct_busmode;
unsigned char ct_busencoding;
unsigned char ct_rfu[7];
} CT_DEVINFO;
Valid values for each member of the CT_DEVINFO structure are defined in dxxxlib.h. For more information on CT_DEVINFO specific to DM3 boards, see section 3.3. CT_DEVINFO: Channel/Timeslot Device Information Data Structure.
This function will fail if an invalid fax channel device handle is specified.
#include <windows.h> /* include in Windows applications only; exclude in Linux */
#include <srllib.h>
#include <dxxxlib.h>
#include <faxlib.h>
#include <errno.h> /* include in Linux applications only; exclude in Windows */
main( )
{
int chdev; /* Channel device handle */
CT_DEVINFO ct_devinfo; /* Device information structure */
/* Open board 1 channel 1 devices */
if ((chdev = fx_open("dxxxB1C1", 0)) == -1) {
printf("Cannot open channel\n");
/* Perform system error processing */
exit(1);
}
/* Get Device Information */
if (fx_getctinfo(chdev, &ct_devinfo) == -1) {
printf("Error message = %s", ATDV_ERRMSGP(chdev));
exit(1);
}
printf("%s Product Id = 0x%x, Family = %d, Mode = %d, Network = %d, "
" Bus mode = %d, Encoding = %d", ATDV_NAMEP(chdev), ct_devinfo.ct_prodid,
ct_devinfo.ct_devfamily, ct_devinfo.ct_devmode, ct_devinfo.ct_nettype,
ct_devinfo.ct_busmode, ct_devinfo.ct_busencoding);
}
If the function returns -1, use the SRL Standard Attribute function ATDV_LASTERR( ) to obtain the error code or use ATDV_ERRMSGP( ) to obtain a descriptive error message. One of the following error codes may be returned:
Equate |
Returned When |
EFX_BADPARM |
Invalid value for fax parameter (on DM3 boards only) |
EDX_BADPARM |
Invalid value for parameter (on SpringWare boards) |
EDX_SH_BADEXTTS |
SCbus time slot is not supported at current clock rate |
EDX_SH_BADINDX |
Invalid Switch Handler library index number |
EDX_SH_BADTYPE |
Invalid channel type (voice, analog, etc.) |
EDX_SH_CMDBLOCK |
Blocking command is in progress |
EDX_SH_LIBBSY |
Switch Handler library is busy |
EDX_SH_LIBNOTINIT |
Switch Handler library is uninitialized |
EDX_SH_MISSING |
Switch Handler is not present |
EDX_SH_NOCLK |
Switch Handler clock fallback failed |
EDX_SYSTEM |
Operating system error |
Click here to contact Dialogic Customer Engineering
Copyright 2002, Intel Corporation