Create Constructor for BMC Activation
- Create Activation Block Transition
- Create override functions so that actions can be taken
based on the value that the properties are being set to.
- Create ActivationBlockTransition when the Activating
property is set to Activating. Remove it when the property
is set to anything else.
Change-Id: Id48d049cca54ae0bcbed6afe41e67e20e6a5e44c
Signed-off-by: Saqib Khan <khansa@us.ibm.com>
diff --git a/activation.hpp b/activation.hpp
index 3b5e254..09183f1 100644
--- a/activation.hpp
+++ b/activation.hpp
@@ -1,7 +1,8 @@
#pragma once
-#include <sdbusplus/bus.hpp>
+#include <sdbusplus/server.hpp>
#include <xyz/openbmc_project/Software/Activation/server.hpp>
+#include <xyz/openbmc_project/Software/ActivationBlocksTransition/server.hpp>
namespace phosphor
{
@@ -12,6 +13,26 @@
using ActivationInherit = sdbusplus::server::object::object<
sdbusplus::xyz::openbmc_project::Software::server::Activation>;
+using ActivationBlocksTransitionInherit = sdbusplus::server::object::object<
+ sdbusplus::xyz::openbmc_project::Software::server::ActivationBlocksTransition>;
+
+/** @class ActivationBlocksTransition
+ * @brief OpenBMC ActivationBlocksTransition implementation.
+ * @details A concrete implementation for
+ * xyz.openbmc_project.Software.ActivationBlocksTransition DBus API.
+ */
+class ActivationBlocksTransition : public ActivationBlocksTransitionInherit
+{
+ public:
+ /** @brief Constructs ActivationBlocksTransition.
+ *
+ * @param[in] bus - The Dbus bus object
+ * @param[in] path - The Dbus object path
+ */
+ ActivationBlocksTransition(sdbusplus::bus::bus& bus,
+ const std::string& path) :
+ ActivationBlocksTransitionInherit(bus, path.c_str()) {}
+};
/** @class Activation
* @brief OpenBMC activation software management implementation.
@@ -43,6 +64,23 @@
emit_object_added();
}
+ /** @brief Overloaded Activation property setter function
+ *
+ * @param[in] value - One of Activation::Activations
+ *
+ * @return Success or exception thrown
+ */
+ Activations activation(Activations value) override;
+
+ /** @brief Overloaded requestedActivation property setter function
+ *
+ * @param[in] value - One of Activation::RequestedActivations
+ *
+ * @return Success or exception thrown
+ */
+ RequestedActivations requestedActivation(RequestedActivations value)
+ override;
+
/** @brief Persistent sdbusplus DBus bus connection */
sdbusplus::bus::bus& bus;
@@ -51,6 +89,9 @@
/** @brief Version id */
std::string versionId;
+
+ /** @brief Persistent ActivationBlocksTransition dbus object */
+ std::unique_ptr<ActivationBlocksTransition> activationBlocksTransition;
};
} // namespace updater