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

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: add comments to unittest 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 "device/generic_sensor/iio/sensor_data_iio.h"
shalamov 2016/10/19 16:37:11 forward declare
maksims (do not use this acc) 2016/10/20 09:50:36 Done.
10 #include "device/generic_sensor/public/cpp/sensor_reading.h"
shalamov 2016/10/19 16:37:11 ditto
maksims (do not use this acc) 2016/10/20 09:50:36 Done.
11
12 namespace device {
13
14 // Generic reader class that reads sensors data from
15 // sensors files located in the base iio folder.
16 class SensorReader {
17 public:
18 ~SensorReader();
19
20 // Creates a new instance of SensorReader if sensor read files
21 // has been found and |sensor_paths_| are set.
22 static std::unique_ptr<SensorReader> Create(const SensorDataIio& data);
23
24 // Reads sensor values into |*reading| from sensor files
25 // specified in |sensor_paths_|.
26 bool ReadSensorReading(SensorReading* reading);
27
28 private:
29 explicit SensorReader(std::vector<base::FilePath> sensor_paths);
30
31 // Contains paths to sensor files that are set when
32 // Create() is called.
33 const std::vector<base::FilePath> sensor_paths_;
34
35 DISALLOW_COPY_AND_ASSIGN(SensorReader);
36 };
37
38 } // namespace device
39
40 #endif // DEVICE_GENERIC_SENSOR_IIO_PLATFORM_SENSOR_UTILS_IIO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698