Brad Bishop | 8e068d9 | 2016-12-23 23:41:22 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Brad Bishop | 8e068d9 | 2016-12-23 23:41:22 -0500 | [diff] [blame] | 3 | #include <sdbusplus/server.hpp> |
Patrick Venture | 043d323 | 2018-08-31 10:10:53 -0700 | [diff] [blame] | 4 | #include <xyz/openbmc_project/Control/FanPwm/server.hpp> |
| 5 | #include <xyz/openbmc_project/Control/FanSpeed/server.hpp> |
| 6 | #include <xyz/openbmc_project/Sensor/Threshold/Critical/server.hpp> |
| 7 | #include <xyz/openbmc_project/Sensor/Threshold/Warning/server.hpp> |
| 8 | #include <xyz/openbmc_project/Sensor/Value/server.hpp> |
| 9 | #include <xyz/openbmc_project/State/Decorator/OperationalStatus/server.hpp> |
Brad Bishop | 8e068d9 | 2016-12-23 23:41:22 -0500 | [diff] [blame] | 10 | |
Brad Bishop | d9f06ab | 2017-01-17 14:53:30 -0500 | [diff] [blame] | 11 | template <typename... T> |
| 12 | using ServerObject = typename sdbusplus::server::object::object<T...>; |
Brad Bishop | 8e068d9 | 2016-12-23 23:41:22 -0500 | [diff] [blame] | 13 | |
| 14 | using ValueInterface = sdbusplus::xyz::openbmc_project::Sensor::server::Value; |
| 15 | using ValueObject = ServerObject<ValueInterface>; |
Brad Bishop | cad57db | 2017-01-06 14:55:16 -0500 | [diff] [blame] | 16 | using WarningInterface = |
| 17 | sdbusplus::xyz::openbmc_project::Sensor::Threshold::server::Warning; |
| 18 | using WarningObject = ServerObject<WarningInterface>; |
| 19 | using CriticalInterface = |
| 20 | sdbusplus::xyz::openbmc_project::Sensor::Threshold::server::Critical; |
| 21 | using CriticalObject = ServerObject<CriticalInterface>; |
Matthew Barth | bf7b7b1 | 2017-03-07 15:46:59 -0600 | [diff] [blame] | 22 | using FanSpeedInterface = |
| 23 | sdbusplus::xyz::openbmc_project::Control::server::FanSpeed; |
| 24 | using FanSpeedObject = ServerObject<FanSpeedInterface>; |
Patrick Venture | 9331ab7 | 2018-01-29 09:48:47 -0800 | [diff] [blame] | 25 | using FanPwmInterface = |
| 26 | sdbusplus::xyz::openbmc_project::Control::server::FanPwm; |
| 27 | using FanPwmObject = ServerObject<FanPwmInterface>; |
Patrick Venture | 043d323 | 2018-08-31 10:10:53 -0700 | [diff] [blame] | 28 | using StatusInterface = sdbusplus::xyz::openbmc_project::State::Decorator:: |
| 29 | server::OperationalStatus; |
Matthew Barth | 3581938 | 2018-04-18 14:53:01 -0500 | [diff] [blame] | 30 | using StatusObject = ServerObject<StatusInterface>; |
Brad Bishop | 8e068d9 | 2016-12-23 23:41:22 -0500 | [diff] [blame] | 31 | |
James Feist | ee73f5b | 2018-08-01 16:31:42 -0700 | [diff] [blame] | 32 | // I understand this seems like magic, but since decltype doesn't evaluate you |
| 33 | // can call nullptr https://stackoverflow.com/a/5580411/2784885 |
| 34 | using SensorValueType = |
| 35 | decltype((static_cast<ValueInterface*>(nullptr))->value()); |
| 36 | |
Brad Bishop | 075f7a2 | 2017-01-06 09:45:08 -0500 | [diff] [blame] | 37 | enum class InterfaceType |
| 38 | { |
| 39 | VALUE, |
Brad Bishop | cad57db | 2017-01-06 14:55:16 -0500 | [diff] [blame] | 40 | WARN, |
| 41 | CRIT, |
Matthew Barth | bf7b7b1 | 2017-03-07 15:46:59 -0600 | [diff] [blame] | 42 | FAN_SPEED, |
Patrick Venture | 9331ab7 | 2018-01-29 09:48:47 -0800 | [diff] [blame] | 43 | FAN_PWM, |
Matthew Barth | 3581938 | 2018-04-18 14:53:01 -0500 | [diff] [blame] | 44 | STATUS, |
Brad Bishop | 075f7a2 | 2017-01-06 09:45:08 -0500 | [diff] [blame] | 45 | }; |
| 46 | |
Brad Bishop | 8e068d9 | 2016-12-23 23:41:22 -0500 | [diff] [blame] | 47 | // vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 |