summaryrefslogtreecommitdiffstats
path: root/xyz
diff options
context:
space:
mode:
authorVishwanatha Subbanna <vishwa@linux.vnet.ibm.com>2017-03-10 15:27:23 +0530
committerVishwanatha Subbanna <vishwa@linux.vnet.ibm.com>2017-03-13 18:24:20 +0530
commite089173fac7240173b227ac61d32fdf2ef367a83 (patch)
tree827aa6d5ecfe531e1632e19abb7c74ba4f29ceed /xyz
parent7f6e809291b3281ab278a4b3c31874b4708c579d (diff)
downloadphosphor-led-sysfs-e089173fac7240173b227ac61d32fdf2ef367a83.tar.gz
phosphor-led-sysfs-e089173fac7240173b227ac61d32fdf2ef367a83.zip
Link to dbus interfaces library for using generated code
Change-Id: Id1c45d8c66deb499a92bfd94bc271f378245da34 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
Diffstat (limited to 'xyz')
-rw-r--r--xyz/openbmc_project/Led/Physical/server.hpp149
1 files changed, 0 insertions, 149 deletions
diff --git a/xyz/openbmc_project/Led/Physical/server.hpp b/xyz/openbmc_project/Led/Physical/server.hpp
deleted file mode 100644
index 2269f42..0000000
--- a/xyz/openbmc_project/Led/Physical/server.hpp
+++ /dev/null
@@ -1,149 +0,0 @@
-#pragma once
-#include <tuple>
-#include <systemd/sd-bus.h>
-#include <sdbusplus/server.hpp>
-
-namespace sdbusplus
-{
-namespace xyz
-{
-namespace openbmc_project
-{
-namespace Led
-{
-namespace server
-{
-
-class Physical
-{
- public:
- /* Define all of the basic class operations:
- * Not allowed:
- * - Default constructor to avoid nullptrs.
- * - Copy operations due to internal unique_ptr.
- * Allowed:
- * - Move operations.
- * - Destructor.
- */
- Physical() = delete;
- Physical(const Physical&) = delete;
- Physical& operator=(const Physical&) = delete;
- Physical(Physical&&) = default;
- Physical& operator=(Physical&&) = default;
- virtual ~Physical() = default;
-
- /** @brief Constructor to put object onto bus at a dbus path.
- * @param[in] bus - Bus to attach to.
- * @param[in] path - Path to attach at.
- */
- Physical(bus::bus& bus, const char* path);
-
- enum class Action
- {
- Off,
- On,
- Blink,
- };
- enum class Palette
- {
- Unknown,
- Red,
- Green,
- Blue,
- Yellow,
- };
-
-
-
- /** Get value of State */
- virtual Action state() const;
- /** Set value of State */
- virtual Action state(Action value);
- /** Get value of DutyOn */
- virtual uint8_t dutyOn() const;
- /** Set value of DutyOn */
- virtual uint8_t dutyOn(uint8_t value);
- /** Get value of Color */
- virtual Palette color() const;
- /** Set value of Color */
- virtual Palette color(Palette value);
-
- /** @brief Convert a string to an appropriate enum value.
- * @param[in] s - The string to convert in the form of
- * "xyz.openbmc_project.Led.Physical.<value name>"
- * @return - The enum value.
- */
- static Action convertActionFromString(std::string& s);
- /** @brief Convert a string to an appropriate enum value.
- * @param[in] s - The string to convert in the form of
- * "xyz.openbmc_project.Led.Physical.<value name>"
- * @return - The enum value.
- */
- static Palette convertPaletteFromString(std::string& s);
-
- private:
-
- /** @brief sd-bus callback for get-property 'State' */
- static int _callback_get_State(
- sd_bus*, const char*, const char*, const char*,
- sd_bus_message*, void*, sd_bus_error*);
- /** @brief sd-bus callback for set-property 'State' */
- static int _callback_set_State(
- sd_bus*, const char*, const char*, const char*,
- sd_bus_message*, void*, sd_bus_error*);
-
- /** @brief sd-bus callback for get-property 'DutyOn' */
- static int _callback_get_DutyOn(
- sd_bus*, const char*, const char*, const char*,
- sd_bus_message*, void*, sd_bus_error*);
- /** @brief sd-bus callback for set-property 'DutyOn' */
- static int _callback_set_DutyOn(
- sd_bus*, const char*, const char*, const char*,
- sd_bus_message*, void*, sd_bus_error*);
-
- /** @brief sd-bus callback for get-property 'Color' */
- static int _callback_get_Color(
- sd_bus*, const char*, const char*, const char*,
- sd_bus_message*, void*, sd_bus_error*);
- /** @brief sd-bus callback for set-property 'Color' */
- static int _callback_set_Color(
- sd_bus*, const char*, const char*, const char*,
- sd_bus_message*, void*, sd_bus_error*);
-
-
- static constexpr auto _interface = "xyz.openbmc_project.Led.Physical";
- static const vtable::vtable_t _vtable[];
- sdbusplus::server::interface::interface
- _xyz_openbmc_project_Led_Physical_interface;
-
- Action _state = Action::Off;
- uint8_t _dutyOn = 50;
- Palette _color = Palette::Unknown;
-
-};
-
-/* Specialization of sdbusplus::server::bindings::details::convertForMessage
- * for enum-type Physical::Action.
- *
- * This converts from the enum to a constant c-string representing the enum.
- *
- * @param[in] e - Enum value to convert.
- * @return C-string representing the name for the enum value.
- */
-std::string convertForMessage(Physical::Action e);
-/* Specialization of sdbusplus::server::bindings::details::convertForMessage
- * for enum-type Physical::Palette.
- *
- * This converts from the enum to a constant c-string representing the enum.
- *
- * @param[in] e - Enum value to convert.
- * @return C-string representing the name for the enum value.
- */
-std::string convertForMessage(Physical::Palette e);
-
-} // namespace server
-} // namespace Led
-} // namespace openbmc_project
-} // namespace xyz
-} // namespace sdbusplus
-
OpenPOWER on IntegriCloud