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 #ifndef DEVICE_GENERIC_SENSOR_PUBLIC_CPP_SENSOR_READING_H_ | 5 #ifndef DEVICE_GENERIC_SENSOR_PUBLIC_CPP_SENSOR_READING_H_ |
6 #define DEVICE_GENERIC_SENSOR_PUBLIC_CPP_SENSOR_READING_H_ | 6 #define DEVICE_GENERIC_SENSOR_PUBLIC_CPP_SENSOR_READING_H_ |
7 | 7 |
8 #include "device/base/synchronization/one_writer_seqlock.h" | 8 #include "device/base/synchronization/one_writer_seqlock.h" |
9 #include "device/generic_sensor/public/cpp/generic_sensor_public_export.h" | 9 #include "device/generic_sensor/public/cpp/generic_sensor_public_export.h" |
10 #include "device/generic_sensor/public/interfaces/sensor.mojom.h" | 10 #include "device/generic_sensor/public/interfaces/sensor.mojom.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 struct DEVICE_GENERIC_SENSOR_PUBLIC_EXPORT SensorReadingSharedBuffer { | 104 struct DEVICE_GENERIC_SENSOR_PUBLIC_EXPORT SensorReadingSharedBuffer { |
105 SensorReadingSharedBuffer(); | 105 SensorReadingSharedBuffer(); |
106 ~SensorReadingSharedBuffer(); | 106 ~SensorReadingSharedBuffer(); |
107 SensorReadingField<OneWriterSeqLock> seqlock; | 107 SensorReadingField<OneWriterSeqLock> seqlock; |
108 SensorReading reading; | 108 SensorReading reading; |
109 | 109 |
110 // Gets the shared reading buffer offset for the given sensor type. | 110 // Gets the shared reading buffer offset for the given sensor type. |
111 static uint64_t GetOffset(mojom::SensorType type); | 111 static uint64_t GetOffset(mojom::SensorType type); |
112 }; | 112 }; |
113 | 113 |
| 114 bool DEVICE_GENERIC_SENSOR_PUBLIC_EXPORT |
| 115 GetSensorReadingFromBuffer(const SensorReadingSharedBuffer* buffer, |
| 116 SensorReading* result); |
| 117 |
114 } // namespace device | 118 } // namespace device |
115 | 119 |
116 #endif // DEVICE_GENERIC_SENSOR_PUBLIC_CPP_SENSOR_READING_H_ | 120 #endif // DEVICE_GENERIC_SENSOR_PUBLIC_CPP_SENSOR_READING_H_ |
OLD | NEW |