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 | |
George Liu | c453e16 | 2022-12-21 17:16:23 +0800 | [diff] [blame] | 5 | #include <libpldm/pdr.h> |
| 6 | #include <libpldm/platform.h> |
| 7 | |
Pavithra Barithaya | 0f74c98 | 2020-04-27 02:17:10 -0500 | [diff] [blame] | 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 | |
Patrick Williams | 84b790c | 2022-07-22 19:26:56 -0500 | [diff] [blame] | 18 | using PdrIntf = sdbusplus::server::object_t< |
Pavithra Barithaya | 0f74c98 | 2020-04-27 02:17:10 -0500 | [diff] [blame] | 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 | */ |
Patrick Williams | 84b790c | 2022-07-22 19:26:56 -0500 | [diff] [blame] | 41 | Pdr(sdbusplus::bus_t& bus, const std::string& path, const pldm_pdr* repo) : |
Patrick Williams | 16c2a0a | 2024-08-16 15:20:59 -0400 | [diff] [blame] | 42 | PdrIntf(bus, path.c_str()), pdrRepo(repo) {}; |
Pavithra Barithaya | 0f74c98 | 2020-04-27 02:17:10 -0500 | [diff] [blame] | 43 | |
| 44 | /** @brief Implementation for PdrIntf.FindStateEffecterPDR |
| 45 | * @param[in] tid - PLDM terminus ID. |
| 46 | * @param[in] entityID - entity that can be associated with PLDM State set. |
| 47 | * @param[in] stateSetId - value that identifies PLDM State set. |
| 48 | */ |
Patrick Williams | 16c2a0a | 2024-08-16 15:20:59 -0400 | [diff] [blame] | 49 | std::vector<std::vector<uint8_t>> findStateEffecterPDR( |
| 50 | uint8_t tid, uint16_t entityID, uint16_t stateSetId) override; |
Pavithra Barithaya | 0f74c98 | 2020-04-27 02:17:10 -0500 | [diff] [blame] | 51 | |
Deepak Kodihalli | faf096f | 2020-06-04 12:17:47 -0500 | [diff] [blame] | 52 | /** @brief Implementation for PdrIntf.FindStateSensorPDR |
| 53 | * @param[in] tid - PLDM terminus ID. |
| 54 | * @param[in] entityID - entity that can be associated with PLDM State set. |
| 55 | * @param[in] stateSetId - value that identifies PLDM State set. |
| 56 | */ |
Patrick Williams | 16c2a0a | 2024-08-16 15:20:59 -0400 | [diff] [blame] | 57 | std::vector<std::vector<uint8_t>> findStateSensorPDR( |
| 58 | uint8_t tid, uint16_t entityID, uint16_t stateSetId) override; |
Deepak Kodihalli | faf096f | 2020-06-04 12:17:47 -0500 | [diff] [blame] | 59 | |
Pavithra Barithaya | 0f74c98 | 2020-04-27 02:17:10 -0500 | [diff] [blame] | 60 | private: |
| 61 | /** @brief pointer to BMC's primary PDR repo */ |
| 62 | const pldm_pdr* pdrRepo; |
| 63 | }; |
| 64 | |
| 65 | } // namespace dbus_api |
| 66 | } // namespace pldm |