35 lines
858 B
C++
35 lines
858 B
C++
#ifndef NVME_MONITOR_H
|
|
#define NVME_MONITOR_H
|
|
|
|
#include <string>
|
|
#include <map>
|
|
#include <vector>
|
|
|
|
struct TemperatureData {
|
|
double temperature;
|
|
std::string device;
|
|
std::string sensorName;
|
|
long timestamp;
|
|
};
|
|
|
|
class NvmeMonitor {
|
|
public:
|
|
explicit NvmeMonitor();
|
|
|
|
// Get list of available NVMe devices
|
|
std::vector<std::string> getAvailableDevices();
|
|
|
|
// Read temperatures from a specific device
|
|
std::map<std::string, double> readTemperatures(const std::string &device);
|
|
|
|
// Get all available devices and their temperatures
|
|
std::map<std::string, std::map<std::string, double>> getAllTemperatures();
|
|
|
|
private:
|
|
std::vector<std::string> scanDevices();
|
|
std::map<std::string, std::string> findHwmonDevices();
|
|
double readTemperatureFromFile(const std::string &filePath);
|
|
};
|
|
|
|
#endif // NVME_MONITOR_H
|