Index: chromeos/system/cpu_temp_reader.h |
diff --git a/chromeos/system/cpu_temp_reader.h b/chromeos/system/cpu_temp_reader.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..73110683c21b6d071ad3051d0072ce403fda532f |
--- /dev/null |
+++ b/chromeos/system/cpu_temp_reader.h |
@@ -0,0 +1,30 @@ |
+// Copyright 2017 The Chromium 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 CHROMEOS_SYSTEM_CPU_TEMP_READER_H_ |
Daniel Erat
2017/04/14 18:53:32
nit: just rename this to cpu_temperature.h if you
Simon Que
2017/04/17 16:41:07
Introducing a class.
|
+#define CHROMEOS_SYSTEM_CPU_TEMP_READER_H_ |
+ |
+#include <string> |
+#include <vector> |
+ |
+namespace chromeos { |
+namespace system { |
+ |
+// Contains info from a CPU temperature sensor. |
+struct CPUTemperatureInfo { |
+ // The temperature read by a CPU temperature sensor in degrees Celsius. |
+ double temp_celsius; |
+ // The name of the CPU temperature zone monitored by this sensor. |
+ std::string label; |
Daniel Erat
2017/04/14 18:53:32
how's this going to be used? an opaque string labe
Simon Que
2017/04/17 16:41:07
Done.
|
+}; |
+ |
+// Read temperature from each thermal sensor of the CPU. Returns a vector |
+// containing a reading from each sensor. |
+std::vector<CPUTemperatureInfo> GetCPUTemperatures(); |
stevenjb
2017/04/14 15:44:04
This function does file operations and there is no
Simon Que
2017/04/17 16:41:07
I will leave it up to the caller to implement it w
|
+ |
+} // namespace system |
+} // namespace chromeos |
+ |
+#endif // CHROMEOS_SYSTEM_CPU_TEMP_READER_H_ |
+ |