1 #pragma once 2 3 #include "dbushelper_interface.hpp" 4 #include "interfaces.hpp" 5 #include "util.hpp" 6 7 #include <sdbusplus/bus.hpp> 8 9 #include <memory> 10 #include <string> 11 12 namespace pid_control 13 { 14 15 /* 16 * This ReadInterface will actively reach out over dbus upon calling read to 17 * get the value from whomever owns the associated dbus path. 18 */ 19 class DbusActiveRead : public ReadInterface 20 { 21 public: 22 DbusActiveRead(sdbusplus::bus::bus& bus, const std::string& path, 23 const std::string& service, DbusHelperInterface* helper) : 24 ReadInterface(), 25 _bus(bus), _path(path), _service(service), _helper(helper) 26 {} 27 28 ReadReturn read(void) override; 29 30 private: 31 sdbusplus::bus::bus& _bus; 32 const std::string _path; 33 const std::string _service; // the sensor service. 34 DbusHelperInterface* _helper; 35 }; 36 37 } // namespace pid_control 38