
Description | Cautions | Example | Errors | See Also
Name: |
int dt_getctinfo(devh,ct_devinfop) | |
Inputs: |
int devh |
|
CT_DEVINFO *ct_devinfop |
| |
Returns: |
0 on success | |
Includes: |
srllib.h | |
Category: |
SCbus Routing | |
Mode: |
||
The dt_getctinfo( ) function returns information about the digital network interface device associated with the specified digital channel (time slot) (dtiBxTx) on a DTI or voice and network board.
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_prodid: field contains a valid product identification number for the device.
ct_devfamily: specifies the device family and contains
ct_devmode: not valid for T-1 or E-1 devices
ct_nettype: specifies the type of network interface for the device. The two valid values are:
ct_busmode: specifies the bus architecture used to communicate with other devices in the system. The two valid values are:
This function will fail if an invalid time slot device handle is specified.
#include <windows.h> /* For Windows applications only */
#include <srllib.h>
#include <dtilib.h>
#include <errno.h>
main( )
{
int devh; /* Digital network interface device handle */
CT_DEVINFO ct_devinfo; /* Device information structure */
/* Open board 1 time slot 1 on Digital network 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:
In the SCbus Routing Function Reference:
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation