Chromium Code Reviews| OLD | NEW |
|---|---|
| (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.mojom; | |
| 6 | |
| 7 import "sensor.mojom"; | |
| 8 | |
| 9 struct SensorReadBuffer { | |
| 10 // The shared memory handle used to fetch the sensor reading. | |
| 11 handle<shared_buffer> memory; | |
| 12 | |
| 13 // The offset at which shared buffer must be mapped. | |
| 14 uint64 offset; | |
|
timvolodine
2016/07/04 11:32:46
why is this needed? isn't the handle to shared buf
shalamov
2016/07/04 12:11:46
Please check comment above, we use one sharedbuffe
| |
| 15 | |
| 16 // The ReportingMode supported by the sensor. | |
| 17 ReportingMode mode; | |
| 18 | |
| 19 // Note: Each sensor's read buffer contains 4 tightly packed 64-bit floating | |
| 20 // point fields, its layout is: { double timestamp; double values[3] }. | |
|
timvolodine
2016/07/04 11:32:46
I am probably missing something, but where is this
shalamov
2016/07/04 12:11:46
For the sensors that are defined in SensorType enu
timvolodine
2016/07/05 11:45:08
I see, so is your plan to allocate the size of the
| |
| 21 // So it has a fixed size 4*8 = 32 bytes. | |
| 22 const uint64 kReadBufferSize = 32; | |
| 23 }; | |
| 24 | |
| 25 interface SensorProvider { | |
| 26 // Gets the sensor interface by the given type. | |
| 27 // | |
| 28 // |type| type of the sensor. | |
| 29 // | |
| 30 // |request| the Sensor interface instance to be initialized. | |
| 31 // |read_buffer| on success will contain the SensorReadBuffer describing the | |
| 32 // sensor reading buffer details, | |
| 33 // contains null on failure. | |
| 34 // |client_request| on success contains a request to be bound by the client, | |
| 35 // contains null on failure. | |
| 36 GetSensor(SensorType type, Sensor& sensor_request) => ( | |
|
timvolodine
2016/07/04 11:32:46
why not have something like RegisterListener(Senso
shalamov
2016/07/04 12:11:46
Then we will need to add unregisterListener, in ad
timvolodine
2016/07/05 11:45:08
ok I am trying to understand how it would actually
| |
| 37 SensorReadBuffer? read_buffer, | |
| 38 SensorClient&? client_request); | |
| 39 }; | |
| OLD | NEW |