(Page 9 of 11 in this chapter)


4.8 Board and Driver Configuration

The CT Access Switching service provides functions for board and driver specific configuring and querying. These functions are for special device and board specific needs.

If you want to...

Then use this function...

Configure stream specific characteristics of a local device

swiConfigLocalStream

Configure stream and timeslot specific characteristics of a local device

swiConfigLocalTimeslot

Obtain vendor specific information about the board to the caller

swiGetBoardInfo

Retrieve general and vendor specific information about the device driver

swiGetDriverInfo

Retrieve stream specific characteristics of a local device

swiGetLocalStreamInfo

Retrieve stream and timeslot specific characteristics of a local device

swiGetLocalTimeslotInfo


Note:  swiGetLocalStreamInfo, swiGetLocalTimeslotInfo, swiConfigLocalStream, and swiConfigLocalTimeslot take board specific arguments. Refer to the board specific documentation for the arguments to pass to these functions.
The MVIP-90 specification provides carrier functions as extensions to the device driver specification.

The following code is an example of how swiGetLocalStreamInfo, swiConfigLocalStream, and swiConfigLocalTimeslot may be used to access these carrier functions.

void myConfigE1Carrier(SWIHD age1hd)
{
SWI_LOCALSTREAM_ARGS args;
struct carrier_parms cp;

args.localstream = 0;
args.deviceid = MVIP95_E1_TRUNK_DEVICE;
args.parameterid = CONFIG_CARRIER;

cp.size = sizeof(struct carrier_parms);
cp.trunk = 0;
cp.frame = DT_CEPT;
cp.code = DT_HDB3;
cp.debounce = 1;

swiConfigLocalStream(age1hd, &args, &cp, cp.size);
}

void myConfigChannels(SWIHD age1hd)
{
SWI_LOCALTIMESLOT_ARGS args;
struct channel_parms cp;
DWORD i;

args.localstream = 0;
args.deviceid = MVIP95_T1_TRUNK_DEVICE;
args.parameterid = CONFIG_CHANNEL;

cp.size = sizeof(struct channel_parms);
cp.invert = 0;
cp.loopback = 0;
cp.robbedbit = 1;

for (i = 0; i < 24; i++)
{
args.localtimeslot = i;
cp.trunk = i;

swiConfigLocalTimeslot(age1hd, &args, &cp, cp.size);
}
}

void PrintCarrierStatus(SWIHD agt1hd)
{
SWI_LOCALSTREAM_ARGS args;
struct carrier_status cs;

args.localstream = 0;
args.deviceid = MVIP95_T1_TRUNK_DEVICE;
args.parameterid = CARRIER_STATUS;

cs.trunk = 0;
swiGetLocalStreamInfo(agt1hd, &args, &cs, sizeof(cs));
printf("Event count: %d\n", cs.event_count);
printf("Device: %d\n", cs.device);
if (cs.red_alarm)
printf("** RED ALARM **\n");
if (cs.yellow_alarm)
printf("** YELLOW ALARM **\n");
if (cs.blue_alarm)
printf("** BLUE ALARM **\n");
switch (cs.sync)
{
case 0:
printf("Synchronized\n");
break;
case 1:
printf("Blue Alarm\n");
break;
case 2:
printf("Not Synchronized\n");
break;
case 3:
printf("Super frame not synchronized\n");
break;
}
}

Another example is the NMS switching drivers which provide a command to query the analog line interfaces on an AG-8 board. swiGetLocalTimeslotInfo can be used to query the hybrid identifiers on the board.

void myGetHybridIds(SWIHD agcxhd, DWORD ids[], unsigned count)
{
SWI_LOCALTIMESLOT_ARGS args;
unsigned i;

args.localstream = 0;
args.deviceid = MVIP95_ANALOG_LINE_DEVICE;
args.parameterid = HYBRID_ID;

for (i = 0; i < count; i++)
{
args.localtimeslot = i;
swiGetLocalTimeslotInfo(agcxhd, &args, &ids[i],
sizeof(ids[i]));
}
}



(Page 9 of 11 in this chapter)


Tech_Support@nmss.com
Copyright © 1996, Natural MicroSystems, Inc. All rights reserved.