1 #pragma once 2 #include <boost/asio/steady_timer.hpp> 3 #include <boost/container/flat_map.hpp> 4 #include <sensor.hpp> 5 6 #include <chrono> 7 #include <limits> 8 #include <memory> 9 #include <string> 10 #include <vector> 11 12 struct MCUTempSensor : public Sensor 13 { 14 MCUTempSensor(std::shared_ptr<sdbusplus::asio::connection>& conn, 15 boost::asio::io_context& io, const std::string& name, 16 const std::string& sensorConfiguration, 17 sdbusplus::asio::object_server& objectServer, 18 std::vector<thresholds::Threshold>&& thresholdData, 19 uint8_t busId, uint8_t mcuAddress, uint8_t tempReg); 20 ~MCUTempSensor() override; 21 22 void checkThresholds() override; 23 void read(); 24 void init(); 25 26 uint8_t busId; 27 uint8_t mcuAddress; 28 uint8_t tempReg; 29 30 private: 31 int getMCURegsInfoWord(uint8_t regs, int32_t* pu32data) const; 32 sdbusplus::asio::object_server& objectServer; 33 boost::asio::steady_timer waitTimer; 34 }; 35