AVED InBand Telemetry Application

Overview

The In-Band Telemetry application handles the events and communication between the Host and the ASDM data.

Application External APIs

Initialize the application.

The initialization function takes two parameters:

  • The shared memory address, which is used to populate the sensor responses.

  • The number of sensors in the profile, used internally to dynamically allocate some structures.


iIN_BAND_TELEMETRY_Initialise

/**
 * @brief   Initialise the in band telemetry application layer
 *          used to handle events and communication between the host
 *          and the sensors
 *
 * @param   ullSharedMemBaseAddr  The base address of the shared memory
 *
 * @return  OK          Success
 *          ERROR       Failure
 */
int iIN_BAND_TELEMETRY_Initialise( uint64_t ullSharedMemBaseAddr );

Clear Statistics

Debug function used to clear the all statistics counters back to zero.

iIN_BAND_TELEMETRY_ClearStatistics

/**
 * @brief   Clear all the stats in the application
 *
 * @return  OK          Stats cleared successfully
 *          ERROR       Stats not cleared successfully
 *
 */
int iIN_BAND_TELEMETRY_ClearStatistics( void );

Test Mode

Function for enabling and disabling the test mode for InBand Telemetry

iIN_BAND_TELEMETRY_TestMode

/**
 * @brief   Activating/Deactivating Test Mode
 *
 * @param   iActivate   Setting test mode activated or deactivated
 *                      TRUE for activating
 *                      FALSE for deactivating
 *
 * @return  OK          Test mode is activated/deactivated successfully
 *          ERROR       Test mode is not activated/deactivated successfully
 *
 */
int iIN_BAND_TELEMETRY_TestMode( int iActivate );

Internal Design

Structures

Internal Context structure

IN_BAND_PRIVATE_DATA

/**
 * @struct  IN_BAND_PRIVATE_DATA
 * @brief   Structure to hold ths in band telemetry private data
 */
typedef struct IN_BAND_PRIVATE_DATA
{
    uint32_t                        ulUpperFirewall;
    void                            *pvOsalMutexHdl;
    uint64_t                        ullSharedMemBaseAddr;
    uint32_t                        pulStatCounters[ IN_BAND_STATS_MAX ];
    uint32_t                        pulErrorCounters[ IN_BAND_ERRORS_MAX ];
    int                             iInitialised;
    int                             iInBandTestMode;
    uint32_t                        ulLowerFirewall;

} IN_BAND_PRIVATE_DATA;

iIN_BAND_TELEMETRY_Initialise Function

This function:

  • Creates a mutex.

  • Binds into the AMI to get sensor requests from the host.


image1


iAmiCallback Function

This function is the bound in callback from the AMI Proxy to listen for the ‘AMI_PROXY_DRIVER_E_SENSOR_READ’ event.

When received, the application will call back into the AMI proxy to get the data associated with the request.

The request type (below) is then used to form up the response back from the internal ASDM table.

AMI Proxy Request TypeIn Band handling functionDescription
AMI_PROXY_CMD_SENSOR_REQUEST_GET_SIZE iASDM_PopulateResponseReturn the size of the SDR, including Header, Sensor Records and End of Repo marker
AMI_PROXY_CMD_SENSOR_REQUEST_GET_SDRiASDM_PopulateResponse

Return the entire SDR – Header, Sensor Records and End of Repo marker

AMI_PROXY_CMD_SENSOR_REQUEST_GET_SINGLE_SDRiASDM_PopulateResponse

Return the instantaneous sensor data based on the input sensor ID

AMI_PROXY_CMD_SENSOR_REQUEST_ALL_SDRiASDM_PopulateResponse

Return the instantaneous sensor data for all sensors in a given SDR



Page Revision: v. 26