From bda97eb107fc60544fb8cde0ec1ada1da2d66f73 Mon Sep 17 00:00:00 2001 From: Vishwanatha Subbanna Date: Wed, 30 Nov 2016 12:21:25 +0530 Subject: 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 --- physical.hpp | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 physical.hpp (limited to 'physical.hpp') 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 +#include +#include +#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/ + */ + std::string path; +}; + +} // namespace led +} // namespace phosphor -- cgit v1.2.1