blob: 307b7029d8d66f6a11751966676aae8d1f54c18b [file] [log] [blame]
P Arun Kumar Reddy6a3f9902025-03-26 10:23:06 +05301#pragma once
2
3#include <xyz/openbmc_project/Software/ApplyTime/server.hpp>
4#include <xyz/openbmc_project/Software/Update/server.hpp>
5
6namespace pldm
7{
8
9namespace fw_update
10{
11
12class UpdateManager;
13
14using UpdateIntf = sdbusplus::server::object_t<
15 sdbusplus::xyz::openbmc_project::Software::server::Update>;
16using ApplyTimeIntf =
17 sdbusplus::xyz::openbmc_project::Software::server::ApplyTime;
18
19/** @class Update
20 *
21 * Concrete implementation of xyz.openbmc_project.Software.Update D-Bus
22 * interface
23 */
24class Update : public UpdateIntf
25{
26 public:
27 /** @brief Constructor
28 *
29 * @param[in] bus - Bus to attach to
30 * @param[in] objPath - D-Bus object path
31 * @param[in] updateManager - Reference to FW update manager
32 */
33 Update(sdbusplus::bus::bus& bus, const std::string& path,
34 UpdateManager* updateManager) :
35 UpdateIntf(bus, path.c_str()), updateManager(updateManager),
36 objPath(path)
37 {}
38
39 virtual sdbusplus::message::object_path startUpdate(
40 sdbusplus::message::unix_fd image,
41 ApplyTimeIntf::RequestedApplyTimes applyTime) override;
42
43 ~Update() noexcept override = default;
44
45 private:
46 UpdateManager* updateManager;
47 const std::string objPath;
48 std::stringstream imageStream;
49};
50
51} // namespace fw_update
52
53} // namespace pldm