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