| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 module device.mojom; | 5 module device.mojom; |
| 6 | 6 |
| 7 // Types of supported sensors | 7 // Types of supported sensors |
| 8 // When adding new sensor type, update the documentation of sensor data values |
| 9 // in SensorReading struct at sensor_reading.h file. |
| 8 enum SensorType { | 10 enum SensorType { |
| 9 FIRST = 1, | 11 FIRST = 1, |
| 10 AMBIENT_LIGHT = FIRST, | 12 AMBIENT_LIGHT = FIRST, |
| 11 PROXIMITY, | 13 PROXIMITY, |
| 12 ACCELEROMETER, | 14 ACCELEROMETER, |
| 13 LINEAR_ACCELERATION, | 15 LINEAR_ACCELERATION, |
| 14 GYROSCOPE, | 16 GYROSCOPE, |
| 15 MAGNETOMETER, | 17 MAGNETOMETER, |
| 16 PRESSURE, | 18 PRESSURE, |
| 17 ABSOLUTE_ORIENTATION, | 19 ABSOLUTE_ORIENTATION, |
| 18 LAST = ABSOLUTE_ORIENTATION // Note: LAST is also equal to the types count. | 20 RELATIVE_ORIENTATION, |
| 21 LAST = RELATIVE_ORIENTATION // Note: LAST is also equal to the types count. |
| 19 }; | 22 }; |
| 20 | 23 |
| 21 // Reporting mode supported by the Sensor. | 24 // Reporting mode supported by the Sensor. |
| 22 // ON_CHANGE - client will be notified through OnSensorReadingChanged() signal | 25 // ON_CHANGE - client will be notified through OnSensorReadingChanged() signal |
| 23 // whenever sensor reading is changed. | 26 // whenever sensor reading is changed. |
| 24 // CONTINUOUS - sensor will continuously update its reading with frequency | 27 // CONTINUOUS - sensor will continuously update its reading with frequency |
| 25 // specified in SensorConfiguration.frequency. | 28 // specified in SensorConfiguration.frequency. |
| 26 // OnSensorReadingChanged() signal is not sent to the client for | 29 // OnSensorReadingChanged() signal is not sent to the client for |
| 27 // sensors with CONTINUOUS reporting mode. | 30 // sensors with CONTINUOUS reporting mode. |
| 28 enum ReportingMode { | 31 enum ReportingMode { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // Interface that client of the Sensor interface must implement to observe | 82 // Interface that client of the Sensor interface must implement to observe |
| 80 // sensor reading changes and error conditions. | 83 // sensor reading changes and error conditions. |
| 81 interface SensorClient { | 84 interface SensorClient { |
| 82 // Signals SensorClient when there is an error. | 85 // Signals SensorClient when there is an error. |
| 83 RaiseError(); | 86 RaiseError(); |
| 84 | 87 |
| 85 // Signals SensorClient when reading has been changed (only for sensors with | 88 // Signals SensorClient when reading has been changed (only for sensors with |
| 86 // ReportingMode::ON_CHANGE). | 89 // ReportingMode::ON_CHANGE). |
| 87 SensorReadingChanged(); | 90 SensorReadingChanged(); |
| 88 }; | 91 }; |
| OLD | NEW |