
Description | Cautions | Example | Errors | See Also
Name: |
dt_setevtmsk(devh,event,bitmask,action) | |
Inputs: |
int devh |
|
int event |
| |
unsigned short bitmask |
| |
int action |
| |
Returns: |
0 on success | |
Includes: |
srllib.h | |
Category: |
Parameter Setting | |
Mode: |
synchronous | |
The dt_setevtmsk( ) function enables and disables notification for events that occur on a Digital Network Interface logical board or time slot device. This function allows the application to set and alter a bitmask of transition events. The bitmask determines which transitions will cause an event to be generated.
The event can be retrieved by using the event management functions included in the Standard Runtime Library (refer to Appendix A - Standard Runtime Library for more information on the SRL). The current bitmask can be examined by using the dt_getevtmsk( ) function.
Parameter |
Description |
devh: |
Specifies the valid Digital Network Interface logical board or Digital Network Interface logical time slot device handle returned by a call to dt_open( ). |
event: |
Specifies the type of event to be enabled or disabled on the device specified by devh: |
| |
| |
| |
| |
NOTE: For D/xxxSC products, you must enable both the ON and OFF transitions on a specified bit to get events on that bit. For example, AON and AOFF must be enabled to detect events on the A bit. | |
bitmask: |
Specifies the event to be enabled or disabled by setting the bitmask for that event. |
Multiple transition events may be enabled or disabled with one function call if the bitmask values are logically ORed together. | |
The bitmask values for each event parameter are described in Table 5, found in the dt_getevtmsk( ) function description. | |
action: |
Specifies how the signaling bit transition event mask is changed. Events can be added to or subtracted from those specified in bitmask, or events can replace the existing ones. The possible values for the action parameter are: |
| |
| |
|
For example, to enable event notification:
This enables notification of the events specified in the bitmask parameter and disables notification of previously set events.
To enable an additional event:
This adds the notification of events specified in bitmask without disabling the currently enabled events.
To disable events, use the following procedure:
This disables the event in bitmask without disabling any other events.
To disable all currently enabled events:
Event Notification and Handling
To trap and handle a specified Digital Network Interface event, follow these steps in the order listed:
Refer to Appendix A - Standard Runtime Library for more information on SRL data structures and functions.
#include <windows.h> /* For Windows applications only */
#include <srllib.h>
#include <dtilib.h>
#include <errno.h>
main()
{
int devh; /* Time slot device handle */
/*
* Open board 1 time slot 1 device
*/
if ( ( devh = dt_open( "dtiB1T1", 0 ) ) == -1 ) {
printf( "Cannot open device dtiB1T1. errno = %d", errno );
exit( 1 );
}
/*
* Enable an event handler to catch AON and AOFF events
*/
.
.
.
/*
* Enable AON and AOFF signaling transition events
*/
if ( dt_setevtmsk(devh, DTG_SIGEVT, DTMM_AON | DTMM_AOFF, DTA_SETMSK )
ts== -1 ) {
printf( "Error message = %s.",ATDV_ERRMSGP( devh ) );
exit( 1 );
}
.
.
.
}
If the function returns -1, use the SRL Standard Attribute function ATDV_LASTERR( ) to obtain the error code or use ATDV_ERRMSGP( ) to obtain a descriptive error message. See Appendix A - Standard Runtime Library for more information on SRL functions. The error codes returned by ATDV_LASTERR( ) are:
Error defines can be found in the file dtilib.h.
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation