summaryrefslogtreecommitdiffstats
path: root/libsensors/MPLSensor.h
diff options
context:
space:
mode:
Diffstat (limited to 'libsensors/MPLSensor.h')
-rw-r--r--libsensors/MPLSensor.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/libsensors/MPLSensor.h b/libsensors/MPLSensor.h
index eba750a..fc65708 100644
--- a/libsensors/MPLSensor.h
+++ b/libsensors/MPLSensor.h
@@ -118,8 +118,27 @@ private:
long int mOldEnabledMask;
android::KeyedVector<int, int> mIrqFds;
- /* added for dynamic get sensor list */
bool mNineAxisEnabled;
+
+ int handleToDriver(int handle) const {
+ switch (handle) {
+ case ID_A:
+ return Accelerometer;
+ case ID_M:
+ return MagneticField;
+ case ID_O:
+ return Orientation;
+ case ID_GY:
+ return Gyro;
+ case ID_GR:
+ return Gravity;
+ case ID_RV:
+ return RotationVector;
+ case ID_LA:
+ return LinearAccel;
+ }
+ return handle;
+ }
};
void setCallbackObject(MPLSensor*);