| P Arun Kumar Reddy | 6a3f990 | 2025-03-26 10:23:06 +0530 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <xyz/openbmc_project/Software/ApplyTime/server.hpp> |
| 4 | #include <xyz/openbmc_project/Software/Update/server.hpp> |
| 5 | |
| 6 | namespace pldm |
| 7 | { |
| 8 | |
| 9 | namespace fw_update |
| 10 | { |
| 11 | |
| 12 | class UpdateManager; |
| 13 | |
| 14 | using UpdateIntf = sdbusplus::server::object_t< |
| 15 | sdbusplus::xyz::openbmc_project::Software::server::Update>; |
| 16 | using 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 | */ |
| 24 | class 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 |