Vishwanatha Subbanna | bda97eb | 2016-11-30 12:21:25 +0530 | [diff] [blame^] | 1 | #pragma once |
| 2 | |
| 3 | #include <string> |
| 4 | #include <sdbusplus/bus.hpp> |
| 5 | #include <sdbusplus/server/object.hpp> |
| 6 | #include "xyz/openbmc_project/Led/Physical/server.hpp" |
| 7 | namespace phosphor |
| 8 | { |
| 9 | namespace led |
| 10 | { |
| 11 | |
| 12 | /** @class Physical |
| 13 | * @brief Responsible for applying actions on a particular physical LED |
| 14 | */ |
| 15 | class Physical : public sdbusplus::server::object::object< |
| 16 | sdbusplus::xyz::openbmc_project::Led::server::Physical> |
| 17 | { |
| 18 | public: |
| 19 | Physical() = delete; |
| 20 | ~Physical() = default; |
| 21 | Physical(const Physical&) = delete; |
| 22 | Physical& operator=(const Physical&) = delete; |
| 23 | Physical(Physical&&) = delete; |
| 24 | Physical& operator=(Physical&&) = delete; |
| 25 | |
| 26 | /** @brief Constructs LED object |
| 27 | * |
| 28 | * @param[in] bus - system dbus handler |
| 29 | * @param[in] objPath - The Dbus path that hosts physical LED |
| 30 | * @param[in] ledPath - sysfs path where this LED is exported |
| 31 | */ |
| 32 | Physical(sdbusplus::bus::bus& bus, |
| 33 | const std::string& objPath, |
| 34 | const std::string& ledPath) : |
| 35 | |
| 36 | sdbusplus::server::object::object< |
| 37 | sdbusplus::xyz::openbmc_project::Led::server::Physical>( |
| 38 | bus, objPath.c_str()), |
| 39 | path(ledPath) |
| 40 | { |
| 41 | // Nothing to do here |
| 42 | } |
| 43 | |
| 44 | private: |
| 45 | /** @brief File system location where this LED is exposed |
| 46 | * Typically /sys/class/leds/<Led-Name> |
| 47 | */ |
| 48 | std::string path; |
| 49 | }; |
| 50 | |
| 51 | } // namespace led |
| 52 | } // namespace phosphor |