(Page 11 of 11 in this chapter)
4.10 Utility Functions
- swiCallDriver provides an escape mechanism for making a direct driver call to the device controlled by the switch block handle opened via swiOpenSwitch.
Note: All commands to the drivers are synchronous, that is, they do not return until the driver has completed the command. Some functions take a long time to return. When this happens, all other activity on the CTA context is blocked until the function returns. It is advisable to create a new thread, a new CTA context, and a new switch handle if a blocking function is to be used on a switch handle.
- For example, the MVIP-90 specification provides supervision monitoring functions as extensions to the device driver specification. swiCallDriver may be used to access these supervision monitoring functions.
/* Supervision Monitoring using MVIP-90 Driver Extensions */
void MonitorSupervision(SWIHD hd)
{
struct start_supv_parms supvparms;
struct wait_supv_parms waitparms;
LONG SupvId;
DWORD errorcode;
/* Enable supervision on signalling stream 17, timeslot 0 (MVIP-90) */
supvparms.stream = 17;
supvparms.slot = 0;
/* Wait for hangup */
supvparms.target_pattern = A_BIT_OFF;
/* Assert hangup from our side */
supvparms.output_pattern = A_BIT_OFF + B_BIT_OFF;
supvparms.qualify_time = 100;
/* Use MVIP-90 supervision monitoring command */
swiCallDriver(hd, START_SUPV, (void *)&supvparms,
sizeof(supvparms), &errorcode);
SupvId = supvparms.handle_ret;
/* Wait until target condition is detected, no time limit on wait */
waitparms.handle = SupvId;
waitparms.timeout = -1L;
/* Use MVIP-90 supervision monitoring command */
swiCallDriver(hd, WAIT_SUPV, (void *)&waitparms,
sizeof(waitparms), &errorcode);
}
- The drpinsrt demonstration program shows how swiCallDriver can be used to access supervision monitoring functions. Refer to Section 13.2.2, Drop and Insert Program: drpinsrt.
- The swish utility is a tool for interactive or text file driven control of MVIP switches. Refer to Section 13.3.5, Control MVIP Switches: swish for more information.
(Page 11 of 11 in this chapter)
Tech_Support@nmss.com
Copyright © 1996, Natural MicroSystems, Inc. All rights
reserved.