#define LOG_TAG "S103TSensors"
+#include <inttypes.h>
#include <linux/types.h>
#include <linux/input.h>
#include <fcntl.h>
#define ID_ACCELERATION (SENSORS_HANDLE_BASE + 0)
typedef struct SensorContext {
- struct sensors_poll_device_t device;
+ struct sensors_poll_device_1 device;
int fd;
uint32_t active_sensors;
sensors_event_t orientation;
return 0;
}
-static int context__setDelay(struct sensors_poll_device_t *dev, int handle, int64_t ns)
-{
- ALOGD("%s: called", __FUNCTION__);
- return 0;
-}
-
static int context__close(struct hw_device_t *dev)
{
ALOGD("%s: called", __FUNCTION__);
}
}
+static int context__batch(struct sensors_poll_device_1* dev, int sensor_handle,
+ int flags, int64_t sampling_period_ns, int64_t max_report_latency_ns)
+{
+ ALOGD("%s: dev=%p sensor_handle=%d flags=%d sampling_period_ns=%" PRId64 " max_report_latency_ns=%" PRId64,
+ __FUNCTION__, dev, sensor_handle, flags, sampling_period_ns, max_report_latency_ns);
+ return EXIT_SUCCESS;
+}
+
+static int context__flush(struct sensors_poll_device_1* dev, int sensor_handle)
+{
+ ALOGD("%s: dev=%p sensor_handle=%d", __FUNCTION__, dev, sensor_handle);
+ return EXIT_SUCCESS;
+}
+
static const struct sensor_t sSensorListInit[] = {
{ .name =
"S103T Orientation sensor",
memset(ctx, 0, sizeof(*ctx));
ctx->device.common.tag = HARDWARE_DEVICE_TAG;
- ctx->device.common.version = 0;
+ ctx->device.common.version = SENSORS_DEVICE_API_VERSION_1_3;
ctx->device.common.module = (struct hw_module_t*) module;
ctx->fd = -1;
const char *dirname = "/dev/input";
ctx->device.common.close = context__close;
ctx->device.activate = context__activate;
- ctx->device.setDelay = context__setDelay;
ctx->device.poll = context__poll;
+ ctx->device.batch = context__batch;
+ ctx->device.flush = context__flush;
ctx->orientation.version = sizeof(sensors_event_t);
ctx->orientation.sensor = ID_ACCELERATION;
ctx->orientation.type = SENSOR_TYPE_ACCELEROMETER;
struct sensors_module_t HAL_MODULE_INFO_SYM = {
.common = {
.tag = HARDWARE_MODULE_TAG,
- .version_major = 1,
- .version_minor = 0,
+ .module_api_version = 1,
+ .hal_api_version = 0,
.id = SENSORS_HARDWARE_MODULE_ID,
.name = "s103t SENSORS Module",
.author = "Oliver Dill",