Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <sdbusplus/bus.hpp> |
| 4 | #include <xyz/openbmc_project/Software/Activation/server.hpp> |
| 5 | |
| 6 | namespace phosphor |
| 7 | { |
| 8 | namespace software |
| 9 | { |
| 10 | namespace updater |
| 11 | { |
| 12 | |
| 13 | using ActivationInherit = sdbusplus::server::object::object< |
| 14 | sdbusplus::xyz::openbmc_project::Software::server::Activation>; |
| 15 | |
| 16 | /** @class Activation |
| 17 | * @brief OpenBMC activation software management implementation. |
| 18 | * @details A concrete implementation for |
| 19 | * xyz.openbmc_project.Software.Activation DBus API. |
| 20 | */ |
| 21 | class Activation : public ActivationInherit |
| 22 | { |
| 23 | public: |
| 24 | /** @brief Constructs Activation Software Manager |
| 25 | * |
| 26 | * @param[in] bus - The Dbus bus object |
| 27 | * @param[in] path - The Dbus object path |
Gunnar Mills | 2ce7da2 | 2017-05-04 15:37:56 -0500 | [diff] [blame] | 28 | * @param[in] versionId - The software version id |
| 29 | * @param[in] activationStatus - The status of Activation |
Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 30 | */ |
Gunnar Mills | 2ce7da2 | 2017-05-04 15:37:56 -0500 | [diff] [blame] | 31 | Activation(sdbusplus::bus::bus& bus, const std::string& path, |
| 32 | std::string& versionId, |
| 33 | sdbusplus::xyz::openbmc_project::Software:: |
| 34 | server::Activation::Activations activationStatus) : |
| 35 | ActivationInherit(bus, path.c_str(), true), |
| 36 | bus(bus), |
| 37 | path(path), |
| 38 | versionId(versionId) |
| 39 | { |
| 40 | // Set Properties. |
| 41 | activation(activationStatus); |
| 42 | // Emit deferred signal. |
| 43 | emit_object_added(); |
| 44 | } |
| 45 | |
| 46 | /** @brief Persistent sdbusplus DBus bus connection */ |
| 47 | sdbusplus::bus::bus& bus; |
| 48 | |
| 49 | /** @brief Persistent DBus object path */ |
| 50 | std::string path; |
| 51 | |
| 52 | /** @brief Version id */ |
| 53 | std::string versionId; |
Gunnar Mills | ec1b41c | 2017-05-02 12:20:36 -0500 | [diff] [blame] | 54 | }; |
| 55 | |
| 56 | } // namespace updater |
| 57 | } // namespace software |
| 58 | } // namespace phosphor |