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..75e893d2ddc1c52666c8fae816cdbbbff8fec297 |
--- /dev/null |
+++ b/device/generic_sensor/iio/sensor_data_iio.h |
@@ -0,0 +1,37 @@ |
+// 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/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 SensorDataIio { |
+ // 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. |
+ const char** sensor_file_names[3]; |
Reilly Grant (use Gerrit)
2016/10/24 21:49:27
Since we have a function that builds these structu
maksims (do not use this acc)
2016/10/25 06:23:54
Basically, the data is static and is defined only
Reilly Grant (use Gerrit)
2016/10/25 17:36:25
A vector of vectors is the right data structure fo
|
+ // Number of files in each |sensor_file_names| array. |
+ size_t sensor_file_names_cols; |
+ // Number of arrays in |sensor_file_names|. |
+ // Corresponds to the sensor reading fields number. |
+ size_t sensor_file_names_rows; |
+ // 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_ |