cc_GetDLinkState( ) retrieves the logical data link state
110
!
! !
!
Example
/* BRI code example */
#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 lbuf;
main ()
{
DLINK dlink;
char ces;
.
.
.
/* open BRI station device bris1 */
dlink.sapi = 0;
/* check state of each data link */
for(ces = 1; ces <= 8; ces++)
{
/* initialize connection endpoint suffix */
dlink.ces = ces;
/* get current data link state */
if ( cc_GetDLinkState(l_buf, &dlink, &state_buf) == 0)
{
/* if data link is up */
if (state_buf == DATA_LINK_UP)
printf("ces%02x) is up \n", ces);
/* if data link is not up */
else if (state_buf == DATA_LINK_DOWN)
printf("ces(%02x) is down\n", ces);
}
else
printf("error");
}
}
!
! !
!
Errors
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_GetDLinkState( ) function include the following: