| // Copyright 2015 The Chromium OS Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #ifndef THERMALD_THERMAL_ZONE_TEMPERATURE_SENSOR_H_ |
| #define THERMALD_THERMAL_ZONE_TEMPERATURE_SENSOR_H_ |
| |
| #include <string> |
| |
| #include "base/macros.h" |
| #include "base/files/file_path.h" |
| |
| #include "thermald/temperature_sensor_common.h" |
| |
| namespace thermald { |
| |
| // Class to read the temperature from a sensor exposed as a thermal zone |
| // by the Linux kernel: |
| // |
| // https://www.kernel.org/doc/Documentation/thermal/sysfs-api.txt |
| class ThermalZoneTemperatureSensor : public TemperatureSensorCommon { |
| public: |
| explicit ThermalZoneTemperatureSensor(int zone_id); |
| ThermalZoneTemperatureSensor(int zone_id, const std::string &sensor_name); |
| |
| bool ReadTemperature(int *value); |
| |
| private: |
| const base::FilePath sysfs_attr_path_; |
| |
| DISALLOW_COPY_AND_ASSIGN(ThermalZoneTemperatureSensor); |
| }; |
| |
| } // namespace thermald |
| |
| #endif // THERMALD_THERMAL_ZONE_TEMPERATURE_SENSOR_H_ |