
Description | Cautions | Example | Errors | See Also
Name: |
int scx_open(name, oflags) | |
Inputs: |
char *name |
|
short oflags |
| |
Returns: |
device handle on success | |
Includes: |
scxlib.h | |
Category: |
Configuration | |
Mode: |
synchronous | |
The scx_open( ) function opens an SCX160 device and returns a unique Dialogic handle to identify the device. All subsequent references to the opened device must use the returned device handle.
Opening an SCX160 SCxbus Adapter does not alter the state of the device. A device may only be opened once and cannot be re-opened by the current process or any other process until the device is closed. A command is only accepted while a device is idle.
Parameter |
Description |
name: |
Points to an ASCIIZ string that contains the name (scxB1) of the SCX160 SCxbus Adapter. |
oflags: |
Reserved for future use: set to 0. |
This function will fail if an invalid device handle is specified or if the device is already open.
Never open a Dialogic device using the Windows open( ) 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 */
scx_close(devh);
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