(Page 3 of 28 in this chapter)


swiCallDriver

Description

Makes a direct call to the MVIP device driver.

Prototype

DWORD swiCallDriver ( SWIHD swihd,
DWORD command,
DWORD *args,
DWORD size,
DWORD *errorcode)

swihd Handle returned by swiOpenSwitch.

command MVIP driver command to call.

args Pointer to the arguments to the driver call.

size Size, in bytes, of the arguments to the driver call.

errorcode Pointer to the device driver return code.

Return Values

Events

Details

This function is an escape mechanism that provides the application with a way to make a direct call to the underlying MVIP device driver. The error codes returned by the device driver are returned to the application in the errorcode argument.

This function does not do any error checking on the parameters or on the MVIP command code. Elements affected by this function will not be restored even if the SWI_ENABLE_RESTORE flag was set in 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.

Refer to Section 7.3, Calling the MVIP Device Driver for more information.

For more information about the MVIP driver command, refer to the MVIP-95 Device Driver Standard Manual or the MVIP-90 Standard Manual (for MVIP-90 commands).

See Also

swiOpenSwitch

Example


/* Supervision Monitoring using MVIP-90 Driver Extensions */
int 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 = SWI_A_BIT_OFF;

/* Assert hangup from our side */
supvparms.output_pattern = SWI_A_BIT_OFF + SWI_B_BIT_OFF;
supvparms.qualify_time = 100;

/* Use MVIP-90 supervision monitoring command */
swiCallDriver(hd, START_SUPV, (void *)&supvparms,
sizeof(supvparms), &errorcode);
if (errorcode != SUCCESS)
{
fprintf(stderr, "** MVIP driver error code: %d\n", errorcode);
return -1;
}

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);
if (errorcode != SUCCESS)
{
fprintf(stderr, "** MVIP driver error code: %d\n", errorcode);
return -1;
}
return 0;
}


(Page 3 of 28 in this chapter)


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