LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_MODULE_TAGS := optional
LOCAL_CFLAGS := -DLOG_TAG=\"Sensors\" -fvisibility=hidden
+ifeq ($(NO_IIO_EVENTS),true)
+LOCAL_CFLAGS += -D__NO_EVENTS__
+endif
LOCAL_LDFLAGS := -Wl,--gc-sections
LOCAL_SHARED_LIBRARIES := liblog libcutils libdl
LOCAL_PRELINK_MODULE := false
#include "calibration.h"
#include "description.h"
#include "filtering.h"
+#ifndef __NO_EVENTS__
#include <linux/iio/events.h>
+#endif
#include <errno.h>
/* Currently active sensors count, per device */
}
/* Note: poll-mode fds are not readable */
+#ifdef __NO_EVENTS__
+ }
+#else
} else if (sensor[s].mode == MODE_EVENT) {
event_fd = events_fd[dev_num];
device_fd[dev_num] = -1;
}
}
+#endif
}
/* Ensure that on-change sensors send at least one event after enable */
return 0;
}
+#ifndef __NO_EVENTS__
static int integrate_device_report_from_event(int dev_num, int fd)
{
int len, s;
}
return 0;
}
+#endif
static int integrate_device_report(int dev_num)
{
return -1;
}
+#ifndef __NO_EVENTS__
if (events_fd[dev_num] != -1) {
ret = integrate_device_report_from_event(dev_num, events_fd[dev_num]);
if (ret < 0)
return ret;
}
+#endif
if (device_fd[dev_num] != -1)
ret = integrate_device_report_from_dev(dev_num, device_fd[dev_num]);
data->type = sensor_desc[s].type; /* sensor_desc[s].type can differ from sensor[s].type ; internal types are remapped */
data->timestamp = sensor[s].report_ts;
+#ifndef __NO_EVENTS__
if (sensor[s].mode == MODE_EVENT) {
ALOGV("Reporting event\n");
/* Android requires events to return 1.0 */
data->data[2] = 0.0;
return 1;
}
+#endif
/* Convert the data into the expected Android-level format */