Queries the current state of the out-of-band signaling bits. Use only with NOCC protocol.
AG
CG
DWORD adiQuerySignalState ( CTAHD ctahd)
Argument |
Description |
ctahd |
Context handle returned by ctaCreateContext or ctaAttachContext. |
Return value |
Description |
SUCCESS |
|
CTAERR_FUNCTION_NOT_ACTIVE |
adiStartSignalDetector was not called. |
CTAERR_INVALID_STATE |
Function not valid in the current port state. |
CTAERR_RESOURCE_CONFLICT |
A protocol other than NOCC is active. |
CTAERR_SVR_COMM |
Server communication error. |
Event |
Description |
ADIEVN_QUERY_SIGNAL_DONE |
After the ADI service queries the board for the current signaling pattern, the ADI service generates an event with the size field containing the current signaling pattern. It is a mask of the following constants found in adidef.h: ADI_A_BIT, ADI_B_BIT, ADI_C_BIT, and ADI_D_BIT. |
The AG 2000, AG 2000C, and AG 2000-BRI boards require signal.m54 to be loaded.
Use adiQuerySignalState to query the out-of-band signaling detector for the current state of the signaling bits. These signaling bits can be the actual T1/E1 digital carrier signaling bits, or they can relate to specific detectors of analog interface boards (for example, a ring detector). In both cases, the ADI service recognizes four signaling bits: A, B, C, and D, often written as ABCD, and defined by the constants ADI_A_BIT, ADI_B_BIT, ADI_BIT, and ADI_D_BIT.
Note: This function can be called only if you started detection using adiStartSignalDetector.
int myShowMVIP( CTAHD ctahd )
{
CTA_EVENT event;
if( adiQuerySignalState( ctahd ) != SUCCESS )
return MYFAILURE;
while( 1 )
{
myGetEvent( ctahd, &event ); /* see ctaWaitEvent example */
switch( event.id )
{
case ADIEVN_QUERY_SIGNAL_DONE:
printf( "MVIP signalling bits = 0x%x (%c%c%c%c)\n",
(event.size&0xf),
(event.size&0x8)?'A':'-', (event.size&0x4)?'B':'-',
(event.size&0x2)?'C':'-', (event.size&0x1)?'D':'-' );
break;
/* ... */
}
}
}