Sensor: Add batch support for native applications
Currently, it is not possible for native applications to use the
sensor in batch mode. As it is a 'C' header file so function
overloading is not possible. Therefore, lets add a new function to
enable the sensor, set the delay and batch timeout, all together.
Change-Id: I565ec2d945d57f31ae11ed43bf9ba351aebd67a0
Signed-off-by: Aniroop Mathur <a.mathur@samsung.com>
diff --git a/native/android/sensor.cpp b/native/android/sensor.cpp
index 76c701a..5cfe300 100644
--- a/native/android/sensor.cpp
+++ b/native/android/sensor.cpp
@@ -105,6 +105,14 @@
/*****************************************************************************/
+int ASensorEventQueue_registerSensor(ASensorEventQueue* queue, ASensor const* sensor,
+ int32_t samplingPeriodUs, int maxBatchReportLatencyUs)
+{
+ return static_cast<SensorEventQueue*>(queue)->enableSensor(
+ static_cast<Sensor const*>(sensor)->getHandle(), samplingPeriodUs,
+ maxBatchReportLatencyUs, 0);
+}
+
int ASensorEventQueue_enableSensor(ASensorEventQueue* queue, ASensor const* sensor)
{
return static_cast<SensorEventQueue*>(queue)->enableSensor(