OLD | NEW |
(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_PLATFORM_SENSOR_AMBIENT_LIGHT_SENSOR_IIO_H_ |
| 6 #define DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_AMBIENT_LIGHT_SENSOR_IIO_H_ |
| 7 |
| 8 #include <device/generic_sensor/platform_sensor_iio.h> |
| 9 #include <device/generic_sensor/platform_sensor_utils_iio.h> |
| 10 #include "base/memory/ref_counted.h" |
| 11 |
| 12 namespace device { |
| 13 |
| 14 class PlatformSensorAmbientLightIio : public PlatformSensorIio { |
| 15 public: |
| 16 PlatformSensorAmbientLightIio( |
| 17 mojom::SensorType type, |
| 18 mojo::ScopedSharedBufferMapping mapping, |
| 19 PlatformSensorProvider* provider, |
| 20 scoped_refptr<base::SingleThreadTaskRunner> polling_task_runner, |
| 21 std::unique_ptr<SensorReader> sensor_reader); |
| 22 |
| 23 // PollingPlatformSensor implements: |
| 24 void UpdateReading() override; |
| 25 |
| 26 // PlatformSensor implements: |
| 27 mojom::ReportingMode GetReportingMode() override; |
| 28 |
| 29 protected: |
| 30 // PlatformSensor implements: |
| 31 ~PlatformSensorAmbientLightIio() override; |
| 32 PlatformSensorConfiguration GetDefaultConfiguration() override; |
| 33 |
| 34 private: |
| 35 double lux_value_; |
| 36 std::unique_ptr<SensorReader> sensor_reader_; |
| 37 base::WeakPtrFactory<PlatformSensorAmbientLightIio> weak_factory_; |
| 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(PlatformSensorAmbientLightIio); |
| 40 }; |
| 41 |
| 42 } // namespace device |
| 43 |
| 44 #endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_AMBIENT_LIGHT_SENSOR_IIO_H_ |
OLD | NEW |