1*9b21efc5SLei YU #pragma once
2*9b21efc5SLei YU 
3*9b21efc5SLei YU #include "activation.hpp"
4*9b21efc5SLei YU 
5*9b21efc5SLei YU namespace openpower
6*9b21efc5SLei YU {
7*9b21efc5SLei YU namespace software
8*9b21efc5SLei YU {
9*9b21efc5SLei YU namespace updater
10*9b21efc5SLei YU {
11*9b21efc5SLei YU 
12*9b21efc5SLei YU class RedundancyPriorityUbi : public RedundancyPriority
13*9b21efc5SLei YU {
14*9b21efc5SLei YU   public:
15*9b21efc5SLei YU     using RedundancyPriority::RedundancyPriority;
16*9b21efc5SLei YU     virtual ~RedundancyPriorityUbi() = default;
17*9b21efc5SLei YU 
18*9b21efc5SLei YU     /** @brief Overloaded Priority property set function
19*9b21efc5SLei YU      *
20*9b21efc5SLei YU      *  @param[in] value - uint8_t
21*9b21efc5SLei YU      *
22*9b21efc5SLei YU      *  @return Success or exception thrown
23*9b21efc5SLei YU      */
24*9b21efc5SLei YU     uint8_t priority(uint8_t value) override;
25*9b21efc5SLei YU };
26*9b21efc5SLei YU 
27*9b21efc5SLei YU /** @class ActivationUbi
28*9b21efc5SLei YU  *  @brief OpenBMC activation software management implementation.
29*9b21efc5SLei YU  *  @details A concrete implementation for
30*9b21efc5SLei YU  *  xyz.openbmc_project.Software.Activation DBus API.
31*9b21efc5SLei YU  */
32*9b21efc5SLei YU class ActivationUbi : public Activation
33*9b21efc5SLei YU {
34*9b21efc5SLei YU   public:
35*9b21efc5SLei YU     using Activation::Activation;
36*9b21efc5SLei YU     virtual ~ActivationUbi() = default;
37*9b21efc5SLei YU 
38*9b21efc5SLei YU     /** @brief Overloaded Activation property setter function
39*9b21efc5SLei YU      *
40*9b21efc5SLei YU      *  @param[in] value - One of Activation::Activations
41*9b21efc5SLei YU      *
42*9b21efc5SLei YU      *  @return Success or exception thrown
43*9b21efc5SLei YU      */
44*9b21efc5SLei YU     Activations activation(Activations value) override;
45*9b21efc5SLei YU 
46*9b21efc5SLei YU     RequestedActivations
47*9b21efc5SLei YU         requestedActivation(RequestedActivations value) override;
48*9b21efc5SLei YU 
49*9b21efc5SLei YU   private:
50*9b21efc5SLei YU     /** @brief Tracks whether the read-only & read-write volumes have been
51*9b21efc5SLei YU      *created as part of the activation process. **/
52*9b21efc5SLei YU     bool ubiVolumesCreated = false;
53*9b21efc5SLei YU 
54*9b21efc5SLei YU     void unitStateChange(sdbusplus::message::message& msg) override;
55*9b21efc5SLei YU     void startActivation() override;
56*9b21efc5SLei YU     void finishActivation() override;
57*9b21efc5SLei YU };
58*9b21efc5SLei YU 
59*9b21efc5SLei YU } // namespace updater
60*9b21efc5SLei YU } // namespace software
61*9b21efc5SLei YU } // namespace openpower
62