Pavithra Barithaya | 0f74c98 | 2020-04-27 02:17:10 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "xyz/openbmc_project/PLDM/PDR/server.hpp" |
| 4 | |
| 5 | #include <sdbusplus/bus.hpp> |
| 6 | #include <sdbusplus/server/object.hpp> |
| 7 | #include <vector> |
| 8 | |
| 9 | #include "libpldm/pdr.h" |
| 10 | #include "libpldm/platform.h" |
| 11 | |
| 12 | namespace pldm |
| 13 | { |
| 14 | namespace dbus_api |
| 15 | { |
| 16 | |
| 17 | using PdrIntf = sdbusplus::server::object::object< |
| 18 | sdbusplus::xyz::openbmc_project::PLDM::server::PDR>; |
| 19 | |
| 20 | /** @class Pdr |
| 21 | * @brief OpenBMC PLDM.PDR Implementation |
| 22 | * @details A concrete implementation for the |
| 23 | * xyz.openbmc_project.PLDM.PDR DBus APIs. |
| 24 | */ |
| 25 | class Pdr : public PdrIntf |
| 26 | { |
| 27 | public: |
| 28 | Pdr() = delete; |
| 29 | Pdr(const Pdr&) = delete; |
| 30 | Pdr& operator=(const Pdr&) = delete; |
| 31 | Pdr(Pdr&&) = delete; |
| 32 | Pdr& operator=(Pdr&&) = delete; |
| 33 | virtual ~Pdr() = default; |
| 34 | |
| 35 | /** @brief Constructor to put object onto bus at a dbus path. |
| 36 | * @param[in] bus - Bus to attach to. |
| 37 | * @param[in] path - Path to attach at. |
| 38 | * @param[in] repo - pointer to BMC's primary PDR repo |
| 39 | */ |
| 40 | Pdr(sdbusplus::bus::bus& bus, const std::string& path, |
| 41 | const pldm_pdr* repo) : |
| 42 | PdrIntf(bus, path.c_str(), repo), |
| 43 | pdrRepo(repo){}; |
| 44 | |
| 45 | /** @brief Implementation for PdrIntf.FindStateEffecterPDR |
| 46 | * @param[in] tid - PLDM terminus ID. |
| 47 | * @param[in] entityID - entity that can be associated with PLDM State set. |
| 48 | * @param[in] stateSetId - value that identifies PLDM State set. |
| 49 | */ |
| 50 | std::vector<std::vector<uint8_t>> |
| 51 | findStateEffecterPDR(uint8_t tid, uint16_t entityID, |
| 52 | uint16_t stateSetId) override; |
| 53 | |
Deepak Kodihalli | faf096f | 2020-06-04 12:17:47 -0500 | [diff] [blame] | 54 | /** @brief Implementation for PdrIntf.FindStateSensorPDR |
| 55 | * @param[in] tid - PLDM terminus ID. |
| 56 | * @param[in] entityID - entity that can be associated with PLDM State set. |
| 57 | * @param[in] stateSetId - value that identifies PLDM State set. |
| 58 | */ |
| 59 | std::vector<std::vector<uint8_t>> |
Deepak Kodihalli | 5c63407 | 2020-06-04 12:47:21 -0500 | [diff] [blame] | 60 | findStateSensorPDR(uint8_t /*tid*/, uint16_t /*entityID*/, |
John Wang | d6631b4 | 2020-06-05 15:03:30 +0800 | [diff] [blame^] | 61 | uint16_t /*stateSetId*/) override |
Deepak Kodihalli | faf096f | 2020-06-04 12:17:47 -0500 | [diff] [blame] | 62 | { |
| 63 | return {}; |
| 64 | } |
| 65 | |
Pavithra Barithaya | 0f74c98 | 2020-04-27 02:17:10 -0500 | [diff] [blame] | 66 | private: |
| 67 | /** @brief pointer to BMC's primary PDR repo */ |
| 68 | const pldm_pdr* pdrRepo; |
| 69 | }; |
| 70 | |
| 71 | } // namespace dbus_api |
| 72 | } // namespace pldm |