• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2017 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef ANDROID_FRAMEWORKS_SENSORSERVICE_V1_0_DIRECTREPORTCHANNEL_H
18 #define ANDROID_FRAMEWORKS_SENSORSERVICE_V1_0_DIRECTREPORTCHANNEL_H
19 
20 #include <android/frameworks/sensorservice/1.0/IDirectReportChannel.h>
21 #include <android/frameworks/sensorservice/1.0/types.h>
22 #include <hidl/MQDescriptor.h>
23 #include <hidl/Status.h>
24 #include <sensor/SensorManager.h>
25 
26 namespace android {
27 namespace frameworks {
28 namespace sensorservice {
29 namespace V1_0 {
30 namespace implementation {
31 
32 using ::android::frameworks::sensorservice::V1_0::IDirectReportChannel;
33 using ::android::hardware::sensors::V1_0::RateLevel;
34 using ::android::hidl::base::V1_0::DebugInfo;
35 using ::android::hidl::base::V1_0::IBase;
36 using ::android::hardware::hidl_array;
37 using ::android::hardware::hidl_memory;
38 using ::android::hardware::hidl_string;
39 using ::android::hardware::hidl_vec;
40 using ::android::hardware::Return;
41 using ::android::hardware::Void;
42 using ::android::sp;
43 
44 struct DirectReportChannel final : public IDirectReportChannel {
45 
46     DirectReportChannel(::android::SensorManager& manager, int channelId);
47     ~DirectReportChannel();
48 
49     // Methods from ::android::frameworks::sensorservice::V1_0::IDirectReportChannel follow.
50     Return<void> configure(int32_t sensorHandle, RateLevel rate,
51             configure_cb _hidl_cb) override;
52 
53 private:
54     ::android::SensorManager& mManager;
55     const int mId;
56 };
57 
58 }  // namespace implementation
59 }  // namespace V1_0
60 }  // namespace sensorservice
61 }  // namespace frameworks
62 }  // namespace android
63 
64 #endif  // ANDROID_FRAMEWORKS_SENSORSERVICE_V1_0_DIRECTREPORTCHANNEL_H
65