1 /* 2 * Copyright (C) 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 #ifndef OHOS_BLUETOOTH_STANDARD_PBAP_PSE_INTERFACE_H 16 #define OHOS_BLUETOOTH_STANDARD_PBAP_PSE_INTERFACE_H 17 18 #include "../parcel/bluetooth_pbap_pce_parameter.h" 19 #include "../parcel/bluetooth_raw_address.h" 20 #include "iremote_broker.h" 21 #include "pbap_pce_parameter.h" 22 #include "i_bluetooth_pbap_pse_observer.h" 23 24 namespace OHOS { 25 namespace Bluetooth { 26 class IBluetoothPbapPse : public OHOS::IRemoteBroker { 27 public: 28 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.ipc.IBluetoothPbapPse"); 29 enum Code { 30 PBAP_PSE_GET_DEVICE_STATE = 0, 31 PBAP_PSE_GET_DEVICES_BY_STATES, 32 PBAP_PSE_DISCONNECT, 33 PBAP_PSE_SET_CONNECTION_STRATEGY, 34 PBAP_PSE_GET_CONNECTION_STRATEGY, 35 PBAP_PSE_GRANT_PERMISSION, 36 PBAP_PSE_SET_DEVICE_PASSWORD, 37 PBAP_PSE_REGISTER_OBSERVER, 38 PBAP_PSE_DEREGISTER_OBSERVER, 39 }; 40 41 virtual int GetDeviceState(const BluetoothRawAddress& device) = 0; 42 virtual void GetDevicesByStates( 43 const ::std::vector<int32_t> tmpStates, std::vector<BluetoothRawAddress> &rawDevices) = 0; 44 virtual int Disconnect(const BluetoothRawAddress& device) = 0; 45 virtual int SetConnectionStrategy(const BluetoothRawAddress& device, int32_t strategy) = 0; 46 virtual int GetConnectionStrategy(const BluetoothRawAddress& device) = 0; 47 virtual void GrantPermission(const BluetoothRawAddress& device, bool allow, bool save) = 0; 48 virtual int SetDevicePassword( 49 const BluetoothRawAddress& device, const std::string &password, const std::string &userId) = 0; 50 virtual void RegisterObserver(const sptr<IBluetoothPbapPseObserver>& observer) = 0; 51 virtual void DeregisterObserver(const sptr<IBluetoothPbapPseObserver>& observer) = 0; 52 virtual std::vector<BluetoothRawAddress> GetConnectedDevices() = 0; 53 }; 54 } // namespace Bluetooth 55 } // namespace OHOS 56 #endif // OHOS_BLUETOOTH_STANDARD_PBAP_PSE_INTERFACE_H