Switching Service Developer's Reference Manual (6421-10): Alphabetical Function Reference
(Page 22 of 28 in this chapter)
swiMakeConnection
Description
- Connects inputs to outputs.
Prototype
- DWORD swiMakeConnection ( SWIHD swihd,
SWI_TERMINUS input[],
SWI_TERMINUS output[],
unsigned count)
- swihd Handle returned by swiOpenSwitch.
- input Array of terminus structures for the input side of the connection. The terminus structure is:
typedef struct
{
DWORD bus;
DWORD stream;
DWORD timeslot;
} SWI_TERMINUS;
- See the Details section for a description of these fields.
- output Array of terminus structures for the output side of the connection.
- count Number of elements in the input array and in the output array.
Return Values
Events
Details
- This function makes connections between the corresponding elements of the output terminus array and the input terminus array.
- If multiple connections are made (that is, count is greater than 1), the relative throughput delay of the connections may not all be the same. Use swiMakeFramedConnection if you need identical throughput delays.
- The SWI_TERMINUS structure contains the following fields:
- In MVIP-90 mode, the bus field is ignored and the stream and timeslot fields are interpreted as MVIP-90 streams and timeslots.
Note: It is important to disable an output when the connection or pattern is no longer required. Leftover connections or patterns can cause unpredictable behavior in the application.
- Refer to Section 4.2, Making Connections for more information.
- If CTAERR_DRIVER_ERROR is returned, call swiGetLastError to retrieve the MVIP device error code.
See Also
- swiDisableOutput, swiGetLastError, swiGetOutputState, swiGetSwitchCaps, swiMakeFramedConnection, swiResetSwitch, swiSampleInput, swiSendPattern
Example
Note: Refer to Section 2.2.3, MVIP-95 Switch Block Model for information about stream numbering when making duplex connections or QUAD connections.
#define SIMPLEX 0
#define DUPLEX 1
void myMakeConnection(SWIHD hd, SWI_TERMINUS input, SWI_TERMINUS output,
unsigned count, DWORD mode)
{
unsigned i;
DWORD duplex = 0;
SWI_TERMINUS *outputs, *inputs;
if (mode == DUPLEX)
duplex = 1;
inputs = (SWI_TERMINUS *)malloc(sizeof(SWI_TERMINUS)*count);
outputs = (SWI_TERMINUS *)malloc(sizeof(SWI_TERMINUS)*count);
for (i = 0; i < count; i++)
{
inputs[i].bus = input.bus;
inputs[i].stream = input.stream;
inputs[i].timeslot = input.timeslot + i;
outputs[i].bus = output.bus;
outputs[i].stream = output.stream;
outputs[i].timeslot = output.timeslot + i;
}
swiMakeConnection(hd, inputs, outputs, count);
if( duplex )
{
for (i = 0; i < count; i++)
{
inputs[i].stream = inputs[i].stream + 1;
outputs[i].stream = outputs[i].stream - 1;
}
swiMakeConnection(hd, outputs, inputs, count);
}
}
(Page 22 of 28 in this chapter)
tech_support@nmss.com
Copyright © 1997, Natural MicroSystems, Inc. All rights
reserved.