Those were being left as real-time instead of being offset to
reflect time since boot, as required by Android.
Change-Id: I549f0270b508ecf94c1e69a42c8325088cfc24bb
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
int len, s;
int64_t ts;
struct iio_event_data event;
+ int64_t boot_to_rt_delta = get_timestamp_boot() - get_timestamp_realtime();
/* There's an incoming report on the specified iio device char dev fd */
if (fd == -1) {
return -1;
}
- ts = event.timestamp;
+ ts = event.timestamp + boot_to_rt_delta;
- ALOGV("Read event %lld from fd %d of iio device %d\n", event.id, fd, dev_num);
+ ALOGV("Read event %lld from fd %d of iio device %d - ts %lld\n", event.id, fd, dev_num, ts);
/* Map device report to sensor reports */
for (s = 0; s < MAX_SENSORS; s++)