void ParticipantProxy::setTemperatureThresholds(const Temperature& lowerBound, const Temperature& upperBound) { refreshDomainSetIfUninitialized(); if (m_domains.size() > 0) { if (m_domains[0].getTemperatureProperty().implementsTemperatureInterface()) { m_policyServices.messageLogging->writeMessageDebug(PolicyMessage(FLF, "Setting thresholds to " + lowerBound.toString() + ":" + upperBound.toString() + ".")); m_domains[0].getTemperatureProperty().setTemperatureNotificationThresholds(lowerBound, upperBound); } } m_previousLowerBound = lowerBound; m_previousUpperBound = upperBound; }
void DptfMessage::addMessage(const std::string& messageKey, Temperature messageValue) { try { m_messageKeyValuePair.push_back(MessageKeyValuePair(messageKey, messageValue.toString())); } catch (...) { } }
void EsifServices::primitiveExecuteSetAsTemperatureC(esif_primitive_type primitive, Temperature temperature, UIntN participantIndex, UIntN domainIndex, UInt8 instance) { throwIfParticipantDomainCombinationInvalid(FLF, participantIndex, domainIndex); #ifdef ONLY_LOG_TEMPERATURE_THRESHOLDS // Added to help debug issue with missing temperature threshold events if (primitive == esif_primitive_type::SET_TEMPERATURE_THRESHOLDS) { ManagerMessage message = ManagerMessage(m_dptfManager, FLF, "Setting new temperature threshold for participant."); message.addMessage("Temperature", temperature.toString()); message.setEsifPrimitive(primitive, instance); message.setParticipantAndDomainIndex(participantIndex, domainIndex); writeMessageDebug(message, MessageCategory::TemperatureThresholds); } #endif eEsifError rc = m_esifInterface.fPrimitiveFuncPtr(m_esifHandle, m_dptfManager, (void*)m_dptfManager->getIndexContainer()->getIndexPtr(participantIndex), (void*)m_dptfManager->getIndexContainer()->getIndexPtr(domainIndex), EsifDataTemperature(temperature), EsifDataVoid(), primitive, instance); #ifdef ONLY_LOG_TEMPERATURE_THRESHOLDS // Added to help debug issue with missing temperature threshold events if (primitive == esif_primitive_type::SET_TEMPERATURE_THRESHOLDS && rc != ESIF_OK) { ManagerMessage message = ManagerMessage(m_dptfManager, FLF, "Failed to set new temperature threshold."); message.addMessage("Temperature", temperature.toString()); message.setEsifPrimitive(primitive, instance); message.setParticipantAndDomainIndex(participantIndex, domainIndex); message.setEsifErrorCode(rc); writeMessageError(message, MessageCategory::TemperatureThresholds); } #endif throwIfNotSuccessful(FLF, rc, primitive, participantIndex, domainIndex, instance); }