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

Side by Side Diff: device/sensors/sensor.mojom

Issue 2051083002: WIP : Generic Sensor API implementation Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 4 years, 6 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 module device.sensors;
6
7 enum SensorType {
8 FIRST = 1,
9 AMBIENT_LIGHT = FIRST,
10 PROXIMITY,
11 LINEAR_ACCELERATION,
12 GYROSCOPE,
13 PRESSURE,
14 LAST = PRESSURE // Note: LAST is also equal to the types count.
15 };
16
17
18 // Sensor reading buffer is putting fields of 64-bit floating point type in the following order:
19 // 1) timestamp, 2) other fields
20 const uint8 kSensorReadingFieldsCount = 4;
21 const uint8 kSensorReadingFieldSize = 8;
22
23 struct SensorConfiguration {
24 double frequency;
25 // TODO(shalamov): Add map<string, union> for extra sensor specific configurat ion.
26 };
27
28 interface Sensor {
29 SetClient(SensorClient client);
30 Start(SensorConfiguration configuration) => (bool result);
31 Stop(SensorConfiguration configuration) => (bool result);
32 };
33
34 interface SensorClient {
35 OnSensorError();
36 OnSensorReadingChanged();
37 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698