(Page 4 of 4 in this chapter)
Note: swiGetLocalStreamInfo, swiGetLocalTimeslotInfo, swiConfigLocalStream, and swiConfigLocalTimeslot take board- specific arguments. Refer to the board-specific documentation for the arguments to pass to these functions.
{
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;
}
}
{
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 4 of 4 in this chapter)