Implement sensor direct report mode

This change implements direct report for accel, gyro and mag at normal
and fast rate level. It supports ashmem shared memory.

The direct report and traditional sensor subscription are still
tangled up in this implementation.

Bug: 30985702
Bug: 33588372
Test: tested via demo app

Change-Id: Idc4f626dfe624558718c1b04f16898a0ea247e62
This commit is contained in:
Peng Xu
2016-11-03 11:56:49 -07:00
parent 0e3c473520
commit cf5df9cf40
9 changed files with 512 additions and 23 deletions

View File

@@ -45,6 +45,13 @@ private:
int flush(int handle);
int register_direct_channel(
const struct sensors_direct_mem_t* mem, int channel_handle);
int config_direct_report(
int sensor_handle, int channel_handle, const struct sensors_direct_cfg_t * config);
// static wrappers
static int CloseWrapper(struct hw_device_t *dev);
static int ActivateWrapper(
@@ -65,6 +72,11 @@ private:
static int FlushWrapper(struct sensors_poll_device_1 *dev, int handle);
static int RegisterDirectChannelWrapper(struct sensors_poll_device_1 *dev,
const struct sensors_direct_mem_t* mem, int channel_handle);
static int ConfigDirectReportWrapper(struct sensors_poll_device_1 *dev,
int sensor_handle, int channel_handle, const struct sensors_direct_cfg_t * config);
DISALLOW_EVIL_CONSTRUCTORS(SensorContext);
};