1 /* 2 * Copyright (C) 2025 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 #pragma once 17 18 #include <cstddef> 19 #include <cstdint> 20 21 #include "bluetooth_socket_offload_link_callback.h" 22 23 namespace aidl::android::hardware::bluetooth::socket::impl { 24 25 /** 26 * This abstract class defines the interface between the Bluetooth Socket HAL 27 * and the offload domain. 28 */ 29 class BluetoothSocketOffloadLink { 30 public: 31 virtual ~BluetoothSocketOffloadLink() = default; 32 /** 33 * Initializes the link between HAL and the offload domain. 34 * 35 * @return true if success, otherwise false. 36 */ 37 virtual bool initOffloadLink() = 0; 38 39 /** 40 * Sends an encoded message regarding the status of an offloaded Bluetooth 41 * Socket to the offload stack. 42 * 43 * @return true if success, otherwise false. 44 */ 45 virtual bool sendMessageToOffloadStack(void *data, size_t size) = 0; 46 47 virtual void setBluetoothSocketCallback( 48 BluetoothSocketOffloadLinkCallback *btSocketCallback) = 0; 49 }; 50 51 } // namespace aidl::android::hardware::bluetooth::socket::impl 52