1 /* 2 * Copyright 2022 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 "hci/hci_packets.h" 19 #include "hci/le_scanning_callback.h" 20 #include "module.h" 21 22 struct MsftAdvMonitor; 23 24 namespace bluetooth { 25 namespace hci { 26 27 class MsftExtensionManager : public bluetooth::Module { 28 public: 29 MsftExtensionManager(); 30 31 MsftExtensionManager(const MsftExtensionManager&) = delete; 32 MsftExtensionManager& operator=(const MsftExtensionManager&) = delete; 33 34 using MsftAdvMonitorAddCallback = 35 base::Callback<void(uint8_t /* monitor_handle */, ErrorCode /* status */)>; 36 using MsftAdvMonitorRemoveCallback = base::Callback<void(ErrorCode /* status */)>; 37 using MsftAdvMonitorEnableCallback = base::Callback<void(ErrorCode /* status */)>; 38 39 virtual bool SupportsMsftExtensions(); 40 void MsftAdvMonitorAdd(const MsftAdvMonitor& monitor, MsftAdvMonitorAddCallback cb); 41 void MsftAdvMonitorRemove(uint8_t monitor_handle, MsftAdvMonitorRemoveCallback cb); 42 void MsftAdvMonitorEnable(bool enable, MsftAdvMonitorEnableCallback cb); 43 void SetScanningCallback(ScanningCallback* callbacks); 44 45 static const ModuleFactory Factory; 46 47 protected: 48 void ListDependencies(ModuleList* list) const override; 49 50 void Start() override; 51 52 void Stop() override; 53 54 std::string ToString() const override; 55 56 private: 57 struct impl; 58 std::unique_ptr<impl> pimpl_; 59 }; 60 61 } // namespace hci 62 } // namespace bluetooth 63