1 /* 2 * Copyright (C) 2021 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_ADVERTISER_INTERFACE_H 17 #define OHOS_BLUETOOTH_STANDARD_BLE_ADVERTISER_INTERFACE_H 18 19 #include "../parcel/bluetooth_ble_advertiser_data.h" 20 #include "../parcel/bluetooth_ble_advertiser_settings.h" 21 #include "bluetooth_ble_advertiser_data.h" 22 #include "bluetooth_ble_advertiser_settings.h" 23 #include "bluetooth_service_ipc_interface_code.h" 24 #include "i_bluetooth_ble_advertise_callback.h" 25 #include "iremote_broker.h" 26 27 namespace OHOS { 28 namespace Bluetooth { 29 class IBluetoothBleAdvertiser : public OHOS::IRemoteBroker { 30 public: 31 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.ipc.IBluetoothBleAdvertiser"); 32 33 virtual void RegisterBleAdvertiserCallback(const sptr<IBluetoothBleAdvertiseCallback> &callback) = 0; 34 virtual void DeregisterBleAdvertiserCallback(const sptr<IBluetoothBleAdvertiseCallback> &callback) = 0; 35 virtual int StartAdvertising(const BluetoothBleAdvertiserSettings &settings, 36 const BluetoothBleAdvertiserData &advData, const BluetoothBleAdvertiserData &scanResponse, 37 int32_t advHandle, uint16_t duration, bool isRawData) = 0; 38 virtual int EnableAdvertising(uint8_t advHandle, uint16_t duration) = 0; 39 virtual int DisableAdvertising(uint8_t advHandle) = 0; 40 virtual int StopAdvertising(int32_t advHandle) = 0; 41 virtual void Close(int32_t advHandle) = 0; 42 virtual int32_t GetAdvertiserHandle(int32_t &advHandle) = 0; 43 virtual void SetAdvertisingData(const BluetoothBleAdvertiserData &advData, 44 const BluetoothBleAdvertiserData &scanResponse, int32_t advHandle) = 0; 45 }; 46 } // namespace Bluetooth 47 } // namespace OHOS 48 #endif // OHOS_BLUETOOTH_STANDARD_BLE_ADVERTISER_INTERFACE_H