ExitAirSensor: Get power readings from PSU
Now that PSU Sensors work, remove todo. Also fix
a bug where a int32 should have been a double as the
value from d-bus is a double.
Tested: Ipmitool sensor list
Change-Id: Ic7b31c1091b8178dc23ca79fdc189b973095a8e3
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/include/ExitAirTempSensor.hpp b/include/ExitAirTempSensor.hpp
index 1e774cf..70c3f68 100644
--- a/include/ExitAirTempSensor.hpp
+++ b/include/ExitAirTempSensor.hpp
@@ -10,9 +10,9 @@
struct CFMSensor : public Sensor
{
std::vector<std::string> tachs;
- int32_t c1;
- int32_t c2;
- int32_t maxCFM;
+ double c1;
+ double c2;
+ double maxCFM;
double tachMinPercent;
double tachMaxPercent;
diff --git a/include/Utils.hpp b/include/Utils.hpp
index 7f24e21..d65fb83 100644
--- a/include/Utils.hpp
+++ b/include/Utils.hpp
@@ -26,6 +26,9 @@
using SensorData = boost::container::flat_map<
std::string, boost::container::flat_map<std::string, BasicVariantType>>;
+using GetSubTreeType = std::vector<
+ std::pair<std::string,
+ std::vector<std::pair<std::string, std::vector<std::string>>>>>;
using SensorBaseConfiguration =
std::pair<std::string,
boost::container::flat_map<std::string, BasicVariantType>>;
@@ -57,6 +60,20 @@
always
};
+namespace mapper
+{
+constexpr const char* busName = "xyz.openbmc_project.ObjectMapper";
+constexpr const char* path = "/xyz/openbmc_project/object_mapper";
+constexpr const char* interface = "xyz.openbmc_project.ObjectMapper";
+constexpr const char* subtree = "GetSubTree";
+} // namespace mapper
+
+namespace properties
+{
+constexpr const char* interface = "org.freedesktop.DBus.Properties";
+constexpr const char* get = "Get";
+} // namespace properties
+
template <typename T>
inline T loadVariant(
const boost::container::flat_map<std::string, BasicVariantType>& data,
diff --git a/include/sensor.hpp b/include/sensor.hpp
index 2a414da..3d81f1f 100644
--- a/include/sensor.hpp
+++ b/include/sensor.hpp
@@ -4,6 +4,8 @@
#include <sdbusplus/asio/object_server.hpp>
constexpr size_t sensorFailedPollTimeMs = 5000;
+
+constexpr const char* sensorValueInterface = "xyz.openbmc_project.Sensor.Value";
struct Sensor
{
Sensor(const std::string& name, const std::string& path,