PREV TOC HOME INDEX NEXT


ec_stopch( )


Cautions | Example | Errors | See Also

Name: int ec_stopch(chDev, StopType, mode)
Inputs: int chDev
  • valid channel device handle

unsigned long StopType
  • type of channel stop

unsigned short mode
  • mode flags
Returns: 0 for success -1 for failure
Includes: srllib.h dxxxlib.h eclib.h
Category: I/O
Mode: synchronous/asynchronous

Description

The ec_stopch( ) function forces termination of currently active I/O functions on a CSP-capable full-duplex channel.

This function can terminate CSP or voice library I/O functions.

The StopType value determines whether the play, receive or both sides of the channel are terminated. In contrast, the dx_stopch( ) function only terminates the prompt play side.

Parameter
Description
chDev The channel device handle obtained when the CSP-capable device is opened using dx_open( ).
StopType The type of stop channel to perform:
  • SENDING - stops the prompt play side
  • RECEIVING - stops the receive side
  • FULLDUPLEX - stops both play/receive sides
mode Specifies the mode:
  • EV_SYNC - synchronous mode
  • EV_ASYNC - asynchronous mode

Cautions

Example

#include <windows.h>  /* include in Windows applications only; exclude in Linux */ 
#include <stdio.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <eclib.h>
#include <errno.h> /* include in Linux applications only; exclude in Windows */ 
main()
{
   int chdev, srlmode; 
  /* Set SRL to run in polled mode. */
   srlmode = SR_POLLMODE;
   if (sr_setparm(SRL_DEVICE, SR_MODEID, (void *)&srlmode) == -1) {
      /* process error */
   } 
  /* Open the channel using dx_open( ). Get channel device descriptor in
    * chdev.
    */
   if ((chdev = dx_open("dxxxB1C1",0)) == -1) {
      /* process error */
   } 
  /* continue processing */
               .
               . 
  /* Force the channel idle.  The I/O function that the channel is
    * executing will be terminated, and control passed to the handler
    * function previously enabled, using sr_enbhdlr(), for the
    * termination event corresponding to that I/O function.
    * In the asynchronous mode, ec_stopch() returns immediately,
    * without waiting for the channel to go idle.
    */
   if (ec_stopch(chdev, FULLDUPLEX, EV_ASYNC) == -1) {
      /* process error */
   }
} 

Errors

If the function returns -1, use ATDV_LASTERR( ) to return the error code and ATDV_ERRMSGP( ) to return a descriptive error message.

One of the following error codes may be returned:

Error code
Reason
EDX_BADDEV Device handle is NULL or invalid.
EDX_BADPARM Stop Type or mode is invalid.
EDX_SYSTEM Operating system error
EEC_UNSUPPORTED Device handle is valid but device does not support CSP.

See Also


PREV TOC HOME INDEX NEXT

Click here to contact Dialogic Customer Engineering

Copyright 2001, Intel Corporation
All rights reserved
This page generated December, 2001