James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Patrick Venture | ca44b2f | 2019-10-31 11:02:26 -0700 | [diff] [blame] | 3 | #include "Thresholds.hpp" |
| 4 | #include "sensor.hpp" |
| 5 | |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 6 | #include <sdbusplus/asio/object_server.hpp> |
Patrick Venture | fd6ba73 | 2019-10-31 14:27:39 -0700 | [diff] [blame] | 7 | #include <string> |
| 8 | #include <vector> |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 9 | |
James Feist | 251c782 | 2018-09-12 12:54:15 -0700 | [diff] [blame] | 10 | class HwmonTempSensor : public Sensor |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 11 | { |
| 12 | public: |
James Feist | d870587 | 2019-02-08 13:26:09 -0800 | [diff] [blame] | 13 | HwmonTempSensor(const std::string& path, const std::string& objectType, |
| 14 | sdbusplus::asio::object_server& objectServer, |
| 15 | std::shared_ptr<sdbusplus::asio::connection>& conn, |
| 16 | boost::asio::io_service& io, const std::string& fanName, |
| 17 | std::vector<thresholds::Threshold>&& thresholds, |
| 18 | const std::string& sensorConfiguration); |
James Feist | 6714a25 | 2018-09-10 15:26:18 -0700 | [diff] [blame] | 19 | ~HwmonTempSensor(); |
| 20 | |
| 21 | private: |
James Feist | d870587 | 2019-02-08 13:26:09 -0800 | [diff] [blame] | 22 | sdbusplus::asio::object_server& objServer; |
Jae Hyun Yoo | 9ced0a3 | 2018-10-25 10:42:39 -0700 | [diff] [blame] | 23 | boost::asio::posix::stream_descriptor inputDev; |
| 24 | boost::asio::deadline_timer waitTimer; |
| 25 | boost::asio::streambuf readBuf; |
James Feist | 930fcde | 2019-05-28 12:58:43 -0700 | [diff] [blame] | 26 | std::string path; |
Brad Bishop | fbb44ad | 2019-11-08 09:42:37 -0500 | [diff] [blame] | 27 | size_t errCount; |
Jae Hyun Yoo | 9ced0a3 | 2018-10-25 10:42:39 -0700 | [diff] [blame] | 28 | void setupRead(void); |
James Feist | d870587 | 2019-02-08 13:26:09 -0800 | [diff] [blame] | 29 | void handleResponse(const boost::system::error_code& err); |
James Feist | ce3fca4 | 2018-11-21 12:58:24 -0800 | [diff] [blame] | 30 | void checkThresholds(void) override; |
Patrick Venture | ca44b2f | 2019-10-31 11:02:26 -0700 | [diff] [blame] | 31 | }; |