
Description | Cautions | Example | Errors | See Also
Name: |
int scx_setevtmsk(devh, mask) | |
Inputs: |
int devh |
|
unsigned short mask |
| |
Returns: |
0 on success | |
Includes: |
scxlib.h | |
Category: |
Configuration | |
Mode: |
synchronous | |
The scx_setevtmsk( ) function enables alarm events specified in the event mask. Calling this function may cause an immediate event reflecting the current state of the SCX160 SCxbus Adapter if that state is part of the message mask being enabled.
Parameter |
Description |
devh: |
Specifies the SCX160 SCxbus Adapter device handle. |
mask: |
Specifies the event mask. Possible event masks may be any combination of the following event mask equates:
|
The event code returned by the sr_getevttype( ) function is TSCX_ALARM. The data field returned by the sr_getevtdatap( ) function contains the event detected and is two bytes long. The first byte represents one of the following bitmask values:
Equate |
Description |
SCXEV_SCBUS_CLOCK |
SCbus clock event |
SCXEV_SCXBUS_CLOCK |
SCxbus clock event |
SCXEV_EXT_CLOCK |
External clock event |
SCXEV_SCBUS_DRIVER |
SCbus driver event |
SCXEV_SCXBUS_DRIVER |
SCxbus driver event |
SCXEV_FIFO |
SCX160 FIFO event |
The second byte provides additional details about the event reported by the first byte as follows. If any clock event is returned, then the second byte represents one of the following:
Equate |
Description |
SCXST_SCX_RCLOCK |
SCxbus Right Clock failed/recovered |
SCXST_SCX_LCLOCK |
SCxbus Left Clock failed/recovered |
SCXST_SC_CLOCK |
SCbus Clock failed/recovered |
SCXST_SC_CLOCK_FAIL_SIG |
SCbus Clock Fail Signal failed/recovered |
SCXST_EXTCLOCK |
SCX160 External Clock failed/recovered |
SCXST_PLL_REF |
SCX160 PLL Reference failed/recovered |
SCXST_INTCLOCK |
SCX160 Internal Clock failed/recovered |
SCXST_CLK_RECOVER |
Recovery of Clock |
If any driver event is returned, then the second byte represents one of the following:
Equate |
Description |
SCXBE_SC_BER |
SCbus BER Threshold Exceeded |
SCXBE_SCX_BER |
SCxbus BER Threshold Exceeded |
When a FIFO event is returned, then the second byte represents one of the following:
Equate |
Description |
SCXFS_SC_POS_SLIP |
SCbus FIFO Positive Slip Threshold Exceeded |
SCXFS_SC_NEG_SLIP |
SCbus FIFO Negative Slip Threshold Exceeded |
SCXFS_SCX_POS_SLIP |
SCxbus FIFO Positive Slip Threshold Exceeded |
SCXFS_SCX_NEG_SLIP |
SCxbus FIFO Negative Slip Threshold Exceeded |
SCXFS_SC_SKEW |
SCbus FIFO Skew Threshold Exceeded |
SCXFS_SCX_SKEW |
SCxbus FIFO Skew Threshold Exceeded |
See Section 9.2. Handling Events for an example of handling unsolicited events.
This function enables notification only for the events specified. If notification for other events was enabled or disabled previously, the status of the notification will not change.
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 <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);
}
/*
* Enable the reporting of all clocking alarms on the SC bus
* and on the SCX bus
*/
event_mask = (SCXMM_SCX_CLOCK | SCXMM_SC_CLOCK | SCXMM_EXT_CLOCK);
if (scx_setevtmsk(devh, event_mask) == -1) {
printf("ERROR: scx_setevtmsk( ) failed, %s \n", ATDV_ERRMSGP(devh));
exit(1);
}
/* 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