blob: 0d4fa10b8822e51f8a6ac552554c2a96431aed29 [file] [log] [blame]
Vishwanatha Subbanna4c8c72b2016-11-29 23:02:06 +05301#include "group.hpp"
Patrick Venture91ac8d32018-11-01 17:03:22 -07002
3#include <sdbusplus/message.hpp>
Vishwanatha Subbanna4c8c72b2016-11-29 23:02:06 +05304namespace phosphor
5{
6namespace led
7{
8
9/** @brief Overloaded Property Setter function */
10bool Group::asserted(bool value)
11{
Vishwanatha Subbannaed490732016-12-20 15:59:29 +053012 // Introducing these to enable gtest.
Patrick Venture91ac8d32018-11-01 17:03:22 -070013 Manager::group ledsAssert{};
14 Manager::group ledsDeAssert{};
Vishwanatha Subbannaed490732016-12-20 15:59:29 +053015
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.
Patrick Venture91ac8d32018-11-01 17:03:22 -070019 auto result = manager.setGroupState(path, value, ledsAssert, 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.
Patrick Venture91ac8d32018-11-01 17:03:22 -070027 return sdbusplus::xyz::openbmc_project::Led::server::Group::asserted(
28 result);
Vishwanatha Subbanna4c8c72b2016-11-29 23:02:06 +053029}
30
31} // namespace led
32} // namespace phosphor