Vishwanatha Subbanna | 4c8c72b | 2016-11-29 23:02:06 +0530 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 3 | #include "manager.hpp" |
| 4 | |
Vishwanatha Subbanna | 4c8c72b | 2016-11-29 23:02:06 +0530 | [diff] [blame] | 5 | #include <sdbusplus/bus.hpp> |
| 6 | #include <sdbusplus/server/object.hpp> |
Vishwanatha Subbanna | 55ef5b0 | 2017-03-10 13:32:08 +0530 | [diff] [blame] | 7 | #include <xyz/openbmc_project/Led/Group/server.hpp> |
Andrew Geissler | d02c3cb | 2020-05-16 10:28:02 -0500 | [diff] [blame] | 8 | |
George Liu | a6c18f8 | 2020-06-22 10:50:04 +0800 | [diff] [blame] | 9 | #include <string> |
| 10 | |
Vishwanatha Subbanna | 4c8c72b | 2016-11-29 23:02:06 +0530 | [diff] [blame] | 11 | namespace phosphor |
| 12 | { |
| 13 | namespace led |
| 14 | { |
| 15 | |
| 16 | /** @class Group |
| 17 | * @brief Manages group of LEDs and applies action on the elements of group |
| 18 | */ |
George Liu | a6c18f8 | 2020-06-22 10:50:04 +0800 | [diff] [blame] | 19 | class Group : |
| 20 | sdbusplus::server::object::object< |
| 21 | sdbusplus::xyz::openbmc_project::Led::server::Group> |
Vishwanatha Subbanna | 4c8c72b | 2016-11-29 23:02:06 +0530 | [diff] [blame] | 22 | { |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 23 | public: |
| 24 | Group() = delete; |
| 25 | ~Group() = default; |
| 26 | Group(const Group&) = delete; |
| 27 | Group& operator=(const Group&) = delete; |
| 28 | Group(Group&&) = default; |
| 29 | Group& operator=(Group&&) = default; |
Vishwanatha Subbanna | 4c8c72b | 2016-11-29 23:02:06 +0530 | [diff] [blame] | 30 | |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 31 | /** @brief Constructs LED Group |
| 32 | * |
| 33 | * @param[in] bus - Handle to system dbus |
| 34 | * @param[in] objPath - The Dbus path that hosts LED group |
| 35 | * @param[in] manager - Reference to Manager |
| 36 | */ |
| 37 | Group(sdbusplus::bus::bus& bus, const std::string& objPath, |
| 38 | Manager& manager) : |
Vishwanatha Subbanna | 4c8c72b | 2016-11-29 23:02:06 +0530 | [diff] [blame] | 39 | |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 40 | sdbusplus::server::object::object< |
Vishwanatha Subbanna | 4c8c72b | 2016-11-29 23:02:06 +0530 | [diff] [blame] | 41 | sdbusplus::xyz::openbmc_project::Led::server::Group>( |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 42 | bus, objPath.c_str()), |
| 43 | path(objPath), manager(manager) |
| 44 | { |
| 45 | // Nothing to do here |
| 46 | } |
Vishwanatha Subbanna | 4c8c72b | 2016-11-29 23:02:06 +0530 | [diff] [blame] | 47 | |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 48 | /** @brief Property SET Override function |
| 49 | * |
| 50 | * @param[in] value - True or False |
| 51 | * @return - Success or exception thrown |
| 52 | */ |
| 53 | bool asserted(bool value) override; |
Vishwanatha Subbanna | 4c8c72b | 2016-11-29 23:02:06 +0530 | [diff] [blame] | 54 | |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 55 | private: |
| 56 | /** @brief Path of the group instance */ |
| 57 | std::string path; |
Vishwanatha Subbanna | 4c8c72b | 2016-11-29 23:02:06 +0530 | [diff] [blame] | 58 | |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 59 | /** @brief Reference to Manager object */ |
| 60 | Manager& manager; |
Vishwanatha Subbanna | 4c8c72b | 2016-11-29 23:02:06 +0530 | [diff] [blame] | 61 | }; |
| 62 | |
| 63 | } // namespace led |
| 64 | } // namespace phosphor |