(Page 1 of 1 in this chapter) Version
swiConfigLocalTimeslot ( SWIHD swihd, *args, *buffer, size )
swiGetLocalTimeslotInfo ( SWIHD swihd, *args, *buffer, size )
typedef struct
{
DWORD localstream;
DWORD localtimeslot;
DWORD deviceid;
DWORD parameterid;
} SWI_LOCALTIMESLOT_ARGS;
typedef struct
{
INT32 gain;
} NMS_LINE_GAIN_PARMS;
#include "swidef.h" /* CT Access Switching service */ #include "mvip95.h" /* MVIP-95 definitions */ #include "nmshw.h" /* NMS hardware-specific definitions */ DWORD myGetReceiveGain ( SWIHD swihd, SWI_TERMINUS terminus, INT32*
gain_dB ) { SWI_LOCALTIMESLOT_ARGS args; NMS_LINE_GAIN_PARMS device ; DWORD rc ; args.localstream = terminus.stream ; args.localtimeslot = terminus.timeslot ; args.deviceid = MVIP95_ANALOG_LINE_DEVICE ; args.parameterid = MVIP95_INPUT_GAIN ; rc = swiGetLocalTimeslotInfo( /* CT Access switch handle */ swihd, /* target device and config item */ & args, /* buffer (defined by parameterid) */(void*) & device, /* buffer size in bytes */ sizeof(device)); *gain_dB = device.gain / 1000 ; return rc ; }
#include "swidef.h" /* CT Access Switching service */ #include "mvip95.h" /* MVIP-95 definitions */ #include "nmshw.h" /* NMS hardware-specific definitions */ DWORD myGetTransmitGain ( SWIHD swihd, SWI_TERMINUS terminus,
INT32* gain_dB ) { SWI_LOCALTIMESLOT_ARGS args; NMS_LINE_GAIN_PARMS device ; DWORD rc ; args.localstream = terminus.stream ; args.localtimeslot = terminus.timeslot ; args.deviceid = MVIP95_ANALOG_LINE_DEVICE ; args.parameterid = MVIP95_OUTPUT_GAIN ; rc = swiGetLocalTimeslotInfo( /* CT Access switch handle */ swihd, /* target device and config item */ & args, /* buffer (defined by parameterid) */(void*) & device, /* buffer size in bytes */ sizeof(device)); *gain_dB = device.gain / 1000 ; return rc ; }
typedef struct
{
INT32 gain;
} NMS_LINE_GAIN_PARMS;
#include "swidef.h" /* CT Access Switching service */
#include "mvip95.h" /* MVIP-95 definitions */
#include "nmshw.h" /* NMS hardware-specific definitions */
*/
DWORD mySetReceiveGain ( SWIHD swihd, SWI_TERMINUS terminus, INT32 gain_dB )
{
SWI_LOCALTIMESLOT_ARGS args;
NMS_LINE_GAIN_PARMS device ;
args.localstream = terminus.stream ;
args.localtimeslot = terminus.timeslot ;
args.deviceid = MVIP95_ANALOG_LINE_DEVICE ;
args.parameterid = MVIP95_INPUT_GAIN ;
device.gain = gain_dB * 1000 ;
return swiConfigLocalTimeslot (
/* CT Access switch handle */ swihd,
/* target device and config item */ & args,
/* buffer (defined by parameterid) */ (void*) &
device,
/* buffer size in bytes */
sizeof(device));
}
#include "swidef.h" /* CT Access Switching service */
#include "mvip95.h" /* MVIP-95 definitions */
#include "nmshw.h" /* NMS hardware-specific definitions */
*/
DWORD mySetTransmitGain ( SWIHD swihd, SWI_TERMINUS terminus, INT32 gain_dB )
{
SWI_LOCALTIMESLOT_ARGS args;
NMS_LINE_GAIN_PARMS device ;
args.localstream = terminus.stream ;
args.localtimeslot = terminus.timeslot ;
args.deviceid = MVIP95_ANALOG_LINE_DEVICE ;
args.parameterid = MVIP95_OUTPUT_GAIN ;
device.gain = gain_dB * 1000 ;
return swiConfigLocalTimeslot (
/* CT Access switch handle */ swihd,
/* target device and config item */ & args,
/* buffer (defined by parameterid) */ (void*) &
device,
/* buffer size in bytes */
sizeof(device));
}
|
localstream
|
MVIP-95: 0
|
|
localtimeslot
|
A value corresponding to the timeslot to query (0 - 7).
|
|
deviceid
|
MVIP95_ANALOG_LINE_DEVICE (0x0000002)
|
|
parameterid
|
NMS_ANALOG_INTERFACE_TYPE
|
typedef struct
{
DWORD type;
} NMS_ANALOG_INTERFACE_TYPE_PARMS ;
|
Value
|
Line Interface Type
|
|---|---|
0x00
|
Loop start
|
0x02
|
Subscriber loop
|
0x03
|
DID
|
0x04
|
E&M 2 wire
|
0x05
|
E&M 4 wire
|
0x0F
|
No interface
|
/*
* Identify the type of signaling module on a given terminus
* ---------------------------------------------------------
*/
#include "ctadef.h" /* For CT Access */
#include "swidef.h" /* For CT Access Switching Service */
#include "mvip95.h" /* For MVIP95_ANALOG_LINE_DEVICE */
#include "nmshw.h" /* For NMS_LINE_INTERFACE_TYPE */
#include <stdlib.h>
#include <stdio.h>
DWORD myGetInterfaceType (
SWIHD swihd, /* From swiOpenSwitch() */
SWI_TERMINUS terminus, /* Target port */
DWORD *generation, /* Hardware generation */
DWORD *type /* Physical interface type */
)
{
SWI_LOCALTIMESLOT_ARGS args;
NMS_ANALOG_INTERFACE_TYPE_PARMS parms ;
DWORD rc ;
if ( terminus.bus != MVIP95_LOCAL_BUS )
return -1 ; /* Error - only applies to local bus */
args.localstream = terminus.stream ;
args.localtimeslot = terminus.timeslot ;
args.deviceid = MVIP95_ANALOG_LINE_DEVICE ;
args.parameterid = NMS_ANALOG_INTERFACE_TYPE ;
rc = swiGetLocalTimeslotInfo (
/* CT Access switch handle */ swihd,
/* target device and config item */ & args,
/* buffer (defined by parameterid) */ (void*) & parms,
/* buffer size in bytes */ sizeof(parms));
if ( rc == SUCCESS )
{
*generation = GET_ANALOG_INTERFACE_CLASS(parms.type);
*type = GET_ANALOG_INTERFACE_TYPE(parms.type);
switch (*generation)
{
case NMS_INTERFACE_AG_HYBRID:
printf("Class: NMS_INTERFACE_AG_HYBRID\n");
break;
case NMS_INTERFACE_AG_SIGNALING_MODULE:
printf("Class: NMS_INTERFACE_AG_SIGNALING_MODULE\n");
break;
default:
printf("Class: Unknown\n");
}
printf ("Type : %02X\n", *type ) ;
}
else
{
printf ("swiGetLocalTimeslotInfo returns %d\n", rc ) ;
}
return rc ;
}
(Page 1 of 1 in this chapter) Version