(Page 24 of 28 in this chapter)


swiOpenSwitch

Description

Opens a switching device and returns a switch handle.

Prototype

DWORD swiOpenSwitch ( CTAHD ctahd,
char *devname,
unsigned swno,
unsigned flags,
SWIHD *swihd)

ctahd Handle returned by ctaCreateContext.

devname Pointer to the base name of the switching device, e.g., "AGSW".

swno Switch number relative to the switch type.

flags Flags for the open call. Refer to the Details section.

swihd Pointer to the returned switch handle.

Return Values

Events

Details

This function opens a switching device and returns a handle to the switch block for use in subsequent switching calls.

swno is the board number of the board within a specific switching device type.

For example, you have a system with two AG-T1 boards and one
S-Connect board. The AG-T1 boards use the devname of "AGSW". The
S-Connect board uses the devname of "AGCXSW". The swno passed to the swiOpenSwitch calls for the AG-T1 boards will be 0 and 1. The swno passed to the swiOpenSwitch call for the S-connect board will be 0.

The switch can be opened in MVIP-90 mode by setting the SWI_MVIP90 bit in the flags argument. The default mode is MVIP-95. In MVIP-95 mode, the underlying driver may be either an MVIP-95 driver or an MVIP-90 driver. The CT Access Switching service translates arguments as necessary.

You may not use an MVIP-95 driver in MVIP-90 mode.

Since MVIP-95 device drivers can only be opened in MVIP-95 mode, it is recommended that all applications that may use MVIP-95 device drivers in the future be written to use MVIP-95 mode, even if the application is not currently using MVIP-95 device drivers.

In MVIP-90 mode, the bus field is ignored and the stream and timeslot fields are interpreted as MVIP-90 streams and timeslots.

The SWI_ENABLE_RESTORE bit is used to save the state of the switch block outputs so that the state of the switch block outputs can be restored when it is closed using swiCloseSwitch.

Acceptable values for flags are:

Refer to Section 3.2, Opening a Switch Handle for more information.

If CTAERR_DRIVER_ERROR is returned, call swiGetLastError to retrieve the MVIP device error code.

See Also

swiCloseSwitch, swiGetLastError

Example


void myApplicationInit(CTAHD ctahd, SWIHD hd[], int count)
{
int i;

for (i = 0; i < count; i++)
{
swiOpenSwitch(ctahd, "agsw", i, SWI_ENABLE_RESTORE, &hd[i]);
}

}


(Page 24 of 28 in this chapter)


tech_support@nmss.com
Copyright © 1997, Natural MicroSystems, Inc. All rights reserved.