gc_StartTrace( )
Termination Events | Cautions | Errors | Example | See Also
Description
The gc_StartTrace( ) function starts the logging of debug information for a specified line device. The trace continues until a gc_StopTrace( ) function is issued. Complete information about the trace is not available until the gc_StopTrace( ) function is executed.
For information about using the gc_StartTrace( ) function with a specific technology, see the appropriate Global Call Technology User's Guide.
linedev Global Call line device handle tracefilename points to file name for the trace Termination Events
Cautions
If this function is invoked for an unsupported technology, the function will fail. The error value EGC_UNSUPPORTED will be the Global Call value returned when the gc_ErrorInfo( ) function is used to retrieve the error code.
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> LINEDEV bdev; /* board level device number */ int parm_id; /* parameter id */ int rc; /* Return code */ int value; /* value to be for specified parameter */ char *filename; /* file name for the trace */ char devname[] = ":N_dtiB1:P_ISDN"; GC_INFO gc_error_info; /* GlobalCall error information data */ main() { if(gc_OpenEx(&bdev, devname, EV_SYNC, &ldev) != GC_SUCCESS) { /* Process the error as decided earlier */ gc_ErrorInfo( &gc_error_info ); printf ("Error: gc_OpenEx() on devname: %s, GC ErrorValue: 0x%hx - %s, CCLibID: %i - %s, CC ErrorValue: 0x%lx - %s\n", devname, 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); } /* Only one D channel can be traced at any given time */ . . . filename="/tmp/trace.log"; rc = gc_StartTrace(bdev, filename); if (rc != GC_SUCCESS) { printf("Error in gc_StartTrace, rc = %x\n", rc); } else { /* continue */ } . . . }See Also
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation