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

Side by Side Diff: device/generic_sensor/linux/sensor_data_linux.cc

Issue 2468283003: Revert of [sensors] Ambient light sensor implementation for ChromeOS and Linux. (Closed)
Patch Set: Created 4 years, 1 month 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 #include "device/generic_sensor/linux/sensor_data_linux.h"
6 #include "device/sensors/public/cpp/device_sensors_consts.h"
7
8 namespace device {
9
10 namespace {
11
12 using mojom::SensorType;
13
14 const base::FilePath::CharType* kSensorsBasePath =
15 FILE_PATH_LITERAL("/sys/bus/iio/devices");
16
17 const std::string kAmbientLightFileNames[] = {
18 "in_illuminance0_input", "in_illuminance_input", "in_illuminance0_raw",
19 "in_illuminance_raw", "illuminance0_input"};
20
21 } // namespace
22
23 SensorDataLinux::SensorDataLinux() : base_path_sensor_linux(kSensorsBasePath) {}
24
25 SensorDataLinux::~SensorDataLinux() = default;
26
27 SensorDataLinux::SensorDataLinux(const SensorDataLinux& other) = default;
28
29 bool InitSensorData(SensorType type, SensorDataLinux* data) {
30 DCHECK(data);
31
32 switch (type) {
33 case SensorType::AMBIENT_LIGHT: {
34 std::vector<std::string> file_names(
35 kAmbientLightFileNames,
36 kAmbientLightFileNames + arraysize(kAmbientLightFileNames));
37 data->sensor_file_names.push_back(std::move(file_names));
38 data->reporting_mode = mojom::ReportingMode::ON_CHANGE;
39 data->default_configuration =
40 PlatformSensorConfiguration(kDefaultAmbientLightFrequencyHz);
41 break;
42 }
43 default: {
44 NOTIMPLEMENTED();
45 return false;
46 }
47 }
48 return true;
49 }
50
51 } // namespace device
OLDNEW
« no previous file with comments | « device/generic_sensor/linux/sensor_data_linux.h ('k') | device/generic_sensor/linux/sensor_reader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698