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

Unified Diff: device/generic_sensor/public/interfaces/sensor.mojom

Issue 2865263002: Move //device/generic_sensor to be part of the internal implementation of the Device Service. (Closed)
Patch Set: code rebase Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: device/generic_sensor/public/interfaces/sensor.mojom
diff --git a/device/generic_sensor/public/interfaces/sensor.mojom b/device/generic_sensor/public/interfaces/sensor.mojom
deleted file mode 100644
index 533272a84bab4fa33d767f0b2e897cd8fe7ffc35..0000000000000000000000000000000000000000
--- a/device/generic_sensor/public/interfaces/sensor.mojom
+++ /dev/null
@@ -1,91 +0,0 @@
-// 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.
-
-module device.mojom;
-
-// Types of supported sensors
-// When adding new sensor type, update the documentation of sensor data values
-// in SensorReading struct at sensor_reading.h file.
-enum SensorType {
- FIRST = 1,
- AMBIENT_LIGHT = FIRST,
- PROXIMITY,
- ACCELEROMETER,
- LINEAR_ACCELERATION,
- GYROSCOPE,
- MAGNETOMETER,
- PRESSURE,
- ABSOLUTE_ORIENTATION,
- RELATIVE_ORIENTATION,
- LAST = RELATIVE_ORIENTATION // Note: LAST is also equal to the types count.
-};
-
-// Reporting mode supported by the Sensor.
-// ON_CHANGE - client will be notified through OnSensorReadingChanged() signal
-// whenever sensor reading is changed.
-// CONTINUOUS - sensor will continuously update its reading with frequency
-// specified in SensorConfiguration.frequency.
-// OnSensorReadingChanged() signal is not sent to the client for
-// sensors with CONTINUOUS reporting mode.
-enum ReportingMode {
- ON_CHANGE,
- CONTINUOUS
-};
-
-struct SensorConfiguration {
- // Maximum allowed frequency is 60 Hz.
- const double kMaxAllowedFrequency = 60.0;
-
- // Requested frequency in Hz.
- double frequency;
- // TODO(shalamov): Add map<string, union> for sensor specific configuration.
-};
-
-// Interface for controlling the Sensor.
-interface Sensor {
-
- // Requests sensor to provide its default configuration.
- GetDefaultConfiguration() => (SensorConfiguration configuration);
-
- // Requests sensor to start reading sensor data with specified
- // SensorConfiguration.
- // Sensor holds the list of added configurations and it always polls
- // the platform (and updates the shared buffer) at the maxiumum frequency
- // among the obtained from the stored configurations, so that all clients
- // can have sensor data in time.
- // Returns 'true' if |configuration| was successfully added.
- // Returns 'false' if |configuration| could not be added (is invalid
- // or not supported).
- AddConfiguration(SensorConfiguration configuration) => (bool success);
-
- // Requests sensor to stop reading sensor data for specified
- // SensorConfiguration.
- // This call excludes |configuration| from the Sensor's list making it
- // reconsider the the shared buffer udpate frequency. If there are no
- // configurations left in the Sensor's configuration list it stops polling
- // sensor data from the platform and update the shared buffer.
- // Returns 'true' if |configuration| was successfully removed;
- // returns 'false' if |configuration| could not be removed due to an error
- // (e.g. |configuration| is not present in the Sensor's list).
- RemoveConfiguration(SensorConfiguration configuration) => (bool success);
-
- // Temporary suppresses sensor reading changes notification and deactivates
- // all the previously added configurations for current instance.
- Suspend();
-
- // Resumes previously suspended sensor reading changes notification and
- // activates all the previously added configurations for current instance.
- Resume();
-};
-
-// Interface that client of the Sensor interface must implement to observe
-// sensor reading changes and error conditions.
-interface SensorClient {
- // Signals SensorClient when there is an error.
- RaiseError();
-
- // Signals SensorClient when reading has been changed (only for sensors with
- // ReportingMode::ON_CHANGE).
- SensorReadingChanged();
-};
« no previous file with comments | « device/generic_sensor/public/interfaces/OWNERS ('k') | device/generic_sensor/public/interfaces/sensor.typemap » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698