blob: f7d67fb9a1107e886a34b2e994b43e2377f1ffa8 [file] [log] [blame]
Pavithra Barithaya319ebb32021-05-06 06:09:11 -05001#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
9namespace pldm
10{
11namespace dbus_api
12{
13
Patrick Williams84b790c2022-07-22 19:26:56 -050014using HostIntf = sdbusplus::server::object_t<
Pavithra Barithaya319ebb32021-05-06 06:09:11 -050015 sdbusplus::xyz::openbmc_project::Condition::server::HostFirmware>;
16
17class 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 Williams84b790c2022-07-22 19:26:56 -050027 Host(sdbusplus::bus_t& bus, const std::string& path) :
Pavithra Barithaya319ebb32021-05-06 06:09:11 -050028 HostIntf(bus, path.c_str()){};
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