Follow up on Todo, move path out of base sensor
Not every sensor needs a sysfs path, because of that
move it out of the base class and into the classes that
need it.
Change-Id: I62b7df681e1ee889eb66e371d1cd6094097e9f21
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/include/ADCSensor.hpp b/include/ADCSensor.hpp
index 539e0da..b5a9e9a 100644
--- a/include/ADCSensor.hpp
+++ b/include/ADCSensor.hpp
@@ -23,6 +23,7 @@
boost::asio::posix::stream_descriptor inputDev;
boost::asio::deadline_timer waitTimer;
boost::asio::streambuf readBuf;
+ std::string path;
int errCount;
double scaleFactor;
std::optional<int> bridgeGpio;
diff --git a/include/CPUSensor.hpp b/include/CPUSensor.hpp
index 1b25518..2cac56e 100644
--- a/include/CPUSensor.hpp
+++ b/include/CPUSensor.hpp
@@ -33,6 +33,7 @@
boost::asio::deadline_timer waitTimer;
boost::asio::streambuf readBuf;
std::string nameTcontrol;
+ std::string path;
double privTcontrol;
bool show;
int errCount;
diff --git a/include/HwmonTempSensor.hpp b/include/HwmonTempSensor.hpp
index 9343576..795c02d 100644
--- a/include/HwmonTempSensor.hpp
+++ b/include/HwmonTempSensor.hpp
@@ -20,6 +20,7 @@
boost::asio::posix::stream_descriptor inputDev;
boost::asio::deadline_timer waitTimer;
boost::asio::streambuf readBuf;
+ std::string path;
int errCount;
void setupRead(void);
void handleResponse(const boost::system::error_code& err);
diff --git a/include/PSUSensor.hpp b/include/PSUSensor.hpp
index afc748b..370ded9 100644
--- a/include/PSUSensor.hpp
+++ b/include/PSUSensor.hpp
@@ -23,6 +23,7 @@
boost::asio::posix::stream_descriptor inputDev;
boost::asio::deadline_timer waitTimer;
boost::asio::streambuf readBuf;
+ std::string path;
int errCount;
unsigned int sensorFactor;
void setupRead(void);
diff --git a/include/TachSensor.hpp b/include/TachSensor.hpp
index 2a489dc..4588653 100644
--- a/include/TachSensor.hpp
+++ b/include/TachSensor.hpp
@@ -76,6 +76,7 @@
boost::asio::posix::stream_descriptor inputDev;
boost::asio::deadline_timer waitTimer;
boost::asio::streambuf readBuf;
+ std::string path;
int errCount;
void setupRead(void);
void handleResponse(const boost::system::error_code& err);
diff --git a/include/sensor.hpp b/include/sensor.hpp
index 19c3733..29f674a 100644
--- a/include/sensor.hpp
+++ b/include/sensor.hpp
@@ -8,20 +8,18 @@
constexpr const char* sensorValueInterface = "xyz.openbmc_project.Sensor.Value";
struct Sensor
{
- Sensor(const std::string& name, const std::string& path,
+ Sensor(const std::string& name,
std::vector<thresholds::Threshold>&& thresholdData,
const std::string& configurationPath, const std::string& objectType,
const double max, const double min) :
name(name),
- path(path), configurationPath(configurationPath),
- objectType(objectType), thresholds(std::move(thresholdData)),
- maxValue(max), minValue(min)
+ configurationPath(configurationPath), objectType(objectType),
+ thresholds(std::move(thresholdData)), maxValue(max), minValue(min)
{
}
virtual ~Sensor() = default;
virtual void checkThresholds(void) = 0;
std::string name;
- std::string path;
std::string configurationPath;
std::string objectType;
double maxValue;