(Page 17 of 28 in this chapter)


swiGetLocalStreamInfo

Description

Retrieves stream-specific characteristics of a local device.

Prototype

DWORD swiGetLocalStreamInfo (SWIHD swihd,
SWI_LOCALSTREAM_ARGS *args,
void *buffer,
unsigned size)

swihd Handle returned by swiOpenSwitch.

args Pointer to a SWI_LOCALSTREAM_ARGS structure where the configuration information about a device on a specific stream on the local bus will be retrieved. The SWI_LOCALSTREAM_ARGS structure is:

typedef struct
{
DWORD localstream;
DWORD deviceid;
DWORD parameterid;
} SWI_LOCALSTREAM_ARGS;

See the Details section for a description of these fields.

buffer Pointer to a buffer to receive stream specific information maintained by the device driver.

size Size of the buffer in bytes.

Return Values

Events

Details

This function retrieves stream-specific characteristics of a local device. The configuration information returned is vendor-specific and device-specific.

For example, use this function to retrieve a digital carrier's alarm status and statistics (MVIP-90 CARRIER_STATUS command).

The SWI_LOCALSTREAM_ARGS structure contains the following fields:

Field

Description

localstream

Stream to be queried on the local bus.

deviceid

Device type on the local stream. The deviceid is hardware dependent. Acceptable values for deviceid are:

MVIP95_T1_TRUNK_DEVICE
MVIP95_E1_TRUNK_DEVICE
MVIP95_ANALOG_LINE_DEVICE
MVIP95_CONFERENCE_DEVICE

In addition to these values, the device vendor may define device identifiers specific to their products. Refer to the device-specific documentation for these values.

parameterid

The data item for which configuration is to be obtained. This value is vendor-specific and device driver-specific. The combination of the deviceid and the parameterid specify the part of the device to configure.

Refer to Section 6.3, Board and Driver Configuration for more information.

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

See Also

swiConfigLocalStream, swiConfigLocalTimeslot, swiGetBoardInfo, swiGetDriverInfo, swiGetLastError, swiGetLocalTimeslotInfo, swiGetSwitchCaps

Example


void myPrintCarrierStatus(SWIHD agt1hd)
{
SWI_LOCALSTREAM_ARGS args;
struct carrier_status cs;

args.localstream = 0;
args.deviceid = MVIP95_T1_TRUNK_DEVICE;
args.parameterid = CARRIER_STATUS;

cs.trunk = 0;
swiGetLocalStreamInfo(agt1hd, &args, &cs, sizeof(cs));
printf("Event count: %d\n", cs.event_count);
printf("Device: %d\n", cs.device);
if (cs.red_alarm)
printf("** RED ALARM **\n");
if (cs.yellow_alarm)
printf("** YELLOW ALARM **\n");
if (cs.blue_alarm)
printf("** BLUE ALARM **\n");
switch (cs.sync)
{
case 0:
printf("Synchronized\n");
break;
case 1:
printf("Blue Alarm\n");
break;
case 2:
printf("Not Synchronized\n");
break;
case 3:
printf("Super frame not synchronized\n");
break;
}
}


(Page 17 of 28 in this chapter)


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