adiGetBoardInfo

Obtains information about a board.

Supported board types

Prototype

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

Argument

Description

ctahd

Context handle returned by ctaCreateContext or ctaAttachContext.

board

Board number as specified in the board keyword 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

Return value

Description

SUCCESS

 

CTAERR_BAD_ARGUMENT

boardinfo pointer is NULL.

CTAERR_BAD_SIZE

size is smaller than the size of DWORD.

CTAERR_INVALID_CTAHD

Context handle is invalid.

CTAERR_SVR_COMM

Server communication error.


Details

Use adiGetBoardInfo to retrieve hardware configuration data for the specified board. The board argument identifies a particular board. This identifier must correlate to a board ID in the board keyword file. Refer to the board 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 is reported.

AG 4040 and AG 4040C boards are software compatible with AG 4000 and AG 4000C boards. When retrieving board information on AG 4040 or AG 4040C boards, adiGetBoardInfo reports the ADI board type as one of the AG 4000 or AG 4000C board types, for example, ADI_BOARDTYPE_AG4000_4T. The AG 4040 or AG 4040C trunk type, either T1 or E1, is configured in the board keyword file. If the trunk type is not specified, adiGetBoardInfo reports the ADI board type as one of the T1 variants.

The ctahd argument is used to access the 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 are reserved. Set the board field in the MVIP_ADDR structure passed to ctaOpenServices to ADI_AG_DRIVER_ONLY. This function also works with a 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.

See also

adiGetEEPromData

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_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 );
}