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

Side by Side Diff: device/generic_sensor/iio/platform_sensor_utils_iio.h

Issue 2370343002: [sensors] Ambient light sensor implementation for ChromeOS and Linux. (Closed)
Patch Set: Comments from Alex 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef DEVICE_GENERIC_SENSOR_IIO_PLATFORM_SENSOR_UTILS_IIO_H_
6 #define DEVICE_GENERIC_SENSOR_IIO_PLATFORM_SENSOR_UTILS_IIO_H_
7
8 #include "base/files/file_path.h"
9 #include "base/memory/ptr_util.h"
10
11 namespace device {
12
13 struct SensorDataIio;
14 struct SensorReading;
15
16 // Generic reader class that reads sensors data from
17 // sensors files located in the base iio folder.
18 class SensorReader {
19 public:
20 ~SensorReader();
21
22 // Creates a new instance of SensorReader if sensor read files
23 // has been found and |sensor_paths_| are set.
24 static std::unique_ptr<SensorReader> Create(const SensorDataIio& data);
25
26 // Reads sensor values into |*reading| from sensor files
27 // specified in |sensor_paths_|.
28 bool ReadSensorReading(SensorReading* reading);
29
30 private:
31 explicit SensorReader(std::vector<base::FilePath> sensor_paths);
32
33 // Contains paths to sensor files that are set when
34 // Create() is called.
35 const std::vector<base::FilePath> sensor_paths_;
36
37 DISALLOW_COPY_AND_ASSIGN(SensorReader);
38 };
39
40 } // namespace device
41
42 #endif // DEVICE_GENERIC_SENSOR_IIO_PLATFORM_SENSOR_UTILS_IIO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698