James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Patrick Venture | fd6ba73 | 2019-10-31 14:27:39 -0700 | [diff] [blame^] | 3 | #include <memory> |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 4 | #include <sdbusplus/asio/object_server.hpp> |
Patrick Venture | fd6ba73 | 2019-10-31 14:27:39 -0700 | [diff] [blame^] | 5 | #include <string> |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 6 | |
| 7 | class PwmSensor |
| 8 | { |
| 9 | public: |
Cheng C Yang | 916360b | 2019-05-07 18:47:16 +0800 | [diff] [blame] | 10 | PwmSensor(const std::string& name, const std::string& sysPath, |
James Feist | 82bac4c | 2019-03-11 11:16:53 -0700 | [diff] [blame] | 11 | sdbusplus::asio::object_server& objectServer, |
| 12 | const std::string& sensorConfiguration); |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 13 | ~PwmSensor(); |
| 14 | |
| 15 | private: |
| 16 | std::string sysPath; |
| 17 | sdbusplus::asio::object_server& objectServer; |
| 18 | std::string name; |
| 19 | std::shared_ptr<sdbusplus::asio::dbus_interface> sensorInterface; |
| 20 | std::shared_ptr<sdbusplus::asio::dbus_interface> controlInterface; |
James Feist | 82bac4c | 2019-03-11 11:16:53 -0700 | [diff] [blame] | 21 | std::shared_ptr<sdbusplus::asio::dbus_interface> association; |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 22 | void setValue(uint32_t value); |
| 23 | uint32_t getValue(bool errThrow = true); |
Jae Hyun Yoo | 9ced0a3 | 2018-10-25 10:42:39 -0700 | [diff] [blame] | 24 | }; |