Previous PageTable Of Contents../index.htmlIndexNext Page

dt_getevt( )

Description | Cautions | Example | Errors | See Also

Name:

int dt_getevt(devh,eblkp,timeout) (Windows only)

Inputs:

int devh

  D/240SC-T1 or D/300SC-E1 Digital network interface device time slot handle

 

EV_EBLK *eblkp

  pointer to Event Block Structure

 

int timeout

  timeout value in seconds

Returns:

0 on success
-1 on failure

Includes:

srllib.h
dtilib.h

Category:

Parameter Request

Mode:

Synchronous

Top Of PageDescription

This dt_getevt( ) function blocks and returns control to the program after one of the events set by dt_setevtmsk( ) occurs on the channel specified in the devh parameter, or a timeout occurs. dt_getevt( ) is used with multi-threaded applications only.

Parameter

Description

devh:

Specifies the valid digital network interface time slot device handle returned by a call to dt_open( )

*eblkp:

Points to the Event Block Structure DX_EBLK, which will contain the event that ended the blocking

timeout:

Specifies the maximum amount of time in seconds to wait for an event to occur. timeout can have one of the following values:

  # of seconds: maximum length of time to wait for an event. - when time has elapsed, the function will terminate and return an error

  -1: block until an event occurs - the function will not timeout

  0: returns -1 immediately if no event is present

NOTE:
When the time specified expires, dt_getevt( ) will terminate and return an error. The Standard Attribute function ATDV_LASTERR( ) can be used to determine the cause of the error, which in this case is EDX_TIMEOUT.

On successful return from the function the event block structure will have the following information.

eblk.ev_dev:

Device on which the event occurred - this will be the same as the devh parameter passed in.

eblk.ev_event:

DTEV_SIG indicates signaling transition event.
DTEV_T1ERRC indicates alarm.

eblk.ev_data[ ]:

DTEV_SIG contains information about the signaling event. ev_data[ ] is an array of bytes where ev_data[0] and ev_data[1] contain the signaling information. Retrieve the signaling information in a short variable and see the example below to get the signaling information from ev_data[0] and ev_data[1]. DTEV_T1ERRC contains information about the type of alarm occurring.

The event block structure is defined as follows:

Top Of PageCautions

dt_getevt( ) is only used for multithreaded applications.

Top Of PageExample

Top Of PageErrors

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. The error codes returned by ATDV_LASTERR( ) are:

Equate

Returned When

EDT_BADPARM

Invalid parameter

EDT_SYSTEM

Windows system error

EDT_TMOERR

Timed out waiting for reply from firmware

Top Of PageSee Also


Previous PageTable Of ContentsTop Of PageIndexNext Page

Click here to contact Dialogic Customer Engineering

Copyright 2001, Dialogic Corporation
All rights reserved
This page generated November, 2001