Remove duplicate functions
There are many duplicate functions in the sensors,
collapse them into base class.
Change-Id: Ic0e4a1c396c221ea637cea5b8f429a751fc31f99
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/include/CPUSensor.hpp b/include/CPUSensor.hpp
index 41cc02f..4eb2ae0 100644
--- a/include/CPUSensor.hpp
+++ b/include/CPUSensor.hpp
@@ -7,7 +7,6 @@
class CPUSensor : public Sensor
{
public:
- std::string configuration;
CPUSensor(const std::string &path, const std::string &objectType,
sdbusplus::asio::object_server &objectServer,
std::shared_ptr<sdbusplus::asio::connection> &conn,
@@ -19,20 +18,13 @@
static constexpr unsigned int sensorPollMs = 1000;
private:
- std::string objectType;
sdbusplus::asio::object_server &objServer;
std::shared_ptr<sdbusplus::asio::connection> dbusConnection;
boost::asio::posix::stream_descriptor inputDev;
boost::asio::deadline_timer waitTimer;
boost::asio::streambuf readBuf;
int errCount;
- double maxValue;
- double minValue;
void setupRead(void);
void handleResponse(const boost::system::error_code &err);
- void checkThresholds(void);
- void updateValue(const double &newValue);
-
- void setInitialProperties(
- std::shared_ptr<sdbusplus::asio::connection> &conn);
+ void checkThresholds(void) override;
};