Index: device/generic_sensor/platform_sensor_configuration.h |
diff --git a/device/generic_sensor/platform_sensor_configuration.h b/device/generic_sensor/platform_sensor_configuration.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d4cbcf65f6f1acb500c7597835a9ded94a92ff7d |
--- /dev/null |
+++ b/device/generic_sensor/platform_sensor_configuration.h |
@@ -0,0 +1,34 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef DEVICE_SENSORS_PLATFORM_SENSOR_CONFIGURATION_H_ |
timvolodine
2016/08/18 22:52:14
-> DEVICE_GENERIC_SENSOR_PLATFORM.. ?
Mikhail
2016/08/19 09:29:55
Done, thanks for noticing
|
+#define DEVICE_SENSORS_PLATFORM_SENSOR_CONFIGURATION_H_ |
+ |
+#include "base/logging.h" |
+#include "device/generic_sensor/sensor_export.h" |
+ |
+namespace device { |
+ |
+class DEVICE_SENSOR_EXPORT PlatformSensorConfiguration { |
+ public: |
+ PlatformSensorConfiguration(); |
timvolodine
2016/08/18 22:52:14
is this constructor needed? just keep the one with
Mikhail
2016/08/19 09:29:55
It is required by mojo generated binding, have to
|
+ explicit PlatformSensorConfiguration(double frequency); |
+ ~PlatformSensorConfiguration(); |
+ |
+ bool operator==(const PlatformSensorConfiguration& other) const; |
+ |
+ void set_frequency(double frequency) { |
+ DCHECK(frequency_ <= 60.0 && frequency_ > 0.0); |
timvolodine
2016/08/18 22:52:14
probably worth having some kind of constant for 60
Mikhail
2016/08/19 09:29:55
Done.
|
+ frequency_ = frequency; |
+ } |
+ |
+ double frequency() const { return frequency_; } |
+ |
+ private: |
+ double frequency_ = 1.0; // 1 Hz by default. |
timvolodine
2016/08/18 22:52:14
1 Hz seems a bit arbitrary, no need for this is on
|
+}; |
+ |
+} // namespace device |
+ |
+#endif // DEVICE_SENSORS_PLATFORM_SENSOR_CONFIGURATION_H_ |