| 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> |
| Rajeev Ranjan | 11085f1 | 2025-08-29 20:58:29 +0530 | [diff] [blame^] | 4 | #include <xyz/openbmc_project/Software/MultipartUpdate/server.hpp> |
| P Arun Kumar Reddy | 6a3f990 | 2025-03-26 10:23:06 +0530 | [diff] [blame] | 5 | #include <xyz/openbmc_project/Software/Update/server.hpp> |
| 6 | |
| 7 | namespace pldm |
| 8 | { |
| 9 | |
| 10 | namespace fw_update |
| 11 | { |
| 12 | |
| 13 | class UpdateManager; |
| 14 | |
| 15 | using UpdateIntf = sdbusplus::server::object_t< |
| Rajeev Ranjan | 11085f1 | 2025-08-29 20:58:29 +0530 | [diff] [blame^] | 16 | sdbusplus::xyz::openbmc_project::Software::server::Update, |
| 17 | sdbusplus::xyz::openbmc_project::Software::server::MultipartUpdate>; |
| P Arun Kumar Reddy | 6a3f990 | 2025-03-26 10:23:06 +0530 | [diff] [blame] | 18 | using 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 | */ |
| 26 | class 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 Williams | 77435ba | 2025-10-23 02:36:11 -0400 | [diff] [blame] | 35 | Update(sdbusplus::bus_t& bus, const std::string& path, |
| P Arun Kumar Reddy | 6a3f990 | 2025-03-26 10:23:06 +0530 | [diff] [blame] | 36 | 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 |