
Description | Cautions | Example | Errors | See Also
Name: |
int scx_getevtmsk (devh, bitmask) | |
Inputs: |
int devh |
|
unsigned short *bitmask |
| |
Returns: |
0 on success | |
Includes: |
scxlib.h | |
Category: |
Configuration | |
Mode: |
synchronous | |
The scx_getevtmsk( ) function retrieves alarm event mask. This function identifies the events enabled for a specified station.
Parameter |
Description |
devh: |
SCX160 SCxbus Adapter device handle |
bitmask: |
Specifies the pointer to the buffer where the bitmask will be returned. The bitmask retrieved as a result of this call may be any combination of the following event mask equates:
|
When an SCX160 SCxbus Adapter alarm event is generated, the event code returned by the sr_getevttype( ) function is TSCX_ALARM. The data field returned by the sr_getevtdatap( ) function contains the specific alarm information 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 either 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 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);
}
/* Get the SCX160 Event Mask */
if (scx_getevtmsk(devh, &event_mask) == -1) {
printf("ERROR: scx_getevtmsk( ) failed, %s \n", ATDV_ERRMSGP(devh));
exit(1);
}
/* Print out the SCX160 Event Mask */
printf("SCxbus Clock Fail Alarm Reporting is %s \n",
(event_mask & SCXMM_SCX_CLOCK) ? "ENABLED" : "DISABLED");
printf("SCbus Clock Fail Alarm Reporting is %s \n",
(event_mask & SCXMM_SC_CLOCK) ? "ENABLED" : "DISABLED");
printf("External Clock Fail Alarm Reporting is %s \n",
(event_mask & SCXMM_EXT_CLOCK) ? "ENABLED" : "DISABLED");
printf("SCX160 Fifo Alarm is Reporting %s \n",
(event_mask & SCXMM_FIFO) ? "ENABLED" : "DISABLED");
printf("SCX160 SCbus Driver Fail Alarm Reporting is %s \n",
(event_mask & SCXMM_SC_DRIVER) ? "ENABLED" : "DISABLED");
printf("SCX160 SCxbus Driver Fail Alarm Reporting is %s \n",
(event_mask & SCXMM_SCX_DRIVER) ? "ENABLED" : "DISABLED");
/* 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