Pavithra Barithaya | 319ebb3 | 2021-05-06 06:09:11 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "host-bmc/host_pdr_handler.hpp" |
| 4 | |
| 5 | #include <sdbusplus/bus.hpp> |
| 6 | #include <sdbusplus/server/object.hpp> |
| 7 | #include <xyz/openbmc_project/Condition/HostFirmware/server.hpp> |
| 8 | |
| 9 | namespace pldm |
| 10 | { |
| 11 | namespace dbus_api |
| 12 | { |
| 13 | |
Patrick Williams | 84b790c | 2022-07-22 19:26:56 -0500 | [diff] [blame] | 14 | using HostIntf = sdbusplus::server::object_t< |
Pavithra Barithaya | 319ebb3 | 2021-05-06 06:09:11 -0500 | [diff] [blame] | 15 | sdbusplus::xyz::openbmc_project::Condition::server::HostFirmware>; |
| 16 | |
| 17 | class Host : public HostIntf |
| 18 | { |
| 19 | public: |
| 20 | Host() = delete; |
| 21 | Host(const Host&) = delete; |
| 22 | Host& operator=(const Host&) = delete; |
| 23 | Host(Host&&) = delete; |
| 24 | Host& operator=(Host&&) = delete; |
| 25 | virtual ~Host() = default; |
| 26 | |
Patrick Williams | 84b790c | 2022-07-22 19:26:56 -0500 | [diff] [blame] | 27 | Host(sdbusplus::bus_t& bus, const std::string& path) : |
Patrick Williams | 16c2a0a | 2024-08-16 15:20:59 -0400 | [diff] [blame] | 28 | HostIntf(bus, path.c_str()) {}; |
Pavithra Barithaya | 319ebb3 | 2021-05-06 06:09:11 -0500 | [diff] [blame] | 29 | |
| 30 | /** @brief Override reads to CurrentFirmwareCondition */ |
| 31 | FirmwareCondition currentFirmwareCondition() const override; |
| 32 | |
| 33 | /** @brief Store shared pointer to host PDR instance */ |
| 34 | void setHostPdrObj(std::shared_ptr<HostPDRHandler> obj) |
| 35 | { |
| 36 | hostPdrObj = obj; |
| 37 | } |
| 38 | |
| 39 | private: |
| 40 | std::shared_ptr<HostPDRHandler> hostPdrObj; |
| 41 | }; |
| 42 | } // namespace dbus_api |
| 43 | } // namespace pldm |