1 /* 2 * Copyright (C) 2021-2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef OHOS_BLUETOOTH_STANDARD_BLE_CENTRAL_MANAGER_INTERFACE_H 17 #define OHOS_BLUETOOTH_STANDARD_BLE_CENTRAL_MANAGER_INTERFACE_H 18 19 #include "../parcel/bluetooth_ble_scan_filter.h" 20 #include "../parcel/bluetooth_ble_scan_settings.h" 21 #include "i_bluetooth_ble_central_manager_callback.h" 22 #include "iremote_broker.h" 23 24 namespace OHOS { 25 namespace Bluetooth { 26 class IBluetoothBleCentralManager : public OHOS::IRemoteBroker { 27 public: 28 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.ipc.IBluetootBleCentralManager"); 29 30 enum Code { 31 BLE_REGISTER_BLE_CENTRAL_MANAGER_CALLBACK = 0, 32 BLE_DE_REGISTER_BLE_CENTRAL_MANAGER_CALLBACK, 33 BLE_START_SCAN, 34 BLE_START_SCAN_WITH_SETTINGS, 35 BLE_STOP_SCAN, 36 BLE_CONFIG_SCAN_FILTER, 37 BLE_REMOVE_SCAN_FILTER, 38 BLE_PROXY_UID, 39 BLE_RESET_ALL_PROXY, 40 }; 41 42 virtual void RegisterBleCentralManagerCallback(const sptr<IBluetoothBleCentralManagerCallback> &callback) = 0; 43 virtual void DeregisterBleCentralManagerCallback(const sptr<IBluetoothBleCentralManagerCallback> &callback) = 0; 44 virtual int StartScan() = 0; 45 virtual int StartScan(const BluetoothBleScanSettings &settings) = 0; 46 virtual int StopScan() = 0; 47 virtual int ConfigScanFilter(const int clientId, const std::vector<BluetoothBleScanFilter> &filters) = 0; 48 virtual void RemoveScanFilter(const int clientId) = 0; 49 virtual bool ProxyUid(int32_t uid, bool isProxy) = 0; 50 virtual bool ResetAllProxy() = 0; 51 }; 52 } // namespace Bluetooth 53 } // namespace OHOS 54 #endif // OHOS_BLUETOOTH_STANDARD_BLE_CENTRAL_MANAGER_INTERFACE_H