Add Ipmb Sensor
Add daemon responsible for polling ipmb for sensor
readings. Currently base ME and VR bridge sensors
are supported. This daemon uses ipmbd to get sensor
readings.
Tested-by: Saw correct readings on d-bus and verified
sensor list.
Change-Id: I71c216ae57567470d42180dce76aba8f69ecb50e
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/include/IpmbSensor.hpp b/include/IpmbSensor.hpp
new file mode 100644
index 0000000..d5b0290
--- /dev/null
+++ b/include/IpmbSensor.hpp
@@ -0,0 +1,49 @@
+#pragma once
+#include "sensor.hpp"
+
+#include <boost/asio/deadline_timer.hpp>
+#include <boost/container/flat_map.hpp>
+#include <chrono>
+#include <limits>
+#include <vector>
+
+enum class IpmbType
+{
+ meSensor,
+ PXE1410CVR,
+ IR38363VR,
+ mpsVR
+};
+
+struct IpmbSensor : public Sensor
+{
+ IpmbSensor(std::shared_ptr<sdbusplus::asio::connection> &conn,
+ boost::asio::io_service &io, const std::string &name,
+ const std::string &sensorConfiguration,
+ sdbusplus::asio::object_server &objectServer,
+ std::vector<thresholds::Threshold> &&thresholds,
+ uint8_t deviceAddress);
+ ~IpmbSensor();
+
+ void checkThresholds(void) override;
+ void read(void);
+ void init(void);
+ void loadDefaults(void);
+
+ IpmbType type;
+ uint8_t commandAddress;
+ uint8_t netfn;
+ uint8_t command;
+ uint8_t deviceAddress;
+ std::vector<uint8_t> commandData;
+ std::optional<uint8_t> initCommand;
+ std::vector<uint8_t> initData;
+
+ // to date all ipmb sensors are power on only
+ PowerState readState = PowerState::on;
+
+ private:
+ sdbusplus::asio::object_server &objectServer;
+ std::shared_ptr<sdbusplus::asio::connection> dbusConnection;
+ boost::asio::deadline_timer waitTimer;
+};
\ No newline at end of file