blob: b617dce6e0c636f1a5e5dad20c8fb7c4ed47c09f [file] [log] [blame]
// 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_COOLING_DEVICE_H_
#define THERMALD_COOLING_DEVICE_H_
#include "base/macros.h"
#include "base/files/file_path.h"
namespace thermald {
// Interface for interacting with a cooling device of the Linux kernel thermal
// subsystem: https://www.kernel.org/doc/Documentation/thermal/sysfs-api.txt
class CoolingDevice {
public:
// Constructs a cooling device which corresponds to the cooling device with
// the specified id exposed by the kernel.
explicit CoolingDevice(int id);
// Set the current throttle state of the cooling device.
bool SetThrottleState(int state);
// Get the current throttle state of the cooling device.
bool GetThrottleState(int *state) const;
int id() const { return id_; }
private:
const int id_;
const base::FilePath cur_state_attr_;
DISALLOW_COPY_AND_ASSIGN(CoolingDevice);
};
} // namespace thermald
#endif // THERMALD_COOLING_DEVICE_H_