summaryrefslogtreecommitdiffstats
path: root/download_manager.hpp
blob: edafaab386bd32c291e8f65d55dae4ea88a5b10e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#pragma once

#include "xyz/openbmc_project/Common/TFTP/server.hpp"

#include <sdbusplus/bus.hpp>

namespace phosphor
{
namespace software
{
namespace manager
{

using DownloadInherit = sdbusplus::server::object::object<
    sdbusplus::xyz::openbmc_project::Common::server::TFTP>;

/** @class Download
 *  @brief OpenBMC download software management implementation.
 *  @details A concrete implementation for xyz.openbmc_project.Common.TFTP
 *  DBus API.
 */
class Download : public DownloadInherit
{
  public:
    /** @brief Constructs Download Software Manager
     *
     * @param[in] bus       - The Dbus bus object
     * @param[in] objPath   - The Dbus object path
     */
    Download(sdbusplus::bus::bus& bus, const std::string& objPath) :
        DownloadInherit(bus, (objPath).c_str()){};

    /**
     * @brief Download the specified image via TFTP
     *
     * @param[in] fileName      - The name of the file to transfer.
     * @param[in] serverAddress - The TFTP Server IP Address.
     **/
    void downloadViaTFTP(std::string fileName,
                         std::string serverAddress) override;
};

} // namespace manager
} // namespace software
} // namespace phosphor
OpenPOWER on IntegriCloud