Lines Matching full:pdr

4 #include "libpldmresponder/pdr.hpp"
26 /** @brief Function to get the effecter value by PDR factor coefficient, etc.
27 * @param[in] pdr - The structure of pldm_numeric_effecter_value_pdr.
36 const pldm_numeric_effecter_value_pdr* pdr, T& effecterValue, in getEffecterRawValue() argument
43 switch (pdr->effecter_data_size) in getEffecterRawValue()
48 round(effecterValue - pdr->offset) / pdr->resolution); in getEffecterRawValue()
49 if (pdr->min_settable.value_u8 < pdr->max_settable.value_u8 && in getEffecterRawValue()
50 (rawValue < pdr->min_settable.value_u8 || in getEffecterRawValue()
51 rawValue > pdr->max_settable.value_u8)) in getEffecterRawValue()
71 round(effecterValue - pdr->offset) / pdr->resolution); in getEffecterRawValue()
72 if (pdr->min_settable.value_s8 < pdr->max_settable.value_s8 && in getEffecterRawValue()
73 (rawValue < pdr->min_settable.value_s8 || in getEffecterRawValue()
74 rawValue > pdr->max_settable.value_s8)) in getEffecterRawValue()
84 round(effecterValue - pdr->offset) / pdr->resolution); in getEffecterRawValue()
85 if (pdr->min_settable.value_u16 < pdr->max_settable.value_u16 && in getEffecterRawValue()
86 (rawValue < pdr->min_settable.value_u16 || in getEffecterRawValue()
87 rawValue > pdr->max_settable.value_u16)) in getEffecterRawValue()
107 round(effecterValue - pdr->offset) / pdr->resolution); in getEffecterRawValue()
108 if (pdr->min_settable.value_s16 < pdr->max_settable.value_s16 && in getEffecterRawValue()
109 (rawValue < pdr->min_settable.value_s16 || in getEffecterRawValue()
110 rawValue > pdr->max_settable.value_s16)) in getEffecterRawValue()
130 round(effecterValue - pdr->offset) / pdr->resolution); in getEffecterRawValue()
131 if (pdr->min_settable.value_u32 < pdr->max_settable.value_u32 && in getEffecterRawValue()
132 (rawValue < pdr->min_settable.value_u32 || in getEffecterRawValue()
133 rawValue > pdr->max_settable.value_u32)) in getEffecterRawValue()
153 round(effecterValue - pdr->offset) / pdr->resolution); in getEffecterRawValue()
154 if (pdr->min_settable.value_s32 < pdr->max_settable.value_s32 && in getEffecterRawValue()
155 (rawValue < pdr->min_settable.value_s32 || in getEffecterRawValue()
156 rawValue > pdr->max_settable.value_s32)) in getEffecterRawValue()
178 /** @brief Function to convert the D-Bus value by PDR factor and effecter value.
179 * @param[in] pdr - The structure of pldm_numeric_effecter_value_pdr.
188 const pldm_numeric_effecter_value_pdr* pdr, uint8_t effecterDataSize, in convertToDbusValue() argument
194 return getEffecterRawValue<uint8_t>(pdr, currentValue, propertyType); in convertToDbusValue()
199 return getEffecterRawValue<int8_t>(pdr, currentValue, propertyType); in convertToDbusValue()
205 return getEffecterRawValue<uint16_t>(pdr, currentValue, propertyType); in convertToDbusValue()
210 return getEffecterRawValue<int16_t>(pdr, currentValue, propertyType); in convertToDbusValue()
216 return getEffecterRawValue<uint32_t>(pdr, currentValue, propertyType); in convertToDbusValue()
221 return getEffecterRawValue<int32_t>(pdr, currentValue, propertyType); in convertToDbusValue()
253 pldm_numeric_effecter_value_pdr* pdr = nullptr; in setNumericEffecterValueHandler() local
259 error("Failed to instantiate numeric effecter PDR repository"); in setNumericEffecterValueHandler()
264 pldm::responder::pdr::getRepoByType(handler.getRepo(), numericEffecterPDRs, in setNumericEffecterValueHandler()
268 error("The Numeric Effecter PDR repo is empty."); in setNumericEffecterValueHandler()
272 // Get the pdr structure of pldm_numeric_effecter_value_pdr according in setNumericEffecterValueHandler()
278 pdr = new (pdrEntry.data) pldm_numeric_effecter_value_pdr; in setNumericEffecterValueHandler()
279 if (pdr->effecter_id != effecterId) in setNumericEffecterValueHandler()
281 pdr = nullptr; in setNumericEffecterValueHandler()
289 if (!pdr) in setNumericEffecterValueHandler()
311 pdr, effecterDataSize, effecterValue, dbusMappings[0].propertyType); in setNumericEffecterValueHandler()
486 * effecterId not found in the PDR repo
494 pldm_numeric_effecter_value_pdr* pdr = nullptr; in getNumericEffecterData() local
500 pldm::responder::pdr::getRepoByType(handler.getRepo(), numericEffecterPDRs, in getNumericEffecterData()
504 error("The Numeric Effecter PDR repo is empty."); in getNumericEffecterData()
508 // Get the pdr structure of pldm_numeric_effecter_value_pdr according in getNumericEffecterData()
515 pdr = new (pdrEntry.data) pldm_numeric_effecter_value_pdr; in getNumericEffecterData()
516 if (pdr->effecter_id != effecterId) in getNumericEffecterData()
518 pdr = nullptr; in getNumericEffecterData()
522 effecterDataSize = pdr->effecter_data_size; in getNumericEffecterData()
526 if (!pdr) in getNumericEffecterData()