DPS310 temperature pressure, SI7020 temperature
Infineon DPS310 pressure and temperature sensors for the Blyth
and Storm King Panel, as well as the Silicon Laboratories
SI7020 type sensors. This provide OpenBMC with the ability
to have the DPS310 pressure and temperature sensors also the
Silicon Laboratories SI7020 type sensors provide OpenBMC
with temperature sensor on dbus via dbus-sensors through
HwmonTempSensor. And adds "pressure" as a type of sensor.
Changed sensorScaleFactor to have offsetValue and scaleValue
for _raw IIO devices, scaleValue is a multiplier where
sensorScaleFactor was a divisor. Pulling this into HwmonTempSensor
came about from this Discord discussion:
https://discord.com/channels/775381525260664832/775381525260664836/869641817220595772
Tested: on Rainier's Blyth and Everest's Storm King Op Panels
busctl tree --no-pager xyz.openbmc_project.HwmonTempSensor
busctl introspect --no-pager xyz.openbmc_project.HwmonTempSensor \
/xyz/openbmc_project/sensors/temperature/Ambient_0_Temp
busctl introspect --no-pager xyz.openbmc_project.HwmonTempSensor \
/xyz/openbmc_project/sensors/temperature/Ambient_1_Temp
busctl introspect --no-pager xyz.openbmc_project.HwmonTempSensor \
/xyz/openbmc_project/sensors/temperature/Ambient_2_Temp
busctl introspect --no-pager xyz.openbmc_project.HwmonTempSensor \
/xyz/openbmc_project/sensors/temperature/PCIE_0_Temp
busctl introspect --no-pager xyz.openbmc_project.HwmonTempSensor \
/xyz/openbmc_project/sensors/temperature/PCIE_1_Temp
busctl introspect --no-pager xyz.openbmc_project.HwmonTempSensor \
/xyz/openbmc_project/sensors/pressure/Station_Pressure
Results consistent with location of the systems.
Signed-off-by: Bruce Mitchell <bruce.mitchell@linux.vnet.ibm.com>
Change-Id: I5c0d56b486a671ee507c7bfe18fea72e7eaf9ebe
diff --git a/include/HwmonTempSensor.hpp b/include/HwmonTempSensor.hpp
index 159e9b5..8ae92cf 100644
--- a/include/HwmonTempSensor.hpp
+++ b/include/HwmonTempSensor.hpp
@@ -8,6 +8,16 @@
#include <string>
#include <vector>
+struct SensorParams
+{
+ double minValue;
+ double maxValue;
+ double offsetValue;
+ double scaleValue;
+ std::string units;
+ std::string typeName;
+};
+
class HwmonTempSensor :
public Sensor,
public std::enable_shared_from_this<HwmonTempSensor>
@@ -18,6 +28,7 @@
std::shared_ptr<sdbusplus::asio::connection>& conn,
boost::asio::io_service& io, const std::string& sensorName,
std::vector<thresholds::Threshold>&& thresholds,
+ const struct SensorParams& thisSensorParameters,
const float pollRate,
const std::string& sensorConfiguration,
const PowerState powerState);
@@ -30,6 +41,8 @@
boost::asio::deadline_timer waitTimer;
boost::asio::streambuf readBuf;
std::string path;
+ double offsetValue;
+ double scaleValue;
unsigned int sensorPollMs;
void handleResponse(const boost::system::error_code& err);