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.

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;
    int            ret;
    ret = adiGetBoardInfo( ctahd, board, sizeof boardinfo, &boardinfo );
    if( ret == SUCCESS )
    {
        switch( boardinfo.boardtype )
        {
            case ADI_BOARDTYPE_AG2000   : type = "AG-2000 "   ; break;
            case ADI_BOARDTYPE_AG2000C  : type = "AG-2000C"   ; break;
            case ADI_BOARDTYPE_AG2000BRI: type = "AG-2000BRI" ; break;
            case ADI_BOARDTYPE_CG6060   : type = "CG6060  "   ; break;
            case ADI_BOARDTYPE_CG6060C  : type = "CG6060C "   ; break;
            case ADI_BOARDTYPE_CG6565   : type = "CG6565  "   ; break;
            case ADI_BOARDTYPE_CG6565C  : type = "CG6565C "   ; break;
            case ADI_BOARDTYPE_CG6565E  : type = "CG6565E "   ; break;
            default:
            case ADI_BOARDTYPE_UNKNOWN  : type = "Unknown"    ; break;
        }
        printf ( " board %2d  at bus,slot %2d,%2d  is type %-11s  with %5d total MIPS\n",
                 board, boardinfo.ioaddr >> 8, boardinfo.ioaddr & 0xff,
                 type, boardinfo.totalmips );
    }
    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 );
}