diff options
author | Li,Fei <feix.f.li@intel.com> | 2015-05-18 16:35:25 +0800 |
---|---|---|
committer | Zhengyin Qian <qianzy@google.com> | 2015-07-28 12:19:56 -0700 |
commit | 94781c7ca4a5c935ed25d96d9228525ca072fddd (patch) | |
tree | e8659e8a3d76dc9bf0d47586908fb1719ac7fb02 | |
parent | be1c9f4a763f7b2b82e4385d5e4ecf8bf2f1fd28 (diff) | |
download | sensors-94781c7ca4a5c935ed25d96d9228525ca072fddd.tar.gz |
Sensor: Change sensor type definition for tilt on Diamond
Updated sensor type definition for tilt since it is changed on Diamond.
Change-Id: I806616b54df5b40ae1265f7a84da920c9edf00dc
Tracked-On: https://jira01.devtools.intel.com/browse/MARVIN-662
Signed-off-by: Li,Fei <feix.f.li@intel.com>
Reviewed-on: https://android.intel.com:443/366781
-rw-r--r-- | tilt/TiltSensor.cpp | 4 | ||||
-rw-r--r-- | tilt/TiltSensor.h | 3 | ||||
-rw-r--r-- | tilt/clockwork_sensor.h | 65 | ||||
-rw-r--r-- | tilt/sensors.cpp | 4 |
4 files changed, 4 insertions, 72 deletions
diff --git a/tilt/TiltSensor.cpp b/tilt/TiltSensor.cpp index f566c22..895d5c4 100644 --- a/tilt/TiltSensor.cpp +++ b/tilt/TiltSensor.cpp @@ -36,7 +36,7 @@ TiltSensor::TiltSensor() { mPendingEvent.version = sizeof(sensors_event_t); mPendingEvent.sensor = ID_T; - mPendingEvent.type = SENSOR_TYPE_WRIST_TILT; + mPendingEvent.type = SENSOR_TYPE_WRIST_TILT_GESTURE; memset(mPendingEvent.data, 0, sizeof(mPendingEvent.data)); } @@ -203,7 +203,7 @@ int TiltSensor::readEvents(sensors_event_t* data, int count) while (count && mInputReader.readEvent(&event)) { int type = event->type; - if (type == EV_ABS) { + if (type == EV_MSC) { mPendingEvent.data[0] = 1.0f; /*mPendingEvent.data[event->code] = event->value;*/ } else if (type == EV_SYN) { diff --git a/tilt/TiltSensor.h b/tilt/TiltSensor.h index 6894aec..693d049 100644 --- a/tilt/TiltSensor.h +++ b/tilt/TiltSensor.h @@ -26,9 +26,6 @@ #include "SensorBase.h" #include "InputEventReader.h" -#include "clockwork_sensor.h" - - #define INPUT_SYSFS_BASE "/sys/class/i2c-adapter/i2c-4/4-001e" #define POLL_PERIOD_MS "poll_period_ms" #define RANGE "range" diff --git a/tilt/clockwork_sensor.h b/tilt/clockwork_sensor.h deleted file mode 100644 index 150b741..0000000 --- a/tilt/clockwork_sensor.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2015 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ANDROID_CLOCKWORK_SENSOR_INTERFACE_H -#define ANDROID_CLOCKWORK_SENSOR_INTERFACE_H - -#include <hardware/sensors.h> - -__BEGIN_DECLS - -/* - * SENSOR_TYPE_WRIST_TILT - * trigger-mode: special - * wake-up sensor: yes - * - * A sensor of this type triggers an event each time a tilt of the device - * is detected. - * - * Upon detecting a tilt event, a single event is returned containing the - * value of the 3 accelerometer axes when the tilt event was detected. - * - * All values are in SI units (m/s^2) and measure the acceleration of the - * device minus the force of gravity. - * - * x: Acceleration on the x-axis - * y: Acceleration on the y-axis - * z: Acceleration on the z-axis - * - * Note that the readings from the accelerometer include the acceleration - * due to gravity (which is opposite to the direction of the gravity vector). - * - * See "SENSOR_TYPE_ACCELEROMETER" for more detail on returned accelerometer - * data. - * - * setDelay() has no impact on this sensor type - * - * IMPORTANT NOTE: this sensor type is very different from other types - * in that it must work when the screen is off without the need of - * holding a partial wake-lock and MUST allow the SoC to go into suspend. - * When a tilt event is detected, the sensor must awaken the SoC and - * the event be reported. - * - * When the sensor is not activated, it must also be deactivated in the - * hardware: it must not wake up the SoC anymore, even in case of - * a tilt event. - */ -#define SENSOR_TYPE_WRIST_TILT (SENSOR_TYPE_DEVICE_PRIVATE_BASE) -#define SENSOR_STRING_TYPE_WRIST_TILT "com.google.android_wear.wrist.tilt" - -__END_DECLS - -#endif /* ANDROID_CLOCKWORK_SENSOR_INTERFACE_H */ diff --git a/tilt/sensors.cpp b/tilt/sensors.cpp index 03cbd4a..5075590 100644 --- a/tilt/sensors.cpp +++ b/tilt/sensors.cpp @@ -40,9 +40,9 @@ static struct sensor_t sSensorList[] = { { "TILT sensor", "STMicroelectronics", 1, SENSORS_TILT_HANDLE, - SENSOR_TYPE_WRIST_TILT, 1.0f, 1.0f, 1.0f, 0, 0, 0, + SENSOR_TYPE_WRIST_TILT_GESTURE, 1.0f, 1.0f, 1.0f, 0, 0, 0, #ifdef ANDROID_L - SENSOR_STRING_TYPE_WRIST_TILT, NULL, 0, SENSOR_FLAG_SPECIAL_REPORTING_MODE | SENSOR_FLAG_WAKE_UP, + SENSOR_STRING_TYPE_WRIST_TILT_GESTURE, NULL, 0, SENSOR_FLAG_SPECIAL_REPORTING_MODE | SENSOR_FLAG_WAKE_UP, #else NULL, NULL, 0, 0, #endif |