PREV TOC HOME INDEX NEXT


gc_SndFrame( )


Termination Events | Cautions | Errors | Example | See Also

Name: int gc_SndFrame(linedev, l2_blkp)
Inputs:

LINEDEV linedev

  • line device handle for the D channel
 

GC_L2_BLK *l2_blkp

  • pointer to location where transmit frame is stored
Returns:

0 if successful

<0 if failure

Includes:

gclib.h

gcerr.h

Category:

interface specific (deprecated)

Mode:

synchronous

Platform and Technology:

Springware: ISDN

DM3: ISDN

See the Global Call Technology User's Guides for additional information.

Description

Note: The gc_SndFrame( ) function is deprecated in this software release. The suggested equivalent is gc_Extension( ).

The gc_SndFrame( ) function sends a Layer 2 frame to the ISDN data link layer. When the data link layer (Layer 2 access) is successfully established, a GCEV_D_CHAN_STATUS event is sent to the application. If the data link layer is not established before the function is called, the function fails.

Note: To enable Layer 2 access, set parameter number 24 to 01 in the firmware parameter file. When Layer 2 access is enabled, only the gc_GetFrame( ) and gc_SndFrame( ) functions can be used (no calls can be made).

Parameter

Description

linedev Global Call line device handle for the D channel board
l2_blkp points to the memory location of the buffer containing the requested transmit frame. The transmit frame uses the GC_L2_BLK data structure. See GC_L2_BLK for further information.

Termination Events

None

Cautions

The ISDN data link layer must be successfully established before the function is called or the function will fail. To establish the data link layer (Layer 2 access), set parameter 24 to 01 in the firmware parameter file.

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>
#include <gcisdn.h> 
METAEVENT metaevent;  
int send_frame(GC_L2_BLK *sndfrmptr) 
{
    LINEDEV  ldev;               /* Line device */
    int      state;
    GC_INFO  gc_error_info;      /* GlobalCall error information data */
    char     devname[] = ":N_dtiB1:P_isdn";  
    /*
     * Do the following:
     *    1. Open the D channel
     *    2. Send the frame
     */ 
    if(gc_OpenEx(&ldev, devname, EV_SYNC, &ldev) < 0) {
        /* 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 (-1);
    } 
    if(gc_GetLineDevState(&ldev, GCGLS_DCHANNEL, &state) < 0) {
        /* Process the error as decided earlier */
    }
    return 0;
} 
/* Retrieve events from SRL */
int evt_hdlr()
{
    LINEDEV        ldev;           /* Line device */
    GC_L2_BLK      sndfrm;         /* Buffer to store frame to send */
    GC_L2_BLK      *sndfrmptr      /* Pointer to frame to send */
    GC_L2_BLK      recvfrmptr;     /* Buffer to store received frame */
    int            retcode;        /* Return value */ 
    retcode = gc_GetMetaEvent(&metaevent);
    if (retcode <0 ) {
        /* get and process the error */
    }
        /* Continue with normal processing */ 
    ldev = metaevent.evtdev; 
    switch(metaevent.evttype) { 
    case GCEV_L2FRAME:
        /* retrieve signaling information from queue */
        if ( gc_GetFrame(ldev, &recvfrmptr) != GC_SUCCESS) {
            /* Process the error as decided earlier */
        }
        else {
            /* succeeded, process signaling information */
        }
        break; 
    case GCEV_D_CHAN_STATUS:
        /* Send the message */
        /* Fill up the sndfrm according to call control technology being used */
        sndfrmprt = &sndfrm;
        if(gc_SndFrame(ldev, sndfrmptr) != GC_SUCCESS) {
            /* Process the error as decided earlier */
        }
        else {
            /* succeeded, process signaling information */
        }
    }
    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