blob: e01249f4f909d49a7cb66d7f619d82860aee57f1 [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>
Rajeev Ranjan11085f12025-08-29 20:58:29 +05304#include <xyz/openbmc_project/Software/MultipartUpdate/server.hpp>
P Arun Kumar Reddy6a3f9902025-03-26 10:23:06 +05305#include <xyz/openbmc_project/Software/Update/server.hpp>
6
7namespace pldm
8{
9
10namespace fw_update
11{
12
13class UpdateManager;
14
15using UpdateIntf = sdbusplus::server::object_t<
Rajeev Ranjan11085f12025-08-29 20:58:29 +053016 sdbusplus::xyz::openbmc_project::Software::server::Update,
17 sdbusplus::xyz::openbmc_project::Software::server::MultipartUpdate>;
P Arun Kumar Reddy6a3f9902025-03-26 10:23:06 +053018using ApplyTimeIntf =
19 sdbusplus::xyz::openbmc_project::Software::server::ApplyTime;
20
21/** @class Update
22 *
23 * Concrete implementation of xyz.openbmc_project.Software.Update D-Bus
24 * interface
25 */
26class Update : public UpdateIntf
27{
28 public:
29 /** @brief Constructor
30 *
31 * @param[in] bus - Bus to attach to
32 * @param[in] objPath - D-Bus object path
33 * @param[in] updateManager - Reference to FW update manager
34 */
Patrick Williams77435ba2025-10-23 02:36:11 -040035 Update(sdbusplus::bus_t& bus, const std::string& path,
P Arun Kumar Reddy6a3f9902025-03-26 10:23:06 +053036 UpdateManager* updateManager) :
37 UpdateIntf(bus, path.c_str()), updateManager(updateManager),
38 objPath(path)
39 {}
40
41 virtual sdbusplus::message::object_path startUpdate(
42 sdbusplus::message::unix_fd image,
43 ApplyTimeIntf::RequestedApplyTimes applyTime) override;
44
45 ~Update() noexcept override = default;
46
47 private:
48 UpdateManager* updateManager;
49 const std::string objPath;
50 std::stringstream imageStream;
51};
52
53} // namespace fw_update
54
55} // namespace pldm