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 | using namespace sdbusplus::xyz::openbmc_project::Common::Error; |
| 10 | |
| 11 | namespace pldm |
| 12 | { |
| 13 | namespace dbus_api |
| 14 | { |
| 15 | |
Patrick Williams | 16c2a0a | 2024-08-16 15:20:59 -0400 | [diff] [blame] | 16 | std::vector<std::vector<uint8_t>> Pdr::findStateEffecterPDR( |
| 17 | uint8_t tid, uint16_t entityID, uint16_t stateSetId) |
Pavithra Barithaya | 0f74c98 | 2020-04-27 02:17:10 -0500 | [diff] [blame] | 18 | { |
Patrick Williams | 16c2a0a | 2024-08-16 15:20:59 -0400 | [diff] [blame] | 19 | auto pdrs = |
| 20 | pldm::utils::findStateEffecterPDR(tid, entityID, stateSetId, pdrRepo); |
Pavithra Barithaya | 0f74c98 | 2020-04-27 02:17:10 -0500 | [diff] [blame] | 21 | |
| 22 | if (pdrs.empty()) |
| 23 | { |
| 24 | throw ResourceNotFound(); |
| 25 | } |
| 26 | |
| 27 | return pdrs; |
| 28 | } |
Chicago Duan | 738e4d8 | 2020-05-28 16:39:19 +0800 | [diff] [blame] | 29 | |
| 30 | std::vector<std::vector<uint8_t>> |
| 31 | Pdr::findStateSensorPDR(uint8_t tid, uint16_t entityID, uint16_t stateSetId) |
| 32 | { |
Patrick Williams | 16c2a0a | 2024-08-16 15:20:59 -0400 | [diff] [blame] | 33 | auto pdrs = |
| 34 | pldm::utils::findStateSensorPDR(tid, entityID, stateSetId, pdrRepo); |
Chicago Duan | 738e4d8 | 2020-05-28 16:39:19 +0800 | [diff] [blame] | 35 | if (pdrs.empty()) |
| 36 | { |
| 37 | throw ResourceNotFound(); |
| 38 | } |
| 39 | return pdrs; |
| 40 | } |
Pavithra Barithaya | 0f74c98 | 2020-04-27 02:17:10 -0500 | [diff] [blame] | 41 | } // namespace dbus_api |
| 42 | } // namespace pldm |