PREV TOC HOME INDEX NEXT


ec_getxmitslot( )


Cautions | Example | Errors | See Also

Name: int ec_getxmitslot(chDev, lpSlot)
Inputs: int chDev
  • valid channel device handle

SC_TSINFO *lpSlot
  • pointer to time slot information structure
Returns: 0 for success -1 for failure
Includes: srllib.h dxxxlib.h eclib.h
Category: routing
Mode: synchronous

Description

The ec_getxmitslot( ) function returns the echo-cancelled transmit time slot number of a CSP-capable full-duplex channel. It returns the number of the SCbus time slot which transmits the echo-cancelled data. This information is contained in an SC_TSINFO structure.

Note: On DM3 boards, the ec_getxmitslot( ) function is not supported.

The SC_TSINFO structure is declared as follows:

typedef struct {
        unsigned long  sc_numts;
        long           *sc_tsarrayp;
} SC_TSINFO; 

The sc_numts field must be initialized with the number of TDM bus time slots requested (1 for a voice channel). The sc_tsarrayp field must be initialized with a pointer to a valid array. Upon return from the function, the array contains the time slot on which the voice channel transmits.

A voice channel on an SCbus-based board can transmit on only one SCbus time slot.

For more information, see the SCbus Routing Function Reference.

Parameter
Description
chDev The channel device handle obtained when the CSP-capable device is opened using dx_open( ).
lpSlot A pointer to the SC_TSINFO data structure.

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;                  /* Channel device handle */
   SC_TSINFO sc_tsinfo;        /* Time slot information structure */
   long scts;                  /* SCbus time slot */
   int srlmode;                /* Standard Runtime Library mode */ 
  /* Set SRL to run in polled mode. */
   srlmode = SR_POLLMODE;
   if (sr_setparm(SRL_DEVICE, SR_MODEID, (void *)&srlmode) == -1) {
      /* process error */
   } 
  /* Open board 1 channel 1 device */
   if ((chdev = dx_open("dxxxB1C1", 0)) == -1) {
        printf("Cannot open channel dxxxB1C1. Check to see if board is started");
        exit(1);
   } 
  /* Fill in the SCbus time slot information */
   sc_tsinfo.sc_numts = 1;
   sc_tsinfo.sc_tsarrayp = &scts; 
  /* Get SCbus time slot connected to transmit of voice channel 1 on board 1 */
   if (ec_getxmitslot(chdev, &sc_tsinfo) == -1) {
       printf("Error message = %s", ATDV_ERRMSGP(chdev));
      exit(1);
   } 
  printf("%s is transmitting on SCbus time slot %ld", ATDV_NAMEP(chdev), scts);
} 

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 invalid or NULL.
EDX_BADPARM Time slot pointer information is NULL or invalid.
EDX_SH_BADCMD Command is not supported in current bus configuration.
EDX_SH_BADINDX Switch Handler index number is NULL.
EDX_SH_BADLCLTS Channel number is invalid.
EDX_SH_BADMODE Function is not supported in current bus configuration.
EDX_SH_BADTYPE Channel type is invalid.
EDX_SH_CMDBLOCK Blocking command is in progress.
EDX_SH_LCLDSCNCT Channel is already disconnected from SCbus.
EDX_SH_LIBBSY Switch Handler library is busy.
EDX_SH_LIBNOTINIT Switch Handler library is uninitialized.
EDX_SH_MISSING Switch Handler is not present.
EDX_SH_NOCLK Switch Handler clock fallback failed.
EDX_SYSTEM Operating system error occurred.
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