| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef DEVICE_GENERIC_SENSOR_LINUX_SENSOR_DATA_LINUX_H_ | 5 #ifndef DEVICE_GENERIC_SENSOR_LINUX_SENSOR_DATA_LINUX_H_ |
| 6 #define DEVICE_GENERIC_SENSOR_LINUX_SENSOR_DATA_LINUX_H_ | 6 #define DEVICE_GENERIC_SENSOR_LINUX_SENSOR_DATA_LINUX_H_ |
| 7 | 7 |
| 8 #include "device/generic_sensor/generic_sensor_export.h" | 8 #include "device/generic_sensor/generic_sensor_export.h" |
| 9 #include "device/generic_sensor/public/interfaces/sensor.mojom.h" | 9 #include "device/generic_sensor/public/interfaces/sensor.mojom.h" |
| 10 | 10 |
| 11 namespace device { | 11 namespace device { |
| 12 | 12 |
| 13 class PlatformSensorConfiguration; | 13 class PlatformSensorConfiguration; |
| 14 struct SensorReading; | 14 struct SensorReading; |
| 15 | 15 |
| 16 // This structure represents a context that is used to identify a udev device | 16 // This structure represents a context that is used to identify a udev device |
| 17 // and create a type specific SensorInfoLinux. For example, when a | 17 // and create a type specific SensorInfoLinux. For example, when a |
| 18 // SensorDeviceManager receives a udev device, it uses this structure to | 18 // SensorDeviceManager receives a udev device, it uses this structure to |
| 19 // identify what type of sensor that is and creates a SensorInfoLinux structure | 19 // identify what type of sensor that is and creates a SensorInfoLinux structure |
| 20 // that holds all the necessary information to create a PlatformSensorLinux. | 20 // that holds all the necessary information to create a PlatformSensorLinux. |
| 21 struct DEVICE_GENERIC_SENSOR_EXPORT SensorPathsLinux { | 21 struct DEVICE_GENERIC_SENSOR_EXPORT SensorPathsLinux { |
| 22 using ReaderFunctor = base::Callback< | 22 using ReaderFunctor = base::Callback< |
| 23 void(double scaling, double offset, SensorReading& reading)>; | 23 void(double scaling, double offset, SensorReading& reading)>; |
| 24 | 24 |
| 25 SensorPathsLinux(); | 25 SensorPathsLinux(); |
| 26 ~SensorPathsLinux(); | 26 ~SensorPathsLinux(); |
| 27 SensorPathsLinux(const SensorPathsLinux& other); | 27 SensorPathsLinux(const SensorPathsLinux& other); |
| 28 // Provides a base path to all sensors. | |
| 29 const base::FilePath::CharType* base_path_sensor_linux; | |
| 30 // Provides an array of sensor file names to be searched for. | 28 // Provides an array of sensor file names to be searched for. |
| 31 // Different sensors might have up to 3 different file name arrays. | 29 // Different sensors might have up to 3 different file name arrays. |
| 32 // One file must be found from each array. | 30 // One file must be found from each array. |
| 33 std::vector<std::vector<std::string>> sensor_file_names; | 31 std::vector<std::vector<std::string>> sensor_file_names; |
| 34 // Scaling file to be found. | 32 // Scaling file to be found. |
| 35 std::string sensor_scale_name; | 33 std::string sensor_scale_name; |
| 36 // Frequency file to be found. | 34 // Frequency file to be found. |
| 37 std::string sensor_frequency_file_name; | 35 std::string sensor_frequency_file_name; |
| 38 // Offset file to be found. | 36 // Offset file to be found. |
| 39 std::string sensor_offset_file_name; | 37 std::string sensor_offset_file_name; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 double sensor_device_offset_value, | 73 double sensor_device_offset_value, |
| 76 mojom::ReportingMode mode, | 74 mojom::ReportingMode mode, |
| 77 SensorPathsLinux::ReaderFunctor scaling_func, | 75 SensorPathsLinux::ReaderFunctor scaling_func, |
| 78 std::vector<base::FilePath> iio_device_reading_files); | 76 std::vector<base::FilePath> iio_device_reading_files); |
| 79 ~SensorInfoLinux(); | 77 ~SensorInfoLinux(); |
| 80 }; | 78 }; |
| 81 | 79 |
| 82 } // namespace device | 80 } // namespace device |
| 83 | 81 |
| 84 #endif // DEVICE_GENERIC_SENSOR_LINUX_SENSOR_DATA_LINUX_H_ | 82 #endif // DEVICE_GENERIC_SENSOR_LINUX_SENSOR_DATA_LINUX_H_ |
| OLD | NEW |