Skip to content

Commit

Permalink
Sensor: Add batch support for native applications
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Aniroop Mathur authored and Peng Xu committed Mar 17, 2016
1 parent 9597276 commit ee5c18f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions native/android/sensor.cpp
Expand Up @@ -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(
Expand Down

0 comments on commit ee5c18f

Please sign in to comment.