swiGetLocalStreamInfo

Retrieves the stream-specific characteristics of a local device.

Prototype

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

Argument

Description

swihd

Switch handle.

args

Pointer to a SWI_LOCALSTREAM_ARGS structure for the configuration information about a device on a specific stream on the local bus:

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

Refer to 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

Return value

Description

SUCCESS

 

CTAERR_DRIVER_ERROR

Underlying driver retrieved an unrecognized error. Call swiGetLastError to retrieve the MVIP device error code.

CTAERR_FUNCTION_NOT_AVAIL

Underlying driver does not support the configuration of stream-specific characteristics of a local device.

CTAERR_INVALID_HANDLE

swihd is not a valid switch handle.

CTAERR_SVR_COMM

Communication error in the server environment.


Details

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

CG boards do not support swiGetLocalStreamInfo.

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 are:

MVIP95_T1_TRUNK_DEVICE

MVIP95_E1_TRUNK_DEVICE

MVIP95_ANALOG_LINE_DEVICE

MVIP95_CONFERENCE_DEVICE

 

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

parameterid

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 Configuring boards and drivers for more information.

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

See also

swiConfigLocalStream, swiConfigLocalTimeslot, swiGetBoardInfo, swiGetDriverInfo, swiGetLocalTimeslotInfo, swiGetSwitchCaps

Example

void myPrintCarrierStatus(SWIHD swihd)
{
    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(swihd, &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;
    }
}