Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee5c18f0 authored by Aniroop Mathur's avatar Aniroop Mathur Committed by Peng Xu
Browse files

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: default avatarAniroop Mathur <a.mathur@samsung.com>
parent 95972768
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -105,6 +105,14 @@ int ASensorManager_destroyEventQueue(ASensorManager* manager,

/*****************************************************************************/

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(