Table of Contents Index NMS Glossary Previous Page Next Page (Page 9 of 69 in this chapter) Version


adiGetBoardInfo

Description

Obtains information about an AG or QX board.

Prototype

DWORD adiGetBoardInfo ( CTAHD ctahd,
unsigned board,
unsigned size,
ADI_BOARD_INFO *boardinfo )

ctahd CTA context handle returned by ctaCreateContext.

board Board number as specified in the configuration file.

size Size of boardinfo structure.

boardinfo Pointer to the ADI_BOARD_INFO structure, as shown:

typedef struct
{

DWORD size; /* Size of this structure */

DWORD boardtype; /* Physical board type ADI_BOARDTYPE_xxx */

DWORD serial; /* Serial number */

DWORD ioaddr; /* Base IO address */

DWORD intnum; /* Interrupt number */

DWORD bufsize; /* Buffer size */

DWORD freemem; /* Available memory */

BYTE daughterboardid[4] ; /* Daughterboard IDs 0 = none */

DWORD totalmips; /* Total gross DSP MIPS */

DWORD trunktype; /* Type of digital or analog trunk */

DWORD numtrunks; /* Number of trunks */

}ADI_BOARD_INFO;

Return Values

Events

None.

Details

This function retrieves hardware configuration data for the specified AG or QX board.

The board argument identifies a particular AG or QX board. This identifier must correlate to a board ID in the AG or QX configuration file. Refer to the board-specific installation and developer's manual for more information.

Note: If an analog board is populated with a mixture of line interface types, the type of the lowest numbered interface will be reported.

The ctahd argument is used to access the CTA context on which the ADI service was opened. The ADI service can be opened in driver-only mode if desired. In this case, no actual board resources will be reserved. Set the board field in the MVIP_ADDR structure passed to ctaOpenServices to ADI_AG_DRIVER_ONLY. This function will also work with a CTA context that has the ADI service opened on actual MVIP streams and timeslots.

The size argument indicates how much memory to write at boardinfo address. The ADI service stores the actual number of bytes written in the ADI_BOARD_INFO size field.

Example


void myShowBoardType( CTAHD ctahd, unsigned board )
{
    ADI_BOARD_INFO boardinfo;
    char          *type;
    unsigned       b_ports;
    int            ret;

    ret = adiGetBoardInfo( ctahd, board, sizeof boardinfo, &boardinfo );

    if( ret == SUCCESS )
    {
        switch( boardinfo.boardtype )
        
case ADI_BOARDTYPE_QX2000 : type="QX 2000"; b_ports=4; break;
case ADI_BOARDTYPE_AGQUADT1: type="AG Quad T1"; b_ports=96; break; case ADI_BOARDTYPE_AGQUADE1: type="AG Quad E1"; b_ports=120; break; case ADI_BOARDTYPE_AGDUALT1: type="AG Dual T1"; b_ports=48; break; case ADI_BOARDTYPE_AGDUALE1: type="AG Dual E1"; b_ports=60; break; case ADI_BOARDTYPE_AG2000: type="AG 2000"; b_ports= 8; break; case ADI_BOARDTYPE_AG4000_4T:type="AG 4000 4T"; b_ports=96; break; case ADI_BOARDTYPE_AG4000_4E:type="AG 4000 4E"; b_ports=120; break;
case ADI_BOARDTYPE_CG6000C_QUAD:type="CG6000C_QUAD";b_ports=120;break;
default: case ADI_BOARDTYPE_UNKNOWN : type="Unknown"; b_ports=0; break; } printf( "board:%2d at addr:%4x is an %-7s with %3d ports.\n", board, boardinfo.ioaddr, type, b_ports ); } else if( ret == CTAERR_INVALID_BOARD ) printf( "There is no board # %d.\n", board ); else /* unexpected error */ printf( "Error %x getting board # %d information.\n", ret, board ); }


Table of Contents Index NMS Glossary Previous Page Next Page (Page 9 of 69 in this chapter) Version


Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2000, Natural MicroSystems, Inc. All rights reserved.