txinfoSystemInfo

Prepares a CPI packet for use as a TX INFO message to retrieve system information.

Prototype

U32 txinfoSystemInfo ( CPIPKT *pkt, U32 msgkey)

Argument

Description

pkt

Pointer to a CPI packet to be filled in as a request message or NULL when using the function to determine the size of a CPI packet needed to perform a system information request.

msgkey

User-controlled key sent in request and provided in response.


Return values

Return value

Description

SUCCESS

 

SCCIP_INVALID_SIZE

Invalid buffer size.


Details

Call txinfoSystemInfo with pkt = NULL to determine the required byte length of a CPI packet needed to represent a system information request. Upon successful return from this function, allocate the amount of memory indicated and pass that packet address to txinfoAddress. Upon successful return from txinfoAddress, call txinfoSystemInfo again while providing the address of the memory to be initialized as a system information request message. After the second call to txinfoSystemInfo, the packet can be sent to the TX board using cpi_send or cpia_send. Refer to the CPI Library Developer's Reference Manual for information about cpi_send or cpia_send.

See also

txinfoReply

Example

    /* ----- determine the size of the request packet */
    req_size = txinfoSystemInfo( NULL, 0 );
    if (req_size == 0)
    {
        printf( "Error sizing SYSTEM INFO.\n" );

        exit( 1 );
    }

    /* ----- create the request msg */
    pkt = (CPIPKT *)malloc( req_size );
    txinfoAddress( pkt, req_size, board, PT_MGR );
    status = txinfoSystemInfo( pkt, 0 );
    if (status != 0)
    {
        printf( "Error [0x%08X] building SYSTEM INFO.\n", status );
        free( pkt );

        exit( 1 );
    }

    /* ----- send the request msg */
    cpistatus = cpia_send( handle, pkt, NULL );