Gunnar Mills | 701e021 | 2017-04-03 11:21:27 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Gunnar Mills | 701e021 | 2017-04-03 11:21:27 -0500 | [diff] [blame] | 3 | #include "xyz/openbmc_project/Common/TFTP/server.hpp" |
| 4 | |
Gunnar Mills | b0ce996 | 2018-09-07 13:39:10 -0500 | [diff] [blame] | 5 | #include <sdbusplus/bus.hpp> |
Adriana Kobylak | 58aa750 | 2020-06-08 11:12:11 -0500 | [diff] [blame] | 6 | |
Andrew Geissler | 9155b71 | 2020-05-16 13:04:44 -0500 | [diff] [blame] | 7 | #include <string> |
Gunnar Mills | b0ce996 | 2018-09-07 13:39:10 -0500 | [diff] [blame] | 8 | |
Gunnar Mills | 701e021 | 2017-04-03 11:21:27 -0500 | [diff] [blame] | 9 | namespace phosphor |
| 10 | { |
| 11 | namespace software |
| 12 | { |
| 13 | namespace manager |
| 14 | { |
| 15 | |
Patrick Williams | bf2bb2b | 2022-07-22 19:26:52 -0500 | [diff] [blame] | 16 | using DownloadInherit = sdbusplus::server::object_t< |
Patrick Williams | 1e9a5f1 | 2023-08-23 16:53:06 -0500 | [diff] [blame] | 17 | sdbusplus::server::xyz::openbmc_project::common::TFTP>; |
Gunnar Mills | 701e021 | 2017-04-03 11:21:27 -0500 | [diff] [blame] | 18 | |
| 19 | /** @class Download |
| 20 | * @brief OpenBMC download software management implementation. |
| 21 | * @details A concrete implementation for xyz.openbmc_project.Common.TFTP |
| 22 | * DBus API. |
| 23 | */ |
| 24 | class Download : public DownloadInherit |
| 25 | { |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 26 | public: |
| 27 | /** @brief Constructs Download Software Manager |
| 28 | * |
| 29 | * @param[in] bus - The Dbus bus object |
| 30 | * @param[in] objPath - The Dbus object path |
| 31 | */ |
Patrick Williams | bf2bb2b | 2022-07-22 19:26:52 -0500 | [diff] [blame] | 32 | Download(sdbusplus::bus_t& bus, const std::string& objPath) : |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 33 | DownloadInherit(bus, (objPath).c_str()){}; |
Gunnar Mills | 701e021 | 2017-04-03 11:21:27 -0500 | [diff] [blame] | 34 | |
Adriana Kobylak | 2285fe0 | 2018-02-27 15:36:59 -0600 | [diff] [blame] | 35 | /** |
| 36 | * @brief Download the specified image via TFTP |
| 37 | * |
| 38 | * @param[in] fileName - The name of the file to transfer. |
| 39 | * @param[in] serverAddress - The TFTP Server IP Address. |
| 40 | **/ |
| 41 | void downloadViaTFTP(std::string fileName, |
| 42 | std::string serverAddress) override; |
Gunnar Mills | 701e021 | 2017-04-03 11:21:27 -0500 | [diff] [blame] | 43 | }; |
| 44 | |
| 45 | } // namespace manager |
| 46 | } // namespace software |
| 47 | } // namespace phosphor |