Esempio n. 1
0
//--------------------------------------------------------------------------------------------------
le_result_t le_temp_GetPlatformThresholds
(
    int32_t* lowCriticalTempPtr,
        ///< [OUT]
        ///< [OUT] The low critical temperature threshold in degree celsius.

    int32_t* lowWarningTempPtr,
        ///< [OUT]
        ///< [OUT] The low warning temperature threshold in degree celsius.

    int32_t* hiWarningTempPtr,
        ///< [OUT]
        ///< [OUT] The high warning temperature threshold in degree celsius.

    int32_t* hiCriticalTempPtr
        ///< [OUT]
        ///< [OUT] The high critical temperature threshold
        ///<  in degree celsius.
)
{
    if ( (lowCriticalTempPtr == NULL) || (lowWarningTempPtr == NULL)
         || (hiWarningTempPtr == NULL) || (hiCriticalTempPtr == NULL) )
    {
        LE_KILL_CLIENT("Parameters pointer are NULL!!");
        return LE_FAULT;
    }
    return pa_temp_GetPlatformThresholds(lowCriticalTempPtr, lowWarningTempPtr,
                    hiWarningTempPtr, hiCriticalTempPtr);
}
Esempio n. 2
0
//--------------------------------------------------------------------------------------------------
void Testle_Temp_TestCorrectUsage
(
    void
)
{
    int32_t platformTemp=0;
    int32_t lowCriticalTemp=1, lowCriticalTempTmp=0;;
    int32_t lowWarningTemp=3, lowWarningTempTmp=0;
    int32_t hiWarningTemp=5, hiWarningTempTmp=0;
    int32_t hiCriticalTemp=7, hiCriticalTempTmp=0;
    int32_t radioTemp=0;

    pa_tempSimu_SetReturnCode(LE_OK);

    LE_ASSERT(le_temp_GetPlatformTemperature(&platformTemp) == LE_OK);
    LE_ASSERT(platformTemp==PA_SIMU_TEMP_DEFAULT_PLATFORM_TEMP);

    LE_ASSERT(le_temp_GetPlatformThresholds(&lowCriticalTempTmp,
                                            &lowWarningTempTmp,
                                            &hiWarningTempTmp,
                                            &hiCriticalTempTmp) == LE_OK);
    LE_ASSERT(lowCriticalTempTmp == PA_SIMU_TEMP_DEFAULT_PLATFORM_LOW_CRIT);
    LE_ASSERT(lowWarningTempTmp == PA_SIMU_TEMP_DEFAULT_PLATFORM_LOW_WARN);
    LE_ASSERT(hiWarningTempTmp == PA_SIMU_TEMP_DEFAULT_PLATFORM_HIGH_WARN);
    LE_ASSERT(hiCriticalTempTmp == PA_SIMU_TEMP_DEFAULT_PLATFORM_HIGH_CRIT);

    LE_ASSERT(le_temp_GetRadioTemperature(&radioTemp) == LE_OK);
    LE_ASSERT(radioTemp == PA_SIMU_TEMP_DEFAULT_RADIO_TEMP);

    LE_ASSERT(le_temp_GetRadioThresholds(&hiWarningTempTmp, &hiCriticalTempTmp) == LE_OK);
    LE_ASSERT(hiWarningTempTmp == PA_SIMU_TEMP_DEFAULT_RADIO_HIGH_WARN);
    LE_ASSERT(hiCriticalTempTmp == PA_SIMU_TEMP_DEFAULT_RADIO_HIGH_CRIT);

    LE_ASSERT(le_temp_SetPlatformThresholds(lowCriticalTemp,
                                            lowWarningTemp,
                                            hiWarningTemp,
                                            hiCriticalTemp) == LE_OK);

    // Check if the values are correctly set in the PA
    lowCriticalTempTmp = lowWarningTempTmp = hiWarningTempTmp = hiCriticalTempTmp = 0;
    pa_temp_GetPlatformThresholds(&lowCriticalTempTmp,
                                  &lowWarningTempTmp,
                                  &hiWarningTempTmp,
                                  &hiCriticalTempTmp);
    LE_ASSERT(lowCriticalTemp == lowCriticalTempTmp);
    LE_ASSERT(lowWarningTemp == lowWarningTempTmp);
    LE_ASSERT(hiWarningTemp == hiWarningTempTmp);
    LE_ASSERT(hiCriticalTemp == hiCriticalTempTmp);

    LE_ASSERT(le_temp_SetRadioThresholds(hiWarningTemp, hiCriticalTemp) == LE_OK);
    hiWarningTempTmp = hiCriticalTempTmp = 0;
    pa_temp_GetRadioThresholds(&hiWarningTempTmp, &hiCriticalTempTmp);
    LE_ASSERT(hiWarningTemp == hiWarningTempTmp);
    LE_ASSERT(hiCriticalTemp == hiCriticalTempTmp);
}