summaryrefslogtreecommitdiffstats
path: root/libsensors/MPLSensor.h
diff options
context:
space:
mode:
authorKyle Repinski <repinski23@gmail.com>2015-12-06 11:53:02 -0600
committerZiyan <jaraidaniel@gmail.com>2016-01-17 22:41:00 +0100
commit36409dac6ce3c241d878d5997b6f7dca29321c6a (patch)
treee234231cac5bb328219054ef44d907e91b308178 /libsensors/MPLSensor.h
parent2f7955bc68164c19978120ab7c67a9061ced72a5 (diff)
downloaddevice_samsung_tuna-36409dac6ce3c241d878d5997b6f7dca29321c6a.zip
device_samsung_tuna-36409dac6ce3c241d878d5997b6f7dca29321c6a.tar.gz
device_samsung_tuna-36409dac6ce3c241d878d5997b6f7dca29321c6a.tar.bz2
libsensors: Big cleanup.
- Some formatting nitpicks. - Removed useless 'dev_name'/'dev_fd' stuff for SensorBase. - Merged sensor structs together. - Added handleToDriver for MPLSensor.
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*);