summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tilt/TiltSensor.cpp57
-rw-r--r--tilt/TiltSensor.h4
2 files changed, 0 insertions, 61 deletions
diff --git a/tilt/TiltSensor.cpp b/tilt/TiltSensor.cpp
index f4967b6..93aefc8 100644
--- a/tilt/TiltSensor.cpp
+++ b/tilt/TiltSensor.cpp
@@ -27,8 +27,6 @@
#include "TiltSensor.h"
-
-
TiltSensor::TiltSensor()
: SensorBase(NULL, "lis3dsh_acc"),
mEnabled(0),
@@ -46,32 +44,6 @@ TiltSensor::~TiltSensor() {
}
}
-int TiltSensor::setDelay(int32_t /* handle */, int64_t ns)
-{
- int fd;
- int n, len, ms, ret = 0;
- char buf[6];
- char sysfs_path[SYSFS_MAX_PATH_LEN];
-
- ms = ns / 1000000;
-
- snprintf(sysfs_path, SYSFS_MAX_PATH_LEN, "%s/%s", INPUT_SYSFS_BASE, POLL_PERIOD_MS);
- fd = open(sysfs_path, O_RDWR);
- if (fd > 0) {
- len = 6;
- memset(buf, 0, len);
- snprintf(buf, len, "%d", ms);
- write(fd, buf, sizeof(buf));
- close(fd);
- } else {
- ret = -EIO;
- ALOGE("file open failure\n");
- goto error_free;
- }
-
-error_free:
- return ret;
-}
int TiltSensor::enable(int32_t /* handle */, int en)
{
int ret = 0;
@@ -136,35 +108,6 @@ int TiltSensor::isActivated(int /* handle */)
return mEnabled;
}
-#ifdef HAL_VERSION_GT_1_0
-int TiltSensor::batch(int /* handle */, int /* flags */, int64_t period_ns, int64_t /* timeout */)
-{
- int fd;
- int n, len, ms, ret = 0;
- char buf[6];
- char sysfs_path[SYSFS_MAX_PATH_LEN];
-
- ms = period_ns / 1000000;
-
- snprintf(sysfs_path, SYSFS_MAX_PATH_LEN, "%s/%s", INPUT_SYSFS_BASE, POLL_PERIOD_MS);
- fd = open(sysfs_path, O_RDWR);
- if (fd > 0) {
- len = 6;
- memset(buf, 0, len);
- snprintf(buf, len, "%d", ms);
- write(fd, buf, sizeof(buf));
- close(fd);
- } else {
- ret = -EIO;
- ALOGE("file open failure\n");
- goto error_free;
- }
-
-error_free:
- return ret;
-}
-#endif
-
int TiltSensor::readEvents(sensors_event_t* data, int count)
{
if (count < 1)
diff --git a/tilt/TiltSensor.h b/tilt/TiltSensor.h
index 2d0b4e2..707ba8b 100644
--- a/tilt/TiltSensor.h
+++ b/tilt/TiltSensor.h
@@ -47,12 +47,8 @@ public:
virtual ~TiltSensor();
virtual int readEvents(sensors_event_t* data, int count);
- virtual int setDelay(int32_t handle, int64_t ns);
virtual int enable(int32_t handle, int enabled);
virtual int isActivated(int handle);
-#ifdef HAL_VERSION_GT_1_0
- virtual int batch(int handle, int flags, int64_t period_ns, int64_t timeout);
-#endif
private:
int mEnabled;