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