gc_RespService( )
Termination Events | Cautions | Errors | Example | See Also
Description
The gc_RespService( ) function generates a response to a requested service. Notification of a request is indicated by the reception of a GCEV_SERVICEREQ event. The extevtdatap field of the event contains a pointer to a GC_PARM_BLK that contains an unsigned long value that is the Service ID associated with the event.
For more information about the gc_RespService( ) function, see the discussion of the Global Call Service Request (GCSR) feature in the Global Call API Programming Guide.
Termination Events
- GCEV_SERVICERESPCMPLT
- indicates that a response has been successfully generated
- GCEV_TASKFAIL
- indicates that the function failed
- Note: The extevtdatap field of these events contains a pointer to a GC_PARM_BLK that contains an unsigned long value that is the Service ID associated with the event. This pointer is only valid until the next gc_GetMetaEvent( ) or gc_GetMetaEventEx( ) is called. See the appropriate Global Call Technology User's Guide for technology-specific information.
Cautions
- Only synchronous mode is supported for the following target objects: GCTGT_GCLIB_SYSTEM, GCTGT_CCLIB_SYSTEM, GCTGT_PROTOCOL_SYSTEM, and GCTGT_FIRMWARE_NETIF. Otherwise, the function will return the async mode error.
- When using the gc_RespService( ) function, PARM_SERVICEID is a mandatory parameter of the GC_PARM_BLK pointed to by the datap function parameter.
Errors
If this function returns <0 to indicate failure, use the gc_ErrorInfo( ) function for error information. If the GCEV_TASKFAIL event is received, use the gc_ResultInfo( ) function to retrieve information about the event. 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 "gclib.h" void main( ) { LINEDEV devh; unsigned long serviceID; GC_PARM_BLKP datap = NULL; GC_INFO gc_error_info; /* GlobalCall error information data */ /* Following code assumes that: * 1. gc_OpenEx has been done with handle = devh * 2. a GCEV_SERVREQ event has been received and processed, with serviceID * set to the appropriate value * / /* Set up GC_PARM_BLK for reply */ if ( gc_util_insert_parm_ref( &datap, GCSET_SERVREQ, PARM_SERVICEID, sizeof( unsigned long ), &serviceID ) != GC_SUCCESS ) { /* Process error */ } if ( gc_util_insert_parm_val( &datap, GCSET_SERVREQ, PARM_REQTYPE, sizeof( int ), 0 ) != GC_SUCCESS ) { /* Process error */ } if ( gc_util_insert_parm_val( &datap, GCSET_SERVREQ, PARM_ACK, sizeof( short ), GC_ACK ) != GC_SUCCESS ) { /* Process error */ } /* Insert any other technology-dependent parameters */ if ( gc_RespService( GCTGT_GCLIB_CHAN, devh, datap, EV_SYNC ) != GC_SUCCESS ) { /* Process error */ /* Process error */ gc_ErrorInfo( &gc_error_info ); printf ("Error: gc_RespService() on device handle: 0x%lx, GC ErrorValue: 0x%hx - %s, CCLibID: %i - %s, CC ErrorValue: 0x%lx - %s\n", devh, gc_error_info.gcValue, gc_error_info.gcMsg, gc_error_info.ccLibId, gc_error_info.ccLibName, gc_error_info.ccValue, gc_error_info.ccMsg); } /* Delete GC_PARM_BLK */ gc_util_delete_parm_blk( datap ); }See Also
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation