(Page 7 of 7 in this chapter)


4.6 Querying Switch Capabilities

If you want to query the device driver and return information about the capabilities of the device driver and the switch block, use swiGetSwitchCaps. The following example code queries the capabilities of the device driver and the switch controlled by it.

void myPrintSwitchCaps(SWIHD hd)
{
SWI_SWITCHCAPS_ARGS cp;
SWI_LOCALDEV_DESC *localdevs;
swiGetSwitchCaps(hd, &cp, NULL, 0);
localdevs = (SWI_LOCALDEV_DESC *)malloc(
sizeof(SWI_LOCALDEV_DESC)*cp.numlocalstreams);

swiGetSwitchCaps(hd, &cp, localdevs, cp.numlocalstreams);

printf("Driver Software Std. %s Rev. %2.f\n",
((cp.swstandard == MVIP95_STANDARD_MVIP95)? "MVIP-95" :
"MVIP-90"),
(float)cp.swstdrevision/100.0);

printf("Hardware Std. %s Rev. %2.f.\n",
((cp.hwstandard == MVIP95_STANDARD_HMVIP)? "HMVIP" :
"MVIP-90"),
(float)cp.hwstdrevision/100.0);
printf("Driver Rev. %.2f\n", (float)cp.dvrrevision/100.0);
printf(" Domain %04X, Routing %04X, Blocking %04X.\n",
cp.domain, cp.routing, cp.blocking );

if( cp.numlocalstreams > 0 )
{
DWORD i;

printf("Supports %d local streams:\n\t",
cp.numlocalstreams );
for( i=0; i<cp.numlocalstreams; i++ )
printf( "%2d ", i+16 );
printf("with\n\t");
for( i=0; i<cp.numlocalstreams; i++ )
printf( "%2d ", localdevs[i].timeslots );
printf("timeslots respectively.\n");
}
free(localdevs);
}



(Page 7 of 7 in this chapter)


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