Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2451)

Unified Diff: device/generic_sensor/platform_sensor_utils_iio.h

Issue 2370343002: [sensors] Ambient light sensor implementation for ChromeOS and Linux. (Closed)
Patch Set: changed implementation Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: device/generic_sensor/platform_sensor_utils_iio.h
diff --git a/device/generic_sensor/platform_sensor_utils_iio.h b/device/generic_sensor/platform_sensor_utils_iio.h
new file mode 100644
index 0000000000000000000000000000000000000000..398595a37b55c2264b88336377762907856d93cd
--- /dev/null
+++ b/device/generic_sensor/platform_sensor_utils_iio.h
@@ -0,0 +1,33 @@
+// Copyright 2016 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 DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_UTILS_IIO_H_
+#define DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_UTILS_IIO_H_
+
+#include "base/files/file_path.h"
+#include "device/generic_sensor/public/interfaces/sensor.mojom.h"
+
+namespace device {
+
+class SensorReader {
Mikhail 2016/10/11 14:46:47 how is that different to ambient_light_reader_iio.
+ public:
+ static std::unique_ptr<SensorReader> Create(mojom::SensorType type);
+
+ bool ReadSensorValue(double* lux);
+
+ mojom::SensorType type() const;
+
+ private:
+ SensorReader(mojom::SensorType type,
+ std::vector<base::FilePath> sensor_paths);
Mikhail 2016/10/11 14:46:47 pass vector as const ref
+
+ const mojom::SensorType type_;
+ const std::vector<base::FilePath> sensor_paths_;
+
+ DISALLOW_COPY_AND_ASSIGN(SensorReader);
+};
+
+} // device
+
+#endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_UTILS_IIO_H_

Powered by Google App Engine
This is Rietveld 408576698