# Using the Switching service

To use the Natural Access Switching service (SWI) with CX 2000 boards, applications must create a context and open the Switching service on that context. Since switching is a board-level function, applications typically open the Switching service on a non-DSP port, such as 0:0.

Refer to the Natural Access Developer's Reference Manual and the Switching Service Developer's Reference Manual for additional information and examples of opening services.

## Opening the switch

After opening the Switching service, applications can open the switch block on the board to obtain a switch handle for further Switching service calls. To open the switch block on a board, specify the switching driver name in the call to swiOpenSwitch. For CX 2000 boards, the driver name is cxsw. The following example shows how to use cxsw in an application:

//Open the switchblock for the board using the proper driver
dwRetValue = swiOpenSwitch(hContext,
"cxsw",
BoardNumber,
0x0,
&hSwitch);

## Configuring local devices

Local device configuration on CX 2000 boards is controlled by the Switching service. The Switching service provides generic API functions for accessing device configuration parameters defined by the underlying hardware and device driver.

Applications can use swiConfigLocalTimeslot and swiGetLocalTimeslotInfo to configure a device on a given local stream and timeslot by specifying a particular parameter and providing a data structure specific to that parameter. For more information about these functions, refer to the Switching Service Developer's Reference Manual.