blob: 231f64dbd603d01a6f59f20a051da904bc17cde6 [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
16std::vector<std::vector<uint8_t>> Pdr::findStateEffecterPDR(uint8_t tid,
17 uint16_t entityID,
18 uint16_t stateSetId)
19{
Patrick Williams6da4f912023-05-10 07:50:53 -050020 auto pdrs = pldm::utils::findStateEffecterPDR(tid, entityID, stateSetId,
21 pdrRepo);
Pavithra Barithaya0f74c982020-04-27 02:17:10 -050022
23 if (pdrs.empty())
24 {
25 throw ResourceNotFound();
26 }
27
28 return pdrs;
29}
Chicago Duan738e4d82020-05-28 16:39:19 +080030
31std::vector<std::vector<uint8_t>>
32 Pdr::findStateSensorPDR(uint8_t tid, uint16_t entityID, uint16_t stateSetId)
33{
Patrick Williams6da4f912023-05-10 07:50:53 -050034 auto pdrs = pldm::utils::findStateSensorPDR(tid, entityID, stateSetId,
35 pdrRepo);
Chicago Duan738e4d82020-05-28 16:39:19 +080036 if (pdrs.empty())
37 {
38 throw ResourceNotFound();
39 }
40 return pdrs;
41}
Pavithra Barithaya0f74c982020-04-27 02:17:10 -050042} // namespace dbus_api
43} // namespace pldm