
Description | Cautions | Example | Errors | See Also
Name: |
int cc_GetFrame(linedev, rcvfrmptr) | |
Inputs: |
LINEDEV linedev |
|
L2_BLK *rcvfrmptr |
| |
Returns: |
0 on success | |
Includes: |
cclib.h | |
Category: |
Data link layer handling | |
Mode: |
synchronous | |
Technology: |
BRI/SC; PRI (excluding DPNSS) | |
The cc_GetFrame( ) function retrieves the frame received by the application. This function is used after a CCEV_L2FRAME event is received. Each CCEV_L2FRAME event is associated with one frame. This function is used for the data link layer only.
To enable Layer 2 access, set parameter number 24 to 01 in the firmware parameter file. When Layer 2 access is enabled, only the cc_GetFrame( ) and cc_SndFrame( ) functions can be used ( no calls can be made).
Parameter |
Description |
linedev: |
The line device handle for the D channel. |
rcvfrmptr: |
The pointer to the buffer where the received frame is to be stored. The L2_BLK data structure contains the retrieved frame. See Section 6.7. L2_BLK for a description of the data structure. See the Example code for details. |
#include <windows.h> /* For Windows applications only */
#include <stdio.h>
#include <errno.h>
#include "srllib.h"
#include "dtilib.h"
#include "cclib.h"
/* Global variables */
int size = 8;
LINEDEV lbuf;
L2_BLK; rcvfrmptr;
typedef long int (*EVTHDLRTYP)( );
.
.
.
int evt_hdlr( )
{
int rc = 0;
int ldev = sr_getevtdev( );
unsigned long *ev_datap = (unsigned long *)sr_getevtdatap( );
int len = sr_getevtlen( );
switch(sr_getevttype( ))
{
.
.
.
case CCEV_L2FRAME: /* New frame received */
if (rc = cc_GetFrame(ldev, &rcvfrmptr) != 0)
{
/* Process error condition */
}
else
/* Process the frame and call control function */
.
.
.
break;
.
.
}
}
If the function returns a value < 0 to indicate failure, use the cc_CauseValue( ) function to retrieve the reason code for the failure. The cc_ResultMsg( ) function can be used to interpret the reason code. Error codes are defined in the files ccerr.h, isdnerr.h, and isdncmd.h.
Error codes from the cc_GetFrame( ) function include the following:
Error Code |
Description |
ERR_ISDN_LIB | E_ISNOINFO |
Information not available |
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation