1*d7be555eSGeorge Liu #pragma once 2*d7be555eSGeorge Liu 3*d7be555eSGeorge Liu #include <boost/asio/io_context.hpp> 4*d7be555eSGeorge Liu #include <sensor.hpp> 5*d7be555eSGeorge Liu 6*d7be555eSGeorge Liu class NVMeSensor : public Sensor 7*d7be555eSGeorge Liu { 8*d7be555eSGeorge Liu public: 9*d7be555eSGeorge Liu static constexpr const char* sensorType = "NVME1000"; 10*d7be555eSGeorge Liu 11*d7be555eSGeorge Liu NVMeSensor(sdbusplus::asio::object_server& objectServer, 12*d7be555eSGeorge Liu boost::asio::io_context& io, 13*d7be555eSGeorge Liu std::shared_ptr<sdbusplus::asio::connection>& conn, 14*d7be555eSGeorge Liu const std::string& sensorName, 15*d7be555eSGeorge Liu std::vector<thresholds::Threshold>&& thresholds, 16*d7be555eSGeorge Liu const std::string& sensorConfiguration, int busNumber, 17*d7be555eSGeorge Liu uint8_t slaveAddr); 18*d7be555eSGeorge Liu ~NVMeSensor() override; 19*d7be555eSGeorge Liu 20*d7be555eSGeorge Liu NVMeSensor& operator=(const NVMeSensor& other) = delete; 21*d7be555eSGeorge Liu 22*d7be555eSGeorge Liu bool sample(); 23*d7be555eSGeorge Liu 24*d7be555eSGeorge Liu const int bus; 25*d7be555eSGeorge Liu const uint8_t address; 26*d7be555eSGeorge Liu 27*d7be555eSGeorge Liu private: 28*d7be555eSGeorge Liu const unsigned int scanDelayTicks = 5 * 60; 29*d7be555eSGeorge Liu sdbusplus::asio::object_server& objServer; 30*d7be555eSGeorge Liu unsigned int scanDelay{0}; 31*d7be555eSGeorge Liu 32*d7be555eSGeorge Liu void checkThresholds() override; 33*d7be555eSGeorge Liu }; 34