| 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 enum SensorType { | 8 enum SensorType { |
| 9 FIRST = 1, | 9 FIRST = 1, |
| 10 AMBIENT_LIGHT = FIRST, | 10 AMBIENT_LIGHT = FIRST, |
| 11 PROXIMITY, | 11 PROXIMITY, |
| 12 ACCELEROMETER, | 12 ACCELEROMETER, |
| 13 LINEAR_ACCELERATION, | 13 LINEAR_ACCELERATION, |
| 14 GYROSCOPE, | 14 GYROSCOPE, |
| 15 MAGNETOMETER, | 15 MAGNETOMETER, |
| 16 PRESSURE, | 16 PRESSURE, |
| 17 LAST = PRESSURE // Note: LAST is also equal to the types count. | 17 ABSOLUTE_ORIENTATION, |
| 18 LAST = ABSOLUTE_ORIENTATION // Note: LAST is also equal to the types count. |
| 18 }; | 19 }; |
| 19 | 20 |
| 20 // Reporting mode supported by the Sensor. | 21 // Reporting mode supported by the Sensor. |
| 21 // ON_CHANGE - client will be notified through OnSensorReadingChanged() signal | 22 // ON_CHANGE - client will be notified through OnSensorReadingChanged() signal |
| 22 // whenever sensor reading is changed. | 23 // whenever sensor reading is changed. |
| 23 // CONTINUOUS - sensor will continuously update its reading with frequency | 24 // CONTINUOUS - sensor will continuously update its reading with frequency |
| 24 // specified in SensorConfiguration.frequency. | 25 // specified in SensorConfiguration.frequency. |
| 25 // OnSensorReadingChanged() signal is not sent to the client for | 26 // OnSensorReadingChanged() signal is not sent to the client for |
| 26 // sensors with CONTINUOUS reporting mode. | 27 // sensors with CONTINUOUS reporting mode. |
| 27 enum ReportingMode { | 28 enum ReportingMode { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // Interface that client of the Sensor interface must implement to observe | 79 // Interface that client of the Sensor interface must implement to observe |
| 79 // sensor reading changes and error conditions. | 80 // sensor reading changes and error conditions. |
| 80 interface SensorClient { | 81 interface SensorClient { |
| 81 // Signals SensorClient when there is an error. | 82 // Signals SensorClient when there is an error. |
| 82 RaiseError(); | 83 RaiseError(); |
| 83 | 84 |
| 84 // Signals SensorClient when reading has been changed (only for sensors with | 85 // Signals SensorClient when reading has been changed (only for sensors with |
| 85 // ReportingMode::ON_CHANGE). | 86 // ReportingMode::ON_CHANGE). |
| 86 SensorReadingChanged(); | 87 SensorReadingChanged(); |
| 87 }; | 88 }; |
| OLD | NEW |