| 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 GYROSCOPE, | 14 GYROSCOPE, |
| 15 MAGNETOMETER, |
| 14 PRESSURE, | 16 PRESSURE, |
| 15 LAST = PRESSURE // Note: LAST is also equal to the types count. | 17 LAST = PRESSURE // Note: LAST is also equal to the types count. |
| 16 }; | 18 }; |
| 17 | 19 |
| 18 // Reporting mode supported by the Sensor. | 20 // Reporting mode supported by the Sensor. |
| 19 // ON_CHANGE - client will be notified through OnSensorReadingChanged() signal | 21 // ON_CHANGE - client will be notified through OnSensorReadingChanged() signal |
| 20 // whenever sensor reading is changed. | 22 // whenever sensor reading is changed. |
| 21 // CONTINUOUS - sensor will continuously update its reading with frequency | 23 // CONTINUOUS - sensor will continuously update its reading with frequency |
| 22 // specified in SensorConfiguration.frequency. | 24 // specified in SensorConfiguration.frequency. |
| 23 // OnSensorReadingChanged() signal is not sent to the client for | 25 // OnSensorReadingChanged() signal is not sent to the client for |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // Interface that client of the Sensor interface must implement to observe | 71 // Interface that client of the Sensor interface must implement to observe |
| 70 // sensor reading changes and error conditions. | 72 // sensor reading changes and error conditions. |
| 71 interface SensorClient { | 73 interface SensorClient { |
| 72 // Signals SensorClient when there is an error. | 74 // Signals SensorClient when there is an error. |
| 73 RaiseError(); | 75 RaiseError(); |
| 74 | 76 |
| 75 // Signals SensorClient when reading has been changed (only for sensors with | 77 // Signals SensorClient when reading has been changed (only for sensors with |
| 76 // ReportingMode::ON_CHANGE). | 78 // ReportingMode::ON_CHANGE). |
| 77 SensorReadingChanged(); | 79 SensorReadingChanged(); |
| 78 }; | 80 }; |
| OLD | NEW |