
Description | Cautions | Example | Errors
Name: |
int scx_getctinfo(devh, ct_devinfop) | |
Inputs: |
int devh |
|
CT_DEVINFO |
| |
*ct_devinfop |
||
Returns: |
0 on success | |
Includes: |
dxxxlib.h | |
Category: |
Attribute | |
Mode: |
synchronous | |
The scx_getctinfo( ) function gets Adapter device information.
Parameter |
Description |
devh: |
Specifies the SCX160 SCxbus Adapter device handle. |
ct_devinfop: |
Specifies a pointer to the CT_DEVINFO structure that will contain the SCX160 SCxbus Adapter device information. |
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]; /* reserved for future use */
} CT_DEVINFO;
Valid values for each of the members of the CT_DEVINFO structure are defined in the dxxxlib.h and scxlib.h header files.
The ct_prodid field contains a valid Dialogic product identification number for the device:
The ct_devfamily specifies the device family and contains the following:
The ct_devmode field does not apply. The ct_nettype field specifies the network interface used by the SCX160 SCxbus Adapter. The only valid value is:
The ct_busmode specifies the bus architecture used to communicate with other devices in the system:
The ct_busencoding field is not valid for SCX160 SCxbus Adapters.
This function will fail if an invalid device handle is specified.
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <scxlib.h>
int devh; /* SCX160 device handle */
CT_DEVINFO ct_devinfo; /* Device information structure */
/* Open SCX160 board */
if ((devh = scx_open("scxB1", 0)) == -1) {
printf("Cannot open scxB1. errno = %d \n", errno);
exit(1);
}
/* Get Device Information */
if (scx_getctinfo(devh, &ct_devinfo) == -1) {
printf("ERROR: scx_getctinfo( ) failed, %s\n", ATDV_ERRMSGP(devh));
exit(1);
}
printf("%s Device Information:\n", ATDV_NAMEP(devh));
printf("Product ID = 0x%lX, Device Family = %d\n",
ct_devinfo.ct_prodid, ct_devinfo.ct_devfamily);
printf("Network Mode = %d, Bus Mode = %d\n",
ct_devinfo.ct_nettype, ct_devinfo.ct_busmode);
/* Close the SCX160 Board */
scx_close(devh);
If the function returns -1, use the SRL Standard Attribute function ATDV_LASTERR( ) to obtain the error code, or you can use the ATDV_ERRMSGP( ) function to obtain a descriptive error message. The error codes returned by ATDV_LASTERR( ) function are listed in Chapter 7. Errors.
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation