George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "config.h" |
| 4 | |
Deepak Kodihalli | d130e1a | 2020-06-17 05:55:32 -0500 | [diff] [blame] | 5 | #include "common/utils.hpp" |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 6 | #include "libpldmresponder/pdr.hpp" |
| 7 | #include "pdr_utils.hpp" |
Deepak Kodihalli | 1521f6d | 2020-06-16 08:51:02 -0500 | [diff] [blame] | 8 | #include "pldmd/handler.hpp" |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 9 | |
George Liu | c453e16 | 2022-12-21 17:16:23 +0800 | [diff] [blame] | 10 | #include <libpldm/platform.h> |
| 11 | #include <libpldm/states.h> |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 12 | #include <math.h> |
| 13 | #include <stdint.h> |
| 14 | |
Riya Dixit | 49cfb13 | 2023-03-02 04:26:53 -0600 | [diff] [blame^] | 15 | #include <phosphor-logging/lg2.hpp> |
| 16 | |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 17 | #include <map> |
| 18 | #include <optional> |
| 19 | |
Riya Dixit | 49cfb13 | 2023-03-02 04:26:53 -0600 | [diff] [blame^] | 20 | PHOSPHOR_LOG2_USING; |
| 21 | |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 22 | namespace pldm |
| 23 | { |
| 24 | namespace responder |
| 25 | { |
| 26 | namespace platform_numeric_effecter |
| 27 | { |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 28 | /** @brief Function to get the effecter value by PDR factor coefficient, etc. |
| 29 | * @param[in] pdr - The structure of pldm_numeric_effecter_value_pdr. |
Pavithra Barithaya | 45cd16b | 2021-07-01 08:19:59 -0500 | [diff] [blame] | 30 | * @param[in] effecterValue - effecter value. |
| 31 | * @param[in] propertyType - type of the D-Bus property. |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 32 | * |
| 33 | * @return - std::pair<int, std::optional<PropertyValue>> - rc:Success or |
| 34 | * failure, PropertyValue: The value to be set |
| 35 | */ |
| 36 | template <typename T> |
Brad Bishop | 5079ac4 | 2021-08-19 18:35:06 -0400 | [diff] [blame] | 37 | std::pair<int, std::optional<pldm::utils::PropertyValue>> |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 38 | getEffecterRawValue(const pldm_numeric_effecter_value_pdr* pdr, |
Pavithra Barithaya | 45cd16b | 2021-07-01 08:19:59 -0500 | [diff] [blame] | 39 | T& effecterValue, std::string propertyType) |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 40 | { |
| 41 | // X = Round [ (Y - B) / m ] |
| 42 | // refer to DSP0248_1.2.0 27.8 |
| 43 | int rc = 0; |
Brad Bishop | 5079ac4 | 2021-08-19 18:35:06 -0400 | [diff] [blame] | 44 | pldm::utils::PropertyValue value; |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 45 | switch (pdr->effecter_data_size) |
| 46 | { |
| 47 | case PLDM_EFFECTER_DATA_SIZE_UINT8: |
| 48 | { |
| 49 | auto rawValue = static_cast<uint8_t>( |
| 50 | round(effecterValue - pdr->offset) / pdr->resolution); |
Manojkiran Eda | fc0ce97 | 2022-06-25 09:38:28 +0530 | [diff] [blame] | 51 | if (pdr->min_settable.value_u8 < pdr->max_settable.value_u8 && |
| 52 | (rawValue < pdr->min_settable.value_u8 || |
| 53 | rawValue > pdr->max_settable.value_u8)) |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 54 | { |
| 55 | rc = PLDM_ERROR_INVALID_DATA; |
| 56 | } |
| 57 | value = rawValue; |
Pavithra Barithaya | 45cd16b | 2021-07-01 08:19:59 -0500 | [diff] [blame] | 58 | if (propertyType == "uint64_t") |
| 59 | { |
Pavithra Barithaya | 45cd16b | 2021-07-01 08:19:59 -0500 | [diff] [blame] | 60 | auto tempValue = std::get<uint8_t>(value); |
| 61 | value = static_cast<uint64_t>(tempValue); |
| 62 | } |
Sagar Srinivas | db43612 | 2021-10-20 06:44:07 -0500 | [diff] [blame] | 63 | else if (propertyType == "uint32_t") |
| 64 | { |
| 65 | auto tempValue = std::get<uint8_t>(value); |
| 66 | value = static_cast<uint32_t>(tempValue); |
| 67 | } |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 68 | break; |
| 69 | } |
| 70 | case PLDM_EFFECTER_DATA_SIZE_SINT8: |
| 71 | { |
| 72 | auto rawValue = static_cast<int8_t>( |
| 73 | round(effecterValue - pdr->offset) / pdr->resolution); |
Manojkiran Eda | fc0ce97 | 2022-06-25 09:38:28 +0530 | [diff] [blame] | 74 | if (pdr->min_settable.value_s8 < pdr->max_settable.value_s8 && |
| 75 | (rawValue < pdr->min_settable.value_s8 || |
| 76 | rawValue > pdr->max_settable.value_s8)) |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 77 | { |
| 78 | rc = PLDM_ERROR_INVALID_DATA; |
| 79 | } |
| 80 | value = rawValue; |
| 81 | break; |
| 82 | } |
| 83 | case PLDM_EFFECTER_DATA_SIZE_UINT16: |
| 84 | { |
| 85 | auto rawValue = static_cast<uint16_t>( |
| 86 | round(effecterValue - pdr->offset) / pdr->resolution); |
Manojkiran Eda | fc0ce97 | 2022-06-25 09:38:28 +0530 | [diff] [blame] | 87 | if (pdr->min_settable.value_u16 < pdr->max_settable.value_u16 && |
| 88 | (rawValue < pdr->min_settable.value_u16 || |
| 89 | rawValue > pdr->max_settable.value_u16)) |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 90 | { |
| 91 | rc = PLDM_ERROR_INVALID_DATA; |
| 92 | } |
| 93 | value = rawValue; |
Pavithra Barithaya | 45cd16b | 2021-07-01 08:19:59 -0500 | [diff] [blame] | 94 | if (propertyType == "uint64_t") |
| 95 | { |
| 96 | auto tempValue = std::get<uint16_t>(value); |
| 97 | value = static_cast<uint64_t>(tempValue); |
| 98 | } |
Sagar Srinivas | db43612 | 2021-10-20 06:44:07 -0500 | [diff] [blame] | 99 | else if (propertyType == "uint32_t") |
| 100 | { |
| 101 | auto tempValue = std::get<uint16_t>(value); |
| 102 | value = static_cast<uint32_t>(tempValue); |
| 103 | } |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 104 | break; |
| 105 | } |
| 106 | case PLDM_EFFECTER_DATA_SIZE_SINT16: |
| 107 | { |
| 108 | auto rawValue = static_cast<int16_t>( |
| 109 | round(effecterValue - pdr->offset) / pdr->resolution); |
Manojkiran Eda | fc0ce97 | 2022-06-25 09:38:28 +0530 | [diff] [blame] | 110 | if (pdr->min_settable.value_s16 < pdr->max_settable.value_s16 && |
| 111 | (rawValue < pdr->min_settable.value_s16 || |
| 112 | rawValue > pdr->max_settable.value_s16)) |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 113 | { |
| 114 | rc = PLDM_ERROR_INVALID_DATA; |
| 115 | } |
| 116 | value = rawValue; |
Pavithra Barithaya | 45cd16b | 2021-07-01 08:19:59 -0500 | [diff] [blame] | 117 | if (propertyType == "uint64_t") |
| 118 | { |
| 119 | auto tempValue = std::get<int16_t>(value); |
| 120 | value = static_cast<uint64_t>(tempValue); |
| 121 | } |
Sagar Srinivas | db43612 | 2021-10-20 06:44:07 -0500 | [diff] [blame] | 122 | else if (propertyType == "uint32_t") |
| 123 | { |
| 124 | auto tempValue = std::get<int16_t>(value); |
| 125 | value = static_cast<uint32_t>(tempValue); |
| 126 | } |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 127 | break; |
| 128 | } |
| 129 | case PLDM_EFFECTER_DATA_SIZE_UINT32: |
| 130 | { |
| 131 | auto rawValue = static_cast<uint32_t>( |
| 132 | round(effecterValue - pdr->offset) / pdr->resolution); |
Manojkiran Eda | fc0ce97 | 2022-06-25 09:38:28 +0530 | [diff] [blame] | 133 | if (pdr->min_settable.value_u32 < pdr->max_settable.value_u32 && |
| 134 | (rawValue < pdr->min_settable.value_u32 || |
| 135 | rawValue > pdr->max_settable.value_u32)) |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 136 | { |
| 137 | rc = PLDM_ERROR_INVALID_DATA; |
| 138 | } |
| 139 | value = rawValue; |
Pavithra Barithaya | 45cd16b | 2021-07-01 08:19:59 -0500 | [diff] [blame] | 140 | if (propertyType == "uint64_t") |
| 141 | { |
| 142 | auto tempValue = std::get<uint32_t>(value); |
| 143 | value = static_cast<uint64_t>(tempValue); |
| 144 | } |
Sagar Srinivas | db43612 | 2021-10-20 06:44:07 -0500 | [diff] [blame] | 145 | else if (propertyType == "uint32_t") |
| 146 | { |
| 147 | auto tempValue = std::get<uint32_t>(value); |
| 148 | value = static_cast<uint32_t>(tempValue); |
| 149 | } |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 150 | break; |
| 151 | } |
| 152 | case PLDM_EFFECTER_DATA_SIZE_SINT32: |
| 153 | { |
| 154 | auto rawValue = static_cast<int32_t>( |
| 155 | round(effecterValue - pdr->offset) / pdr->resolution); |
Manojkiran Eda | fc0ce97 | 2022-06-25 09:38:28 +0530 | [diff] [blame] | 156 | if (pdr->min_settable.value_s32 < pdr->max_settable.value_s32 && |
| 157 | (rawValue < pdr->min_settable.value_s32 || |
| 158 | rawValue > pdr->max_settable.value_s32)) |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 159 | { |
| 160 | rc = PLDM_ERROR_INVALID_DATA; |
| 161 | } |
| 162 | value = rawValue; |
Pavithra Barithaya | 45cd16b | 2021-07-01 08:19:59 -0500 | [diff] [blame] | 163 | if (propertyType == "uint64_t") |
| 164 | { |
| 165 | auto tempValue = std::get<int32_t>(value); |
| 166 | value = static_cast<uint64_t>(tempValue); |
| 167 | } |
Sagar Srinivas | db43612 | 2021-10-20 06:44:07 -0500 | [diff] [blame] | 168 | else if (propertyType == "uint32_t") |
| 169 | { |
| 170 | auto tempValue = std::get<int32_t>(value); |
| 171 | value = static_cast<uint32_t>(tempValue); |
| 172 | } |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 173 | break; |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | return {rc, std::make_optional(std::move(value))}; |
| 178 | } |
| 179 | |
| 180 | /** @brief Function to convert the D-Bus value by PDR factor and effecter value. |
| 181 | * @param[in] pdr - The structure of pldm_numeric_effecter_value_pdr. |
| 182 | * @param[in] effecterDataSize - effecter value size. |
| 183 | * @param[in,out] effecterValue - effecter value. |
Pavithra Barithaya | 45cd16b | 2021-07-01 08:19:59 -0500 | [diff] [blame] | 184 | * @param[in] propertyType - type of the D-Bus property. |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 185 | * |
| 186 | * @return std::pair<int, std::optional<PropertyValue>> - rc:Success or |
| 187 | * failure, PropertyValue: The value to be set |
| 188 | */ |
Brad Bishop | 5079ac4 | 2021-08-19 18:35:06 -0400 | [diff] [blame] | 189 | std::pair<int, std::optional<pldm::utils::PropertyValue>> |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 190 | convertToDbusValue(const pldm_numeric_effecter_value_pdr* pdr, |
Pavithra Barithaya | 45cd16b | 2021-07-01 08:19:59 -0500 | [diff] [blame] | 191 | uint8_t effecterDataSize, uint8_t* effecterValue, |
| 192 | std::string propertyType) |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 193 | { |
| 194 | if (effecterDataSize == PLDM_EFFECTER_DATA_SIZE_UINT8) |
| 195 | { |
| 196 | uint8_t currentValue = *(reinterpret_cast<uint8_t*>(&effecterValue[0])); |
Pavithra Barithaya | 45cd16b | 2021-07-01 08:19:59 -0500 | [diff] [blame] | 197 | return getEffecterRawValue<uint8_t>(pdr, currentValue, propertyType); |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 198 | } |
| 199 | else if (effecterDataSize == PLDM_EFFECTER_DATA_SIZE_SINT8) |
| 200 | { |
| 201 | int8_t currentValue = *(reinterpret_cast<int8_t*>(&effecterValue[0])); |
Pavithra Barithaya | 45cd16b | 2021-07-01 08:19:59 -0500 | [diff] [blame] | 202 | return getEffecterRawValue<int8_t>(pdr, currentValue, propertyType); |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 203 | } |
| 204 | else if (effecterDataSize == PLDM_EFFECTER_DATA_SIZE_UINT16) |
| 205 | { |
| 206 | uint16_t currentValue = |
| 207 | *(reinterpret_cast<uint16_t*>(&effecterValue[0])); |
Pavithra Barithaya | 45cd16b | 2021-07-01 08:19:59 -0500 | [diff] [blame] | 208 | return getEffecterRawValue<uint16_t>(pdr, currentValue, propertyType); |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 209 | } |
| 210 | else if (effecterDataSize == PLDM_EFFECTER_DATA_SIZE_SINT16) |
| 211 | { |
| 212 | int16_t currentValue = *(reinterpret_cast<int16_t*>(&effecterValue[0])); |
Pavithra Barithaya | 45cd16b | 2021-07-01 08:19:59 -0500 | [diff] [blame] | 213 | return getEffecterRawValue<int16_t>(pdr, currentValue, propertyType); |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 214 | } |
| 215 | else if (effecterDataSize == PLDM_EFFECTER_DATA_SIZE_UINT32) |
| 216 | { |
| 217 | uint32_t currentValue = |
| 218 | *(reinterpret_cast<uint32_t*>(&effecterValue[0])); |
Pavithra Barithaya | 45cd16b | 2021-07-01 08:19:59 -0500 | [diff] [blame] | 219 | return getEffecterRawValue<uint32_t>(pdr, currentValue, propertyType); |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 220 | } |
| 221 | else if (effecterDataSize == PLDM_EFFECTER_DATA_SIZE_SINT32) |
| 222 | { |
| 223 | int32_t currentValue = *(reinterpret_cast<int32_t*>(&effecterValue[0])); |
Pavithra Barithaya | 45cd16b | 2021-07-01 08:19:59 -0500 | [diff] [blame] | 224 | return getEffecterRawValue<int32_t>(pdr, currentValue, propertyType); |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 225 | } |
| 226 | else |
| 227 | { |
Riya Dixit | 49cfb13 | 2023-03-02 04:26:53 -0600 | [diff] [blame^] | 228 | error("Wrong field effecterDataSize..."); |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 229 | return {PLDM_ERROR, {}}; |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | /** @brief Function to set the effecter value requested by pldm requester |
| 234 | * @tparam[in] DBusInterface - DBus interface type |
| 235 | * @tparam[in] Handler - pldm::responder::platform::Handler |
| 236 | * @param[in] dBusIntf - The interface object of DBusInterface |
| 237 | * @param[in] handler - The interface object of |
| 238 | * pldm::responder::platform::Handler |
| 239 | * @param[in] effecterId - Effecter ID sent by the requester to act on |
| 240 | * @param[in] effecterDataSize - The bit width and format of the setting |
| 241 | * value for the effecter |
| 242 | * @param[in] effecter_value - The setting value of numeric effecter being |
| 243 | * requested. |
| 244 | * @param[in] effecterValueLength - The setting value length of numeric |
| 245 | * effecter being requested. |
| 246 | * @return - Success or failure in setting the states. Returns failure in |
| 247 | * terms of PLDM completion codes if atleast one state fails to be set |
| 248 | */ |
| 249 | template <class DBusInterface, class Handler> |
| 250 | int setNumericEffecterValueHandler(const DBusInterface& dBusIntf, |
| 251 | Handler& handler, uint16_t effecterId, |
| 252 | uint8_t effecterDataSize, |
| 253 | uint8_t* effecterValue, |
| 254 | size_t effecterValueLength) |
| 255 | { |
| 256 | constexpr auto effecterValueArrayLength = 4; |
| 257 | pldm_numeric_effecter_value_pdr* pdr = nullptr; |
| 258 | |
| 259 | std::unique_ptr<pldm_pdr, decltype(&pldm_pdr_destroy)> |
| 260 | numericEffecterPdrRepo(pldm_pdr_init(), pldm_pdr_destroy); |
Brad Bishop | 5079ac4 | 2021-08-19 18:35:06 -0400 | [diff] [blame] | 261 | pldm::responder::pdr_utils::Repo numericEffecterPDRs( |
| 262 | numericEffecterPdrRepo.get()); |
| 263 | pldm::responder::pdr::getRepoByType(handler.getRepo(), numericEffecterPDRs, |
| 264 | PLDM_NUMERIC_EFFECTER_PDR); |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 265 | if (numericEffecterPDRs.empty()) |
| 266 | { |
Riya Dixit | 49cfb13 | 2023-03-02 04:26:53 -0600 | [diff] [blame^] | 267 | error("The Numeric Effecter PDR repo is empty."); |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 268 | return PLDM_ERROR; |
| 269 | } |
| 270 | |
| 271 | // Get the pdr structure of pldm_numeric_effecter_value_pdr according |
| 272 | // to the effecterId |
Brad Bishop | 5079ac4 | 2021-08-19 18:35:06 -0400 | [diff] [blame] | 273 | pldm::responder::pdr_utils::PdrEntry pdrEntry{}; |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 274 | auto pdrRecord = numericEffecterPDRs.getFirstRecord(pdrEntry); |
| 275 | while (pdrRecord) |
| 276 | { |
| 277 | pdr = reinterpret_cast<pldm_numeric_effecter_value_pdr*>(pdrEntry.data); |
| 278 | if (pdr->effecter_id != effecterId) |
| 279 | { |
| 280 | pdr = nullptr; |
| 281 | pdrRecord = numericEffecterPDRs.getNextRecord(pdrRecord, pdrEntry); |
| 282 | continue; |
| 283 | } |
| 284 | |
| 285 | break; |
| 286 | } |
| 287 | |
| 288 | if (!pdr) |
| 289 | { |
| 290 | return PLDM_PLATFORM_INVALID_EFFECTER_ID; |
| 291 | } |
| 292 | |
| 293 | if (effecterValueLength != effecterValueArrayLength) |
| 294 | { |
Riya Dixit | 49cfb13 | 2023-03-02 04:26:53 -0600 | [diff] [blame^] | 295 | error("effecter data size is incorrect."); |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 296 | return PLDM_ERROR_INVALID_DATA; |
| 297 | } |
| 298 | |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 299 | try |
| 300 | { |
George Liu | bd5e2ea | 2021-04-22 20:33:06 +0800 | [diff] [blame] | 301 | const auto& [dbusMappings, dbusValMaps] = |
| 302 | handler.getDbusObjMaps(effecterId); |
Brad Bishop | 5079ac4 | 2021-08-19 18:35:06 -0400 | [diff] [blame] | 303 | pldm::utils::DBusMapping dbusMapping{ |
George Liu | bd5e2ea | 2021-04-22 20:33:06 +0800 | [diff] [blame] | 304 | dbusMappings[0].objectPath, dbusMappings[0].interface, |
| 305 | dbusMappings[0].propertyName, dbusMappings[0].propertyType}; |
Pavithra Barithaya | 45cd16b | 2021-07-01 08:19:59 -0500 | [diff] [blame] | 306 | |
| 307 | // convert to dbus effectervalue according to the factor |
| 308 | auto [rc, dbusValue] = convertToDbusValue( |
| 309 | pdr, effecterDataSize, effecterValue, dbusMappings[0].propertyType); |
| 310 | if (rc != PLDM_SUCCESS) |
| 311 | { |
| 312 | return rc; |
| 313 | } |
George Liu | bd5e2ea | 2021-04-22 20:33:06 +0800 | [diff] [blame] | 314 | try |
| 315 | { |
George Liu | bd5e2ea | 2021-04-22 20:33:06 +0800 | [diff] [blame] | 316 | dBusIntf.setDbusProperty(dbusMapping, dbusValue.value()); |
| 317 | } |
| 318 | catch (const std::exception& e) |
| 319 | { |
Riya Dixit | 49cfb13 | 2023-03-02 04:26:53 -0600 | [diff] [blame^] | 320 | error( |
| 321 | "Error setting property, ERROR={ERR_EXCEP} PROPERTY={DBUS_PROP} INTERFACE={DBUS_INTF} PATH={DBUS_OBJ_PATH}", |
| 322 | "ERR_EXCEP", e.what(), "DBUS_PROP", dbusMapping.propertyName, |
| 323 | "DBUS_INTF", dbusMapping.interface, "DBUS_OBJ_PATH", |
| 324 | dbusMapping.objectPath.c_str()); |
George Liu | bd5e2ea | 2021-04-22 20:33:06 +0800 | [diff] [blame] | 325 | return PLDM_ERROR; |
| 326 | } |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 327 | } |
George Liu | bd5e2ea | 2021-04-22 20:33:06 +0800 | [diff] [blame] | 328 | catch (const std::out_of_range& e) |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 329 | { |
Riya Dixit | 49cfb13 | 2023-03-02 04:26:53 -0600 | [diff] [blame^] | 330 | error("Unknown effecter ID : {EFFECTER_ID} {ERR_EXCEP}", "EFFECTER_ID", |
| 331 | effecterId, "ERR_EXCEP", e.what()); |
George Liu | eccb0c5 | 2020-01-14 11:09:56 +0800 | [diff] [blame] | 332 | return PLDM_ERROR; |
| 333 | } |
| 334 | |
| 335 | return PLDM_SUCCESS; |
| 336 | } |
| 337 | |
| 338 | } // namespace platform_numeric_effecter |
| 339 | } // namespace responder |
| 340 | } // namespace pldm |