1 /* 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 22 namespace aidl::android::hardware::bluetooth::ranging::impl { 23 24 using ::aidl::android::hardware::bluetooth::ranging::ChannelSoudingRawData; 25 using ::aidl::android::hardware::bluetooth::ranging:: 26 ChannelSoundingProcedureData; 27 using ::aidl::android::hardware::bluetooth::ranging::Config; 28 using ::aidl::android::hardware::bluetooth::ranging::ProcedureEnableConfig; 29 using ::aidl::android::hardware::bluetooth::ranging::Reason; 30 using ::aidl::android::hardware::bluetooth::ranging::ResultType; 31 using ::aidl::android::hardware::bluetooth::ranging::VendorSpecificData; 32 33 class 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; 49 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; 56 57 private: 58 std::shared_ptr<IBluetoothChannelSoundingSessionCallback> callback_; 59 }; 60 61 } // namespace aidl::android::hardware::bluetooth::ranging::impl 62