Pavithra Barithaya | 0f74c98 | 2020-04-27 02:17:10 -0500 | [diff] [blame] | 1 | #include "dbus_impl_pdr.hpp" |
| 2 | |
Deepak Kodihalli | d130e1a | 2020-06-17 05:55:32 -0500 | [diff] [blame] | 3 | #include "common/utils.hpp" |
Pavithra Barithaya | 0f74c98 | 2020-04-27 02:17:10 -0500 | [diff] [blame] | 4 | #include "xyz/openbmc_project/Common/error.hpp" |
| 5 | |
George Liu | c453e16 | 2022-12-21 17:16:23 +0800 | [diff] [blame] | 6 | #include <libpldm/pdr.h> |
| 7 | #include <libpldm/pldm_types.h> |
| 8 | |
Pavithra Barithaya | 0f74c98 | 2020-04-27 02:17:10 -0500 | [diff] [blame] | 9 | #include <iostream> |
| 10 | |
Pavithra Barithaya | 0f74c98 | 2020-04-27 02:17:10 -0500 | [diff] [blame] | 11 | using namespace sdbusplus::xyz::openbmc_project::Common::Error; |
| 12 | |
| 13 | namespace pldm |
| 14 | { |
| 15 | namespace dbus_api |
| 16 | { |
| 17 | |
| 18 | std::vector<std::vector<uint8_t>> Pdr::findStateEffecterPDR(uint8_t tid, |
| 19 | uint16_t entityID, |
| 20 | uint16_t stateSetId) |
| 21 | { |
Patrick Williams | 6da4f91 | 2023-05-10 07:50:53 -0500 | [diff] [blame] | 22 | auto pdrs = pldm::utils::findStateEffecterPDR(tid, entityID, stateSetId, |
| 23 | pdrRepo); |
Pavithra Barithaya | 0f74c98 | 2020-04-27 02:17:10 -0500 | [diff] [blame] | 24 | |
| 25 | if (pdrs.empty()) |
| 26 | { |
| 27 | throw ResourceNotFound(); |
| 28 | } |
| 29 | |
| 30 | return pdrs; |
| 31 | } |
Chicago Duan | 738e4d8 | 2020-05-28 16:39:19 +0800 | [diff] [blame] | 32 | |
| 33 | std::vector<std::vector<uint8_t>> |
| 34 | Pdr::findStateSensorPDR(uint8_t tid, uint16_t entityID, uint16_t stateSetId) |
| 35 | { |
Patrick Williams | 6da4f91 | 2023-05-10 07:50:53 -0500 | [diff] [blame] | 36 | auto pdrs = pldm::utils::findStateSensorPDR(tid, entityID, stateSetId, |
| 37 | pdrRepo); |
Chicago Duan | 738e4d8 | 2020-05-28 16:39:19 +0800 | [diff] [blame] | 38 | if (pdrs.empty()) |
| 39 | { |
| 40 | throw ResourceNotFound(); |
| 41 | } |
| 42 | return pdrs; |
| 43 | } |
Pavithra Barithaya | 0f74c98 | 2020-04-27 02:17:10 -0500 | [diff] [blame] | 44 | } // namespace dbus_api |
| 45 | } // namespace pldm |