33 lines
750 B
C++
33 lines
750 B
C++
#ifndef TEMP_MONITOR_H
|
|
#define TEMP_MONITOR_H
|
|
|
|
#include <string>
|
|
#include <map>
|
|
#include <vector>
|
|
|
|
struct TemperatureData {
|
|
double temperature;
|
|
std::string device;
|
|
std::string sensorName;
|
|
long timestamp;
|
|
};
|
|
|
|
class TempMonitor {
|
|
public:
|
|
explicit TempMonitor();
|
|
|
|
// Get list of available 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:
|
|
double readTemperatureFromFile(const std::string &filePath);
|
|
};
|
|
|
|
#endif // TEMP_MONITOR_H
|