blob: ae37be2e76d0fdcf939068c6a7184da60760b9f2 [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 -05009#include <iostream>
10
Pavithra Barithaya0f74c982020-04-27 02:17:10 -050011using namespace sdbusplus::xyz::openbmc_project::Common::Error;
12
13namespace pldm
14{
15namespace dbus_api
16{
17
18std::vector<std::vector<uint8_t>> Pdr::findStateEffecterPDR(uint8_t tid,
19 uint16_t entityID,
20 uint16_t stateSetId)
21{
22 auto pdrs =
23 pldm::utils::findStateEffecterPDR(tid, entityID, stateSetId, pdrRepo);
24
25 if (pdrs.empty())
26 {
27 throw ResourceNotFound();
28 }
29
30 return pdrs;
31}
Chicago Duan738e4d82020-05-28 16:39:19 +080032
33std::vector<std::vector<uint8_t>>
34 Pdr::findStateSensorPDR(uint8_t tid, uint16_t entityID, uint16_t stateSetId)
35{
36 auto pdrs =
37 pldm::utils::findStateSensorPDR(tid, entityID, stateSetId, pdrRepo);
38 if (pdrs.empty())
39 {
40 throw ResourceNotFound();
41 }
42 return pdrs;
43}
Pavithra Barithaya0f74c982020-04-27 02:17:10 -050044} // namespace dbus_api
45} // namespace pldm