OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 module sensors; |
| 6 |
| 7 enum SensorType { |
| 8 ACCELEROMETER, |
| 9 AMBIENT_TEMPERATURE, |
| 10 GAME_ROTATION_VECTOR, |
| 11 GEOMAGNETIC_ROTATION_VECTOR, |
| 12 GRAVITY, |
| 13 GYROSCOPE, |
| 14 GYROSCOPE_UNCALIBRATED, |
| 15 HEART_RATE, |
| 16 LIGHT, |
| 17 LINEAR_ACCELERATION, |
| 18 MAGNETIC_FIELD, |
| 19 MAGNETIC_FIELD_UNCALIBRATED, |
| 20 PRESSURE, |
| 21 PROXIMITY, |
| 22 RELATIVE_HUMIDITY, |
| 23 ROTATION_VECTOR, |
| 24 SIGNIFICANT_MOTION, |
| 25 STEP_COUNTER, |
| 26 STEP_DETECTOR, |
| 27 }; |
| 28 |
| 29 struct SensorData { |
| 30 int32 accuracy; |
| 31 int64 time_stamp; |
| 32 array<float> values; |
| 33 }; |
| 34 |
| 35 interface SensorListener { |
| 36 OnAccuracyChanged(int32 accuracy); |
| 37 OnSensorChanged(SensorData data); |
| 38 }; |
| 39 |
| 40 interface SensorService { |
| 41 AddListener(SensorType type, SensorListener listener); |
| 42 }; |
OLD | NEW |