(Page 19 of 28 in this chapter)


swiGetOutputState

Description

Retrieves the state of the specified switch block outputs.

Prototype

DWORD swiGetOutputState ( SWIHD swihd,
SWI_TERMINUS output[],
unsigned mode[],
BYTE pattern[],
SWI_TERMINUS input[],
unsigned count)

swihd Handle returned by swiOpenSwitch.

output Array of terminus structures for which to retrieve the state. The terminus structure is:

typedef struct
{
DWORD bus;
DWORD stream;
DWORD timeslot;
} SWI_TERMINUS;

See swiMakeConnection for a description of these fields.

mode Array that receives the state of the switch block outputs.

Possible mode values are:

MVIP95_DISABLE_MODE
MVIP95_PATTERN_MODE
MVIP95_CONNECT_MODE
MVIP95_FRAMED_CONNECT_MODE

pattern Array that receives the datum values asserted at the switch block outputs if the corresponding mode is MVIP95_PATTERN_MODE.

input Array that receives the switch block inputs connected to the switch block outputs if mode is MVIP95_CONNECT_MODE or MVIP95_FRAMED_CONNECT_MODE.

count Number of elements in the output, mode, pattern, and input arrays.

Return Values

Events

Details

This function retrieves the state of specified switch block outputs.

If the mode of the output is MVIP95_DISABLE_MODE, the switch block outputs on the MVIP bus are in their high impedance state. If a switch block output is on a local bus, the timeslots on the local bus are put into a known state. (The driver vendor must publish these states in customer documentation.)

A mode of MVIP95_PATTERN_MODE implies that a fixed pattern is being asserted on the switch block output.

A mode of MVIP95_CONNECT_MODE or MVIP95_FRAMED_CONNECT_MODE implies that there is a connection from the input terminus to the output terminus.

In MVIP-90 mode, the bus field is ignored and the stream and timeslot fields are interpreted as MVIP-90 streams and timeslots.

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

See Also

swiDisableOutput, swiGetLastError, swiMakeConnection, swiMakeFramedConnection, swiResetSwitch, swiSendPattern

Example


void myPrintOutputState(SWIHD hd, SWI_TERMINUS output)
{
unsigned mode;
BYTE pattern;
SWI_TERMINUS input;

swiGetOutputState(hd, &output, &mode, &pattern, &input, 1);

switch (output.bus)
{
case MVIP95_MVIP_BUS:
printf("STo(%s", "mvip");
break;
case MVIP95_LOCAL_BUS:
("STo(%s", "local");
break;
case MVIP95_MC1_BUS:
printf("STo(%s", "mc1");
break;
}
printf(":%2d:%02d) ", output.stream, output.timeslot);

switch( mode )
{
case MVIP95_CONNECT_MODE:
case MVIP95_FRAMED_CONNECT_MODE:
switch (input.bus)
{
case MVIP95_MVIP_BUS:
printf(" %s", " mvip");
break;
case MVIP95_LOCAL_BUS:
printf(" %s", "local");
break;
case MVIP95_MC1_BUS:
printf(" %s", " mc1");
break;
}
printf(":%2d:%02d", input.stream, input.timeslot);
break;

case MVIP95_PATTERN_MODE:
printf(" m_%02X", pattern );
break;

case MVIP95_DISABLE_MODE:
printf(" t_%02X", 0 );
break;

default:
printf(" %02X_%02X", 0, 0);
break;
}
printf("\n");
}


(Page 19 of 28 in this chapter)


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