blob: 973d695599c3a483061450d24ce9d0a68ce2c244 [file] [log] [blame]
James Feist6714a252018-09-10 15:26:18 -07001#pragma once
2
3#include <sdbusplus/asio/object_server.hpp>
4
5class PwmSensor
6{
7 public:
Cheng C Yang916360b2019-05-07 18:47:16 +08008 PwmSensor(const std::string& name, const std::string& sysPath,
James Feist82bac4c2019-03-11 11:16:53 -07009 sdbusplus::asio::object_server& objectServer,
10 const std::string& sensorConfiguration);
James Feist6714a252018-09-10 15:26:18 -070011 ~PwmSensor();
12
13 private:
14 std::string sysPath;
15 sdbusplus::asio::object_server& objectServer;
16 std::string name;
17 std::shared_ptr<sdbusplus::asio::dbus_interface> sensorInterface;
18 std::shared_ptr<sdbusplus::asio::dbus_interface> controlInterface;
James Feist82bac4c2019-03-11 11:16:53 -070019 std::shared_ptr<sdbusplus::asio::dbus_interface> association;
James Feist6714a252018-09-10 15:26:18 -070020 void setValue(uint32_t value);
21 uint32_t getValue(bool errThrow = true);
Jae Hyun Yoo9ced0a32018-10-25 10:42:39 -070022};