summaryrefslogtreecommitdiffstats
path: root/group.cpp
blob: fda5982f9c9dcc0a320f2c9bd5886f9098ab140e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <sdbusplus/message.hpp>
#include "group.hpp"
namespace phosphor
{
namespace led
{

/** @brief Overloaded Property Setter function */
bool Group::asserted(bool value)
{
    // Introducing these to enable gtest.
    Manager::group ledsAssert {};
    Manager::group ledsDeAssert {};
    Manager::group ledsUpdate {};

    // Group management is handled by Manager. The populated leds* sets are not
    // really used by production code. They are there to enable gtest for
    // validation.
    auto result = manager.setGroupState(path, value, ledsAssert,
                                        ledsDeAssert, ledsUpdate);

    // If something does not go right here, then there should be an sdbusplus
    // exception thrown.
    manager.driveLEDs(ledsAssert, ledsDeAssert, ledsUpdate);

    // Set the base class's asserted to 'true' since the getter
    // operation is handled there.
    return sdbusplus::xyz::openbmc_project::Led::server::
                      Group::asserted(result);
}

} // namespace led
} // namespace phosphor
OpenPOWER on IntegriCloud