temp-monitor/include/temp_monitor.h
2026-01-11 12:51:35 +01:00

42 lines
956 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:
struct SensorInfo {
std::string deviceName;
std::string sensorName;
std::string path;
};
std::vector<SensorInfo> discoveredSensors;
void discoverSensors();
double readTemperatureFromFile(const std::string &filePath);
};
#endif // TEMP_MONITOR_H