blob: d39cf9fb5ac783cd42a89aeba6ecc9f815a0469d [file] [log] [blame]
#include "fw-update/activation.hpp"
#include "fw-update/update_manager.hpp"
namespace pldm
{
namespace fw_update
{
ActivationIntf::Activations
Activation::activation(ActivationIntf::Activations value)
{
if (value == ActivationIntf::Activations::Activating)
{
deleteImpl.reset();
updateManager->activatePackage();
}
else if (value == ActivationIntf::Activations::Active ||
value == ActivationIntf::Activations::Failed)
{
if (!deleteImpl)
{
deleteImpl = std::make_unique<Delete>(bus, objPath, updateManager);
}
}
return ActivationIntf::activation(value);
}
void Delete::delete_()
{
updateManager->clearActivationInfo();
}
} // namespace fw_update
} // namespace pldm