1 /* 2 * Copyright 2024 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 #pragma once 18 19 #include <stdint.h> 20 21 #include <vector> 22 23 namespace bluetooth { 24 namespace hci_vs { 25 26 typedef std::array<uint8_t, 16> Cookie; 27 28 class BluetoothHciVendorSpecificCallbacks { 29 public: 30 virtual ~BluetoothHciVendorSpecificCallbacks() = default; 31 32 virtual void onCommandStatus(uint16_t ocf, uint8_t status, Cookie cookie) = 0; 33 virtual void onCommandComplete(uint16_t ocf, std::vector<uint8_t> return_parameters, 34 Cookie cookie) = 0; 35 virtual void onEvent(uint8_t code, std::vector<uint8_t> data) = 0; 36 }; 37 38 class BluetoothHciVendorSpecificInterface { 39 public: 40 virtual ~BluetoothHciVendorSpecificInterface() = default; 41 42 virtual void init(BluetoothHciVendorSpecificCallbacks* callbacks) = 0; 43 44 virtual void sendCommand(uint16_t ocf, std::vector<uint8_t> parameters, Cookie cookie) = 0; 45 }; 46 47 } // namespace hci_vs 48 } // namespace bluetooth 49