blob: d39cf9fb5ac783cd42a89aeba6ecc9f815a0469d [file] [log] [blame]
Andrew Jefferyf106a2c2024-07-25 21:45:41 +09301#include "fw-update/activation.hpp"
2
3#include "fw-update/update_manager.hpp"
4
5namespace pldm
6{
7namespace fw_update
8{
9
10ActivationIntf::Activations
11 Activation::activation(ActivationIntf::Activations value)
12{
13 if (value == ActivationIntf::Activations::Activating)
14 {
15 deleteImpl.reset();
16 updateManager->activatePackage();
17 }
18 else if (value == ActivationIntf::Activations::Active ||
19 value == ActivationIntf::Activations::Failed)
20 {
21 if (!deleteImpl)
22 {
23 deleteImpl = std::make_unique<Delete>(bus, objPath, updateManager);
24 }
25 }
26
27 return ActivationIntf::activation(value);
28}
29
30void Delete::delete_()
31{
32 updateManager->clearActivationInfo();
33}
34} // namespace fw_update
35} // namespace pldm