Vishwanatha Subbanna | 4c8c72b | 2016-11-29 23:02:06 +0530 | [diff] [blame] | 1 | #include <sdbusplus/message.hpp> |
| 2 | #include "group.hpp" |
| 3 | namespace phosphor |
| 4 | { |
| 5 | namespace led |
| 6 | { |
| 7 | |
| 8 | /** @brief Overloaded Property Setter function */ |
| 9 | bool Group::asserted(bool value) |
| 10 | { |
Vishwanatha Subbanna | ed49073 | 2016-12-20 15:59:29 +0530 | [diff] [blame] | 11 | // Introducing these to enable gtest. |
| 12 | Manager::group ledsAssert {}; |
| 13 | Manager::group ledsDeAssert {}; |
Vishwanatha Subbanna | ed49073 | 2016-12-20 15:59:29 +0530 | [diff] [blame] | 14 | |
| 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 Subbanna | 4b000d8 | 2017-05-03 18:44:16 +0530 | [diff] [blame] | 19 | ledsDeAssert); |
Vishwanatha Subbanna | ed49073 | 2016-12-20 15:59:29 +0530 | [diff] [blame] | 20 | |
| 21 | // If something does not go right here, then there should be an sdbusplus |
| 22 | // exception thrown. |
Vishwanatha Subbanna | 4b000d8 | 2017-05-03 18:44:16 +0530 | [diff] [blame] | 23 | manager.driveLEDs(ledsAssert, ledsDeAssert); |
Vishwanatha Subbanna | 4c8c72b | 2016-11-29 23:02:06 +0530 | [diff] [blame] | 24 | |
| 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 |