Using the Switching service

Local device configuration on the AG 2000 board is controlled by the Switching service. The Switching service provides functions for accessing device configuration parameters defined by the underlying hardware and device driver.

swiConfigLocalTimeslot and swiGetLocalTimeslotInfo allow applications 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. The prototypes for these functions are repeated here for convenience.

For more information about the Switching service, refer to the Switching Service Developer's Reference Manual.

Function information

The syntax of swiConfigLocalTimeslot and swiConfigLocalTimeslotInfo is:

Prototype

DWORD swiConfigLocalTimeslot ( SWIHD swihd, SWI_LOCALTIMESLOT_ARGS *args, void *buffer, unsigned size )

DWORD swiGetLocalTimeslotInfo ( SWIHD swihd, SWI_LOCALTIMESLOT_ARGS *args, void *buffer, unsigned size )

Argument

Description

swihd

Switch handle returned by swiOpenSwitch.

args

Pointer to a SWI_LOCALTIMESLOT_ARGS structure. This structure indicates the specific parameter to be configured on the device indicated by localstream and localtimeslot.

typedef struct
{
     DWORD localstream;     
     DWORD localtimeslot;
     DWORD deviceid;
     DWORD parameterid;
} SWI_LOCALTIMESLOT_ARGS;

buffer

Pointer to a structure that is specific to the parameterid.

size

Size of buffer, in bytes.


Return values

SUCCESS, or an error code from ctaerr.h or swidef.h.

Details

Applications using swiConfigLocalTimeslot and swiGetLocalTimeslotInfo must open the Switching service. Refer to the Natural Access Developer's Reference Manual for more information about opening services.