blob: fda5982f9c9dcc0a320f2c9bd5886f9098ab140e [file] [log] [blame]
Vishwanatha Subbanna4c8c72b2016-11-29 23:02:06 +05301#include <sdbusplus/message.hpp>
2#include "group.hpp"
3namespace phosphor
4{
5namespace led
6{
7
8/** @brief Overloaded Property Setter function */
9bool Group::asserted(bool value)
10{
Vishwanatha Subbannaed490732016-12-20 15:59:29 +053011 // Introducing these to enable gtest.
12 Manager::group ledsAssert {};
13 Manager::group ledsDeAssert {};
14 Manager::group ledsUpdate {};
15
16 // Group management is handled by Manager. The populated leds* sets are not
17 // really used by production code. They are there to enable gtest for
18 // validation.
19 auto result = manager.setGroupState(path, value, ledsAssert,
20 ledsDeAssert, ledsUpdate);
21
22 // If something does not go right here, then there should be an sdbusplus
23 // exception thrown.
24 manager.driveLEDs(ledsAssert, ledsDeAssert, ledsUpdate);
Vishwanatha Subbanna4c8c72b2016-11-29 23:02:06 +053025
26 // Set the base class's asserted to 'true' since the getter
27 // operation is handled there.
28 return sdbusplus::xyz::openbmc_project::Led::server::
29 Group::asserted(result);
30}
31
32} // namespace led
33} // namespace phosphor