blob: abafd964fafbad375b869692df5c22a1febfb217 [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
Patrick Williams366507c2025-02-03 14:28:01 -050010ActivationIntf::Activations Activation::activation(
11 ActivationIntf::Activations value)
Andrew Jefferyf106a2c2024-07-25 21:45:41 +093012{
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