
Description | Cautions | Example | Errors | See Also
Name: |
int scx_close(devh) | |
Inputs: |
int devh |
|
Returns: |
0 on success | |
Includes: |
scxlib.h | |
Category: |
Configuration | |
Mode: |
synchronous | |
The scx_close( ) function closes a previously opened SCX160 device. This function releases the device handle and breaks the link between the calling process and the device.
Parameter |
Description |
devh: |
SCX160 SCxbus Adapter device handle |
This function will fail if an invalid device handle is specified. Never close a Dialogic device using the Windows close( ) function.
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <srllib.h>
#include <scxlib.h>
int devh; /* SCX160 device handle */
unsigned short event_mask; /* Event Mask */
/* Open SCX160 board */
if ((devh = scx_open("scxB1", 0)) == -1) {
printf("Cannot open board scxB1. errno = %d \n ", errno);
exit(1);
}
/*
* Disable the reporting of all clocking alarms on the SCbus
* and on the SCxbus.
*/
event_mask = (SCXEV_SCXBUS_CLOCK_FAIL | SCXEV_SCXBUS_CLOCK_FAIL |
SCXEV_EXT_CLOCK_FAIL);
if (scx_clrevtmsk(devh, event_mask) == -1) {
printf("ERROR: scx_clrevtmsk( ) failed, %s \n", ATDV_ERRMSGP(devh));
exit(1);
}
/* Close the SCX160 Board */
if (scx_close(devh) == -1) {
printf ("Cannot close SCX160 Board Device. errno=%d \n", errno);
exit(1);
}
If the function returns -1, the specific error that occurred is returned in the errno global variable.
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation