
Description | Cautions | Example | Errors
Name: |
int d42_chnstatus(devh, statusp, bufferp) | |
Inputs: |
int devh |
|
char *statusp |
| |
char *bufferp |
| |
Returns: |
ED42_NOERROR |
|
Includes: |
D42LIB.H | |
Mode: |
synchronous | |
Supports: |
D/42-SL, D/42-SX, D/42-NS, D/42-NE2 | |
The d42_chnstatus( ) function retrieves the current D/42-xx channel status and places it in an application buffer. The application buffer (statusp) that will contain the channel status information must be 1 byte. The channel status is a single bit (bit 0) representing the status of the channel device.
Parameter |
Description |
devh: |
specifies the valid channel device descriptor obtained by a call to dx_open( ) |
statusp: |
pointer to a 1-byte application buffer. The application buffer will contain a non-zero value if channel is communicating with the switch. non-zero = OK 0 = no communications |
bufferp: |
pointer to an additional 48-byte plus 1 NULL byte application buffer (reserved for future use) |
The character pointer bufferp is required. The associated buffer must be 49 bytes.
void main(void)
{
int devh;
int rc = 0;
char bufferp[49];
char status;
/* Open Channel Device */
if ( (devh = dx_open("dxxxB1C1",NULL))==-1)
{
printf("Error dx_open( )\n");
exit(-1);
} /* End dx_open */
/* Get the channel status Information */
if ( (rc = d42_chnstatus(devh, &status, bufferp)) == -1)
{
printf("Error d42_chnstatus( ):\n");
dx_close(devh);
exit(-1);
} /* End d42_brdstatus*/
if (status)
{
printf("Channel Communication OK\n");
}
else
{
printf("No Channel Communication\n");
}
dx_close(devh);
} /* End main */
If this function returns -1 to indicate a failure, use ATDV_LASTERR( ) and ATDV_ERRMSGP( ) to retrieve one of the following (most common) errors. For a complete list of error codes and definitions, refer to Appendix C.
ED42_FWREQFAILURE |
Firmware error |
ED42_UNKNOWNBOARD |
Unknown D/42 board type |
ED42_BADDEVICE |
Invalid or wrong device handle |
ED42_INVALARG |
Invalid argument passed to function |
DXLIB_INVNRB |
Internal voice library error |
Click here to contact Dialogic Customer Engineering
Copyright 2000, Dialogic Corporation