blob: ae66c7c59277ace579ef8bfa92a8b5e900da34c1 [file] [log] [blame]
Chienyuan Huanga9a27172023-11-27 09:32:09 +00001/*
2 * Copyright (C) 2023 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#include <aidl/android/hardware/bluetooth/ranging/BnBluetoothChannelSoundingSession.h>
18#include <aidl/android/hardware/bluetooth/ranging/IBluetoothChannelSoundingSessionCallback.h>
19
20#include <vector>
21
22namespace aidl::android::hardware::bluetooth::ranging::impl {
23
24using ::aidl::android::hardware::bluetooth::ranging::ChannelSoudingRawData;
Steven Liu14b3e642024-10-28 23:30:11 +000025using ::aidl::android::hardware::bluetooth::ranging::
26 ChannelSoundingProcedureData;
27using ::aidl::android::hardware::bluetooth::ranging::Config;
28using ::aidl::android::hardware::bluetooth::ranging::ProcedureEnableConfig;
Chienyuan Huanga9a27172023-11-27 09:32:09 +000029using ::aidl::android::hardware::bluetooth::ranging::Reason;
30using ::aidl::android::hardware::bluetooth::ranging::ResultType;
31using ::aidl::android::hardware::bluetooth::ranging::VendorSpecificData;
32
33class BluetoothChannelSoundingSession
34 : public BnBluetoothChannelSoundingSession {
35 public:
36 BluetoothChannelSoundingSession(
37 std::shared_ptr<IBluetoothChannelSoundingSessionCallback> callback,
38 Reason reason);
39
40 ndk::ScopedAStatus getVendorSpecificReplies(
41 std::optional<std::vector<std::optional<VendorSpecificData>>>*
42 _aidl_return) override;
43 ndk::ScopedAStatus getSupportedResultTypes(
44 std::vector<ResultType>* _aidl_return) override;
45 ndk::ScopedAStatus isAbortedProcedureRequired(bool* _aidl_return) override;
46 ndk::ScopedAStatus writeRawData(
47 const ChannelSoudingRawData& in_rawData) override;
48 ndk::ScopedAStatus close(Reason in_reason) override;
Steven Liu14b3e642024-10-28 23:30:11 +000049 ndk::ScopedAStatus writeProcedureData(
50 const ChannelSoundingProcedureData& in_procedureData) override;
51 ndk::ScopedAStatus updateChannelSoundingConfig(
52 const Config& in_config) override;
53 ndk::ScopedAStatus updateProcedureEnableConfig(
54 const ProcedureEnableConfig& in_procedureEnableConfig) override;
55 ndk::ScopedAStatus updateBleConnInterval(int in_bleConnInterval) override;
Chienyuan Huanga9a27172023-11-27 09:32:09 +000056
57 private:
58 std::shared_ptr<IBluetoothChannelSoundingSessionCallback> callback_;
59};
60
61} // namespace aidl::android::hardware::bluetooth::ranging::impl