blob: 01b2b8a6dda9d0e3c781d503bfaa9df809fe7ae5 [file] [log] [blame]
// Copyright 2014 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_TEMPERATURE_SENSOR_INTERFACE_H_
#define THERMALD_TEMPERATURE_SENSOR_INTERFACE_H_
#include <string>
namespace thermald {
// Interface for temperature sensors
class TemperatureSensorInterface {
public:
virtual ~TemperatureSensorInterface() {}
virtual std::string name() const = 0;
// Read the temperature from the sensor
//
// The unit of the returned temperature value is millidegrees Celsius
//
// Returns true on success and false otherwise
virtual bool ReadTemperature(int *value) = 0;
// Check if the sensor is operational.
//
// Certain types of sensors are not always operational. This method allows
// users of the sensor to determine dynamically whether it is possible to read
// a temperature from the sensor.
//
virtual bool IsOperational() = 0;
};
} // namespace thermald
#endif // THERMALD_TEMPERATURE_SENSOR_INTERFACE_H_