blob: 6c0f06addae32570b9f39780bdb7b95ceac12536 [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 {};
Vishwanatha Subbannaed490732016-12-20 15:59:29 +053014
15 // Group management is handled by Manager. The populated leds* sets are not
16 // really used by production code. They are there to enable gtest for
17 // validation.
18 auto result = manager.setGroupState(path, value, ledsAssert,
Vishwanatha Subbanna4b000d82017-05-03 18:44:16 +053019 ledsDeAssert);
Vishwanatha Subbannaed490732016-12-20 15:59:29 +053020
21 // If something does not go right here, then there should be an sdbusplus
22 // exception thrown.
Vishwanatha Subbanna4b000d82017-05-03 18:44:16 +053023 manager.driveLEDs(ledsAssert, ledsDeAssert);
Vishwanatha Subbanna4c8c72b2016-11-29 23:02:06 +053024
25 // Set the base class's asserted to 'true' since the getter
26 // operation is handled there.
27 return sdbusplus::xyz::openbmc_project::Led::server::
28 Group::asserted(result);
29}
30
31} // namespace led
32} // namespace phosphor