PREV TOC HOME INDEX NEXT


1.7.10. Set the Logical Data Link State

The GCIS_EXID_SETDLINKSTATE extension ID asks the firmware to set the logical data link state to support specific events in your application.

Upon its successful completion, the request to change the state of the logical link is accepted by the firmware. Subsequently, when the logical data link state changes, you will receive the unsolicited event GCEV_D_CHAN_STATUS, indicating that the state has changed.

The following table provides the parameter inputs for the gc_Extension( ) function.

Parameter Input
target_type GCTGT_GCLIB_CHAN
target_id line device handle (linedev) of the board device
ext_id GCIS_EXID_SETDLINKSTATE
parmblkp the pstruct member of parmblkp should point to the DLINK (Data Link Information Block) data structure followed by int. See Section4.5, DLINK, for a definition of the DLINK structure; see the example code for details.

set_id - GCIS_SET_DLINK

parm_id - GCIS_PARM_DLINK_CES

values -

    • 0 for PRI
    • 1-8 for BRI when used as a network-side terminal.

value_type - char


parm_id - GCIS_PARM_DLINK_SAPI

values -

    • 0 for BRI and PRI
    • 16 for X.25 packets over D-channel

value_type - char

 

parm_id - GCIS_PARM_DLINK_STATE

values -

    • DATA_LINK_DOWN
    • DATA_LINK_UP
    • DATA_LINK_DISABLED

 

value_type - int

mode EV_ASYNC, EV_SYNC

Note: There needs to be a sufficient amount of time between bringing down the data link layer and bringing it up. This is necessary to allow time for the network side to release its resources and declare the data link down before the network side tries to reestablish the connection.

Although GCIS_EXID_SetDLinkState can be used for PRI, it is somewhat limited in scope. In PRI, after Layer 2 is brought down (DATA_LINK_DOWN state), the firmware will try to reestablish the link after the timer expires.

Example
 int extSetDLinkState (LINEDEV handle)
 {
    GC_PARM_BLKP parm_blkp = NULL, ret_blkp = NULL;
    unsigned long mode;
    int ret_val = 0;
    GC_INFO  t_Info;
    char sapi, ces;
    int state;
     sapi = 0;
    gc_util_insert_parm_ref( &parm_blkp, GCIS_SET_DLINK, GCIS_PARM_DLINK_SAPI,
                             sizeof( char ), &sapi);
    ces = 1;
    gc_util_insert_parm_ref( &parm_blkp, GCIS_SET_DLINK, GCIS_PARM_DLINK_CES,
                             sizeof( char ), &ces);
    state = DATA_LINK_UP;
    gc_util_insert_parm_ref( &parm_blkp, GCIS_SET_DLINK, 
                            GCIS_PARM_DLINK_STATE, sizeof( int ), &state);
     mode = EV_SYNC;
     ret_val = gc_Extension(GCTGT_GCLIB_CHAN, handle,
                   GCIS_EXID_SETDLINKSTATE, parm_blkp, &ret_blkp, mode);
    if ( ret_val )
    {
           ret_val = gc_ErrorInfo(&t_Info);
           if (ret_val == GC_SUCCESS) {
                    printf("gc_ErrorInfo() successfully called\n");
                    PrintGC_INFO(&t_Info);
           } else {
                    printf("gc_ErrorInfo() call failed\n");
           }
    } 
    	  	 gc_util_delete_parm_blk( ret_blkp );
    gc_util_delete_parm_blk( parm_blkp );
    return ret_val;
}

PREV TOC HOME INDEX NEXT

Click here to contact Dialogic Customer Engineering

Copyright 2001, Dialogic Corporation
All rights reserved
This page generated October, 2001