blob: ac39d9d16cceddd3ca68df4e22a775528097a271 [file] [log] [blame]
Pavithra Barithaya0f74c982020-04-27 02:17:10 -05001#include "dbus_impl_pdr.hpp"
2
Deepak Kodihallid130e1a2020-06-17 05:55:32 -05003#include "common/utils.hpp"
Pavithra Barithaya0f74c982020-04-27 02:17:10 -05004#include "xyz/openbmc_project/Common/error.hpp"
5
George Liuc453e162022-12-21 17:16:23 +08006#include <libpldm/pdr.h>
7#include <libpldm/pldm_types.h>
8
Pavithra Barithaya0f74c982020-04-27 02:17:10 -05009using namespace sdbusplus::xyz::openbmc_project::Common::Error;
10
11namespace pldm
12{
13namespace dbus_api
14{
15
Patrick Williams16c2a0a2024-08-16 15:20:59 -040016std::vector<std::vector<uint8_t>> Pdr::findStateEffecterPDR(
17 uint8_t tid, uint16_t entityID, uint16_t stateSetId)
Pavithra Barithaya0f74c982020-04-27 02:17:10 -050018{
Patrick Williams16c2a0a2024-08-16 15:20:59 -040019 auto pdrs =
20 pldm::utils::findStateEffecterPDR(tid, entityID, stateSetId, pdrRepo);
Pavithra Barithaya0f74c982020-04-27 02:17:10 -050021
22 if (pdrs.empty())
23 {
24 throw ResourceNotFound();
25 }
26
27 return pdrs;
28}
Chicago Duan738e4d82020-05-28 16:39:19 +080029
30std::vector<std::vector<uint8_t>>
31 Pdr::findStateSensorPDR(uint8_t tid, uint16_t entityID, uint16_t stateSetId)
32{
Patrick Williams16c2a0a2024-08-16 15:20:59 -040033 auto pdrs =
34 pldm::utils::findStateSensorPDR(tid, entityID, stateSetId, pdrRepo);
Chicago Duan738e4d82020-05-28 16:39:19 +080035 if (pdrs.empty())
36 {
37 throw ResourceNotFound();
38 }
39 return pdrs;
40}
Pavithra Barithaya0f74c982020-04-27 02:17:10 -050041} // namespace dbus_api
42} // namespace pldm