Vishwanatha Subbanna | 4c8c72b | 2016-11-29 23:02:06 +0530 | [diff] [blame] | 1 | #include "group.hpp" |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 2 | |
| 3 | #include <sdbusplus/message.hpp> |
Vishwanatha Subbanna | 4c8c72b | 2016-11-29 23:02:06 +0530 | [diff] [blame] | 4 | namespace phosphor |
| 5 | { |
| 6 | namespace led |
| 7 | { |
| 8 | |
| 9 | /** @brief Overloaded Property Setter function */ |
| 10 | bool Group::asserted(bool value) |
| 11 | { |
Vishwanatha Subbanna | ed49073 | 2016-12-20 15:59:29 +0530 | [diff] [blame] | 12 | // Introducing these to enable gtest. |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 13 | Manager::group ledsAssert{}; |
| 14 | Manager::group ledsDeAssert{}; |
Vishwanatha Subbanna | ed49073 | 2016-12-20 15:59:29 +0530 | [diff] [blame] | 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. |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 19 | auto result = manager.setGroupState(path, value, ledsAssert, 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. |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 27 | return sdbusplus::xyz::openbmc_project::Led::server::Group::asserted( |
| 28 | result); |
Vishwanatha Subbanna | 4c8c72b | 2016-11-29 23:02:06 +0530 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | } // namespace led |
| 32 | } // namespace phosphor |