Intel 05-1832-002 IP Phone User Manual


 
366 Voice API for Windows Operating Systems Library Reference — November 2003
dx_sendevt( ) — allow inter-process event communication
The application can define the evttype and evtdata to be any values as long as evttype is greater
than 0x1FFFFFF and less than 0x7FFFFFF0. The only exception to this rule is the use of this
function to stop dx_wtring( ) and dx_getevt( ) by sending TDX_CST events. To unblock a process
waiting in dx_wtring( ) or dx_getevt( ), send an event of type TDX_CST to that process. The
evtlen will be the size of the DX_CST structure and evtdatap will point to a DX_CST structure
with cst.cst_event set to DE_STOPRINGS or DE_STOPGETEVT as the case may be.
!
!!
! Cautions
This function will fail if an invalid device handle is specified.
No event will be generated if event type value is greater than 0x7FFFFFF0.
!
!!
! Errors
If the function returns -1, use the Standard Runtime Library (SRL) Standard Attribute function
ATDV_LASTERR( ) to obtain the error code or use ATDV_ERRMSGP( ) to obtain a descriptive
error message. One of the following error codes may be returned:
EDX_BADPARM
Invalid parameter
EDX_SYSTEM
Error from operating system; use dx_fileerrno( ) to obtain error value
!
!!
! Example
#include "srllib.h"
#include "dxxxlib.h"
main()
{
int dev; /* device handle */
DX_CST cst; /* TDX_CST event data block */
/* Open board 1 channel 1 device */
if ((dev = dx_open("dxxxB1C1", 0)) == -1) {
/* Perform system error processing */
exit(1);
}
/* Set up DX_CST structure */
cst.cst_event = DE_STOPGETEVT;
cst.cst_data = 0;
/* Send the event to all other processes that have dxxxB1C1 open */
if (
dx_sendevt(dev, TDX_CST, &cst, sizeof(DX_CST), EVFL_SENDOTHERS)
== -1) {
printf("Error message = %s", ATDV_ERRMSGP(dev));
exit(1);
}
}
!
!!
! See Also
dx_getevt( )
sr_enbhdlr( )
sr_waitevt( )