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

Unified Diff: device/generic_sensor/iio/sensor_data_iio.h

Issue 2370343002: [sensors] Ambient light sensor implementation for ChromeOS and Linux. (Closed)
Patch Set: change SetTaskRunner to SetFileTaskRunner as per offline discussion with Mikhail 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/iio/sensor_data_iio.h
diff --git a/device/generic_sensor/iio/sensor_data_iio.h b/device/generic_sensor/iio/sensor_data_iio.h
new file mode 100644
index 0000000000000000000000000000000000000000..54166aad1871d2bb7fbab42acf9fcd5614ed94bd
--- /dev/null
+++ b/device/generic_sensor/iio/sensor_data_iio.h
@@ -0,0 +1,38 @@
+// 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_IIO_SENSOR_DATA_IIO_H_
+#define DEVICE_GENERIC_SENSOR_IIO_SENSOR_DATA_IIO_H_
+
+#include "device/generic_sensor/generic_sensor_export.h"
+#include "device/generic_sensor/public/interfaces/sensor.mojom.h"
+
+namespace device {
+
+// This structure represents a context that is used to
+// create a type specific SensorReader and a concrete
+// sensor that uses the SensorReader to read sensor
+// data from files specified in the |sensor_file_names|.
+struct DEVICE_GENERIC_SENSOR_EXPORT SensorDataIio {
+ SensorDataIio();
+ ~SensorDataIio();
+ SensorDataIio(const SensorDataIio& other);
+ // Provides a base path to all sensors.
+ const base::FilePath::CharType* base_path_sensor_iio;
+ // Provides an array of sensor file names to be searched for.
+ // Different sensors might have up to 3 different file name arrays.
+ // One file must be found from each array.
+ std::vector<std::vector<std::string>> sensor_file_names;
+ // Reporting mode of a sensor.
+ mojom::ReportingMode reporting_mode;
+ // Default configuration of a sensor.
+ PlatformSensorConfiguration default_configuration;
+};
+
+// Initializes a sensor type specific data.
+bool InitSensorData(mojom::SensorType type, SensorDataIio* data);
+
+} // namespace device
+
+#endif // DEVICE_GENERIC_SENSOR_IIO_SENSOR_DATA_IIO_H_

Powered by Google App Engine
This is Rietveld 408576698