PREV TOC HOME INDEX NEXT


gc_GetCTInfo( )


Termination Events | Cautions | Errors | Example | See Also

Name: int gc_GetCTInfo(linedev, ct_devinfop)
Inputs:

LINEDEV linedev

  • Global Call line device
 

CT_DEVINFO *ct_devinfop

  • pointer to device information structure
Returns:

0 if successful

<0 if failure

Includes:

gclib.h

gcerr.h

Category:

system controls and tools

Mode:

synchronous

Platform and Technology:

Springware: T-1/E-1 (PDKRT only)

DM3: T-1/E-1, ISDN, Analog

IP (embedded stack)

Description

The gc_GetCTInfo( ) function retrieves CT Bus time slot information. The information includes the device family, device mode, type of network interface, bus architecture, PCM encoding, etc. The information is returned in the CT_DEVINFO structure. The valid values for each member of the CT_DEVINFO structure are defined in gclib.h.

Parameter

Description

linedev Global Call device handle
ct_devinfop points to the CT_DEVINFO device information structure. See CT_DEVINFO for more information.

Termination Events

None

Cautions

None

Errors

If this function returns <0 to indicate failure, use the gc_ErrorInfo( ) function to retrieve the reason for the error. See the "Error Handling" section in the Global Call API Programming Guide. All Global Call error codes are defined in the gcerr.h file. If the error returned is technology specific, see the technology-specific error header file(s) for the error definition (for example, ccerr.h or isdnerr.h file for the ISDN call control library).

Example

#include <stdio.h>
#include <srllib.h>
#include <gclib.h>
#include <gcerr.h> 
#define MAX_CHAN 30              /* max. number of channels in system */ 
/*
* Data structure which stores all information for each line
*/ 
static struct linebag {
      LINEDEV    ldev;      /* GlobalCall API line device handle */
      CRN        crn;       /* GlobalCall API call handle */
      int        blocked;   /* channel blocked/unblocked */
      int        networkh;  /* network handle */
} port[MAX_CHAN+1];
struct linebag *pline;          /* pointer to access line device */ 
/*
 * Assume the following has been done:
 *    1. Opened line devices for each time slot on DTIB1.
 *    2. Each line device and voice handle is stored in linebag structure "port"
 */ 
int call_getctinfo(int port_num, CT_DEVINFO *infop)
{
   GC_INFO        gc_error_info;   /* GlobalCall error information data */ 
   /* Find info for this time slot, specified by 'port_num' */
   /* (assumes port_num is valid) */ 
   pline = port + port_num; 
   /* Get information about the device and store it in the location pointed
      to by infop */ 
   if (gc_GetCTInfo(pline->ldev, infop) == -1)
   {
      /* process error return as shown */
      gc_ErrorInfo( &gc_error_info );
      printf ("Error: gc_GetCTInfo() on linedev: 0x%lx, GC ErrorValue: 0x%hx - %s, 
               CCLibID: %i - %s, CC ErrorValue: 0x%lx - %s\n",
               pline->ldev, gc_error_info.gcValue, gc_error_info.gcMsg, 
               gc_error_info.ccLibId, gc_error_info.ccLibName,
               gc_error_info.ccValue, gc_error_info.ccMsg);
      return (gc_error_info.gcValue); 
   } 
   return (0);
} 

See Also


PREV TOC HOME INDEX NEXT

Click here to contact Telecom Support Resources

Copyright 2003, Intel Corporation
All rights reserved
This page generated February, 2003