Create activation interface on BMC version dbus creation
Create an activation interface on BMC version dbus creation.
For now, set all versions with a purpose of "BMC" to Active.
Resolves openbmc/openbmc#1532
Change-Id: Ia253c5744bf7808191f2f1814734dab426edc1a5
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/activation.hpp b/activation.hpp
index 99ac986..3b5e254 100644
--- a/activation.hpp
+++ b/activation.hpp
@@ -25,9 +25,32 @@
*
* @param[in] bus - The Dbus bus object
* @param[in] path - The Dbus object path
+ * @param[in] versionId - The software version id
+ * @param[in] activationStatus - The status of Activation
*/
- Activation(sdbusplus::bus::bus& bus, const std::string& path) :
- ActivationInherit(bus, path.c_str()) {};
+ Activation(sdbusplus::bus::bus& bus, const std::string& path,
+ std::string& versionId,
+ sdbusplus::xyz::openbmc_project::Software::
+ server::Activation::Activations activationStatus) :
+ ActivationInherit(bus, path.c_str(), true),
+ bus(bus),
+ path(path),
+ versionId(versionId)
+ {
+ // Set Properties.
+ activation(activationStatus);
+ // Emit deferred signal.
+ emit_object_added();
+ }
+
+ /** @brief Persistent sdbusplus DBus bus connection */
+ sdbusplus::bus::bus& bus;
+
+ /** @brief Persistent DBus object path */
+ std::string path;
+
+ /** @brief Version id */
+ std::string versionId;
};
} // namespace updater