
Description | Cautions | Example | Errors | See also
Name: |
int dt_getctinfo(devh, ct_devinfop) | |
Inputs: |
int devh |
|
|
CT_DEVINFO *ct_devinfop |
|
Returns: |
0 on success |
|
|
-1 on error |
|
Includes: |
srllib.h |
|
|
dtilib.h | |
Mode: |
Synchronous | |
The dt_getctinfo( ) function gets SCbus digital interface information. This function returns information about the digital network interface device associated with the specified digital channel (time slot) (dtiBxTx) .
Parameter |
Description |
devh: |
Specifies the valid digital network interface time slot device handle returned by a call to dt_open( ). |
ct_devinfop: |
Specifies the 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 dtilib.h. Possible return values are:
CT_DFSPAN |
specifies a D/240SC-T1 or D/300SC-E1 digital interface device |
CT_NTT1 |
specifies a D/240SC-T1 T-1 digital channel |
CT_NTE1 |
specifies a D/300SC-E1 E-1 digital channel |
CT_BMPEB |
PEB (PCM Expansion Bus) architecture |
CT_BMSCBUS |
SCbus architecture |
CT_BEULAW |
Mu-law encoding |
CT_BEALAW |
A-law encoding |
This function will fail if an invalid time slot device handle is specified.
#include <srllib.h>
#include <dtilib.h>
#include <errno.h>
main( )
{
int devh; /* Digital interface device handle */
CT_DEVINFO ct_devinfo; /* Device information structure */
* Open board 1 time slot 1 on digital interface device */
if ((devh = dt_open("dtiB1T1", 0)) == -1) {
printf("Cannot open time slot dtiB1T1. errno = %d", errno);
exit(1);
}
/* Get Device Information */
if (dt_getctinfo(devh, &ct_devinfo) == -1) {
printf("Error message = %s", ATDV_ERRMSGP(devh));
exit(1);
}
printf("%s Product Id = 0x%x, Family = %d, Network = %d, Bus mode = %d,
Encoding = %d", ATDV_NAMEP(devh), ct_devinfo.ct_prodid,
ct_devinfo.ct_devfamily, 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. The error codes returned by ATDV_LASTERR( ) are:
Equate |
Returned When |
EDT_BADBRDERR |
Board missing or defective |
EDT_BADCMDERR |
Invalid command parameter to driver |
EDT_FWERR |
Firmware returned an error |
EDT_INVTS |
Invalid time slot device handle |
EDT_INVMSG |
Invalid message |
EDT_SH_BADLCLTS |
Invalid local time slot number |
EDT_SH_BADINDX |
Invalid Switch Handler library index number |
EDT_SH_BADTYPE |
Invalid local time slot type |
EDT_SH_LIBBSY |
Switch Handler library busy |
EDT_SH_LIBNOTINIT |
Switch Handler library is uninitialized |
EDT_SH_MISSING |
Switch Handler is not present |
EDT_SH_NOCLK |
Switch Handler clock fallback failed |
EDT_SYSTEM |
Linux system error |
EDT_TMOERR |
Timed out waiting for reply from firmware |
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation