Table of Contents Index NMS Glossary Previous Page Next Page (Page 25 of 29 in this chapter) Version


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, for example, 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 CG 6000C boards and one CX 2000 board. The CG 6000C boards use the devname agsw. The CX 2000 board uses the devname cxsw.

The swno passed to swiOpenSwitch for the CG 6000C board and the CX 2000 board is the logical number assigned to the board.
Caution:

Since MVIP-95 device drivers can be opened only 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.

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]);
}

}


Table of Contents Index NMS Glossary Previous Page Next Page (Page 25 of 29 in this chapter) Version


Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2000, Natural MicroSystems, Inc. All rights reserved.