diff options
author | Peng Xu <pengxu@google.com> | 2017-04-04 01:31:54 -0700 |
---|---|---|
committer | Peng Xu <pengxu@google.com> | 2017-04-20 23:23:53 +0000 |
commit | 4715d1734d2c60cc91ef70d409678d8eda382fde (patch) | |
tree | 4a7968a6472431119e43f4ad0ad9520fee541c44 /modules/sensors/dynamic_sensor/ConnectionDetector.cpp | |
parent | c87b15a2245b6fac68bd2e259cb0f4b4efbcf045 (diff) |
HID dynamic sensor: add support to three types of sensor
Implemented HID dynamic sensor using linux hidraw driver and
HidUtils. Support the following cases:
1) HID Sensor spec defined accelerometer, gyroscope, magnetometer
and orientation (quaternion).
2) Android defined type sensors (HID sensor custom type): ambient
temperature, barometer, light and heart rate sensor.
3) Android custom type sensor (based on HID sensor custom type).
Test: run tests/examples in test/
Test: test with a USB HID hardware (launchpad sensor) and marlin
Bug: 37482951
Bug: 31026607
Change-Id: I9d679fb34d15324a9df1cf19647ea638fd1a0e68
Diffstat (limited to 'modules/sensors/dynamic_sensor/ConnectionDetector.cpp')
-rw-r--r-- | modules/sensors/dynamic_sensor/ConnectionDetector.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/sensors/dynamic_sensor/ConnectionDetector.cpp b/modules/sensors/dynamic_sensor/ConnectionDetector.cpp index 60994930..67a6f272 100644 --- a/modules/sensors/dynamic_sensor/ConnectionDetector.cpp +++ b/modules/sensors/dynamic_sensor/ConnectionDetector.cpp @@ -31,7 +31,7 @@ namespace SensorHalExt { // SocketConnectionDetector functions SocketConnectionDetector::SocketConnectionDetector(BaseDynamicSensorDaemon *d, int port) - : ConnectionDetector(d) { + : ConnectionDetector(d), Thread(false /*canCallJava*/) { // initialize socket that accept connection to localhost:port mListenFd = ::socket(AF_INET, SOCK_STREAM, 0); if (mListenFd < 0) { @@ -105,7 +105,7 @@ bool SocketConnectionDetector::threadLoop() { // FileConnectionDetector functions FileConnectionDetector::FileConnectionDetector ( BaseDynamicSensorDaemon *d, const std::string &path, const std::string ®ex) - : ConnectionDetector(d), mPath(path), mRegex(regex) { + : ConnectionDetector(d), Thread(false /*callCallJava*/), mPath(path), mRegex(regex) { mInotifyFd = ::inotify_init1(IN_NONBLOCK); if (mInotifyFd < 0) { ALOGE("Cannot init inotify"); |