summaryrefslogtreecommitdiffstats
path: root/physical.hpp
diff options
context:
space:
mode:
authorVishwanatha Subbanna <vishwa@linux.vnet.ibm.com>2016-11-30 12:21:25 +0530
committerVishwanatha Subbanna <vishwa@linux.vnet.ibm.com>2016-12-12 12:52:25 +0530
commitbda97eb107fc60544fb8cde0ec1ada1da2d66f73 (patch)
treeae19e42104bf3e6d0ca0afd018f3590fac13dcad /physical.hpp
parent835571ebcf22165135429efb0d77f11b92540ecf (diff)
downloadphosphor-led-sysfs-bda97eb107fc60544fb8cde0ec1ada1da2d66f73.tar.gz
phosphor-led-sysfs-bda97eb107fc60544fb8cde0ec1ada1da2d66f73.zip
Use generated bindings for physical led controller
Extends the generated interface and provides skeleton implementation of led controller. Change-Id: I13485f39755213b8a7324e526d6335f3ee0a2b67 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
Diffstat (limited to 'physical.hpp')
-rw-r--r--physical.hpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/physical.hpp b/physical.hpp
new file mode 100644
index 0000000..f0b4048
--- /dev/null
+++ b/physical.hpp
@@ -0,0 +1,52 @@
+#pragma once
+
+#include <string>
+#include <sdbusplus/bus.hpp>
+#include <sdbusplus/server/object.hpp>
+#include "xyz/openbmc_project/Led/Physical/server.hpp"
+namespace phosphor
+{
+namespace led
+{
+
+/** @class Physical
+ * @brief Responsible for applying actions on a particular physical LED
+ */
+class Physical : public sdbusplus::server::object::object<
+ sdbusplus::xyz::openbmc_project::Led::server::Physical>
+{
+ public:
+ Physical() = delete;
+ ~Physical() = default;
+ Physical(const Physical&) = delete;
+ Physical& operator=(const Physical&) = delete;
+ Physical(Physical&&) = delete;
+ Physical& operator=(Physical&&) = delete;
+
+ /** @brief Constructs LED object
+ *
+ * @param[in] bus - system dbus handler
+ * @param[in] objPath - The Dbus path that hosts physical LED
+ * @param[in] ledPath - sysfs path where this LED is exported
+ */
+ Physical(sdbusplus::bus::bus& bus,
+ const std::string& objPath,
+ const std::string& ledPath) :
+
+ sdbusplus::server::object::object<
+ sdbusplus::xyz::openbmc_project::Led::server::Physical>(
+ bus, objPath.c_str()),
+ path(ledPath)
+ {
+ // Nothing to do here
+ }
+
+ private:
+ /** @brief File system location where this LED is exposed
+ * Typically /sys/class/leds/<Led-Name>
+ */
+ std::string path;
+};
+
+} // namespace led
+} // namespace phosphor
OpenPOWER on IntegriCloud