FanSensor: Add configurable min max
Allow Min and Max reading to be configured
Tested-by: Set a fan to a different Min and it worked.
Change-Id: Ibeebcaa9672d7a9cd9511c3845f5b317db8962c8
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/include/Utils.hpp b/include/Utils.hpp
index fd4dde2..b86c8b5 100644
--- a/include/Utils.hpp
+++ b/include/Utils.hpp
@@ -1,4 +1,6 @@
#pragma once
+#include "VariantVisitors.hpp"
+
#include <boost/container/flat_map.hpp>
#include <experimental/filesystem>
#include <iostream>
@@ -24,6 +26,10 @@
using SensorData = boost::container::flat_map<
std::string, boost::container::flat_map<std::string, BasicVariantType>>;
+using SensorBaseConfiguration =
+ std::pair<std::string,
+ boost::container::flat_map<std::string, BasicVariantType>>;
+
bool findFiles(const std::experimental::filesystem::path dirPath,
const std::string& matchString,
std::vector<std::experimental::filesystem::path>& foundPaths,
@@ -32,4 +38,8 @@
bool getSensorConfiguration(
const std::string& type,
const std::shared_ptr<sdbusplus::asio::connection>& dbusConnection,
- ManagedObjectType& resp, bool useCache = false);
\ No newline at end of file
+ ManagedObjectType& resp, bool useCache = false);
+
+// replaces limits if MinReading and MaxReading are found.
+void findLimits(std::pair<double, double>& limits,
+ const SensorBaseConfiguration* data);
\ No newline at end of file