
Description | Cautions | Example | Errors | See Also
Name: |
int cc_SetDLinkState(bdev, dlinkptr, state_buf) | |
Inputs: |
LINEDEV bdev |
|
DLINK *dlinkptr |
| |
int *state_buf |
| |
Returns: |
0 on success | |
Includes: |
cclib.h | |
Category: |
System tools | |
Mode: |
synchronous | |
Technology: |
BRI/SC; PRI (all protocols) | |
The cc_SetDLinkState( ) function asks the firmware to set the logical data link state to support specific events in the application.
Upon successful completion of the cc_SetDLinkState( ) function, the request to change the state of the logical link is accepted by the firmware. Subsequently, when the logical data link state changes, the unsolicited event CCEV_D_CHAN_STATUS will be received, indicating that the state has changed.
Parameter |
Description |
bdev: |
Board device handle for PRI, station device handle for BRI. |
dlinkptr: |
Pointer to the data link information block. See Section 6.4. DLINK for a description of the elements of this data structure. |
state_buf: |
Pointer to the buffer containing the requested data link state value. Possible data link states are:
|
#include <windows.h> /* For Windows applications only */
#include <stdio.h>
#include <errno.h>
#include "srllib.h"
#include "dtilib.h"
#include "cclib.h"
/* Global variables */
LINEDEV ldev;
main()
{
DLINK dlink;
int state;
.
.
.
/* Establish the data link on SAPI 0, CES 1 */
dlink.sapi = 0;
dlink.ces = 0;
state = DATA_LINK_UP;
if(cc_SetDLinkState(ldev, &dlink, &state) < 0) {
printf("error");
} else {
.
.
.
}
}
If the function returns < 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_SetDLinkState( ) function include the following:
Error Code |
Description |
E_BADDEV | ERR_ISDN_LIB |
Bad Device Descriptor |
E_INVNDIINTERFACE | ERR_ISDN_LIB |
Invalid NDI Interface |
E_INVNRB | ERR_ISDN_LIB |
Invalid NRB |
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation