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_MAP_MSE_INTERFACE_H 16 #define OHOS_BLUETOOTH_STANDARD_MAP_MSE_INTERFACE_H 17 18 #include <string> 19 #include <vector> 20 #include "../parcel/bluetooth_map_mce_parameter.h" 21 #include "../parcel/bluetooth_raw_address.h" 22 #include "iremote_broker.h" 23 #include "i_bluetooth_map_mse_observer.h" 24 25 namespace OHOS { 26 namespace Bluetooth { 27 class IBluetoothMapMse : public OHOS::IRemoteBroker { 28 public: 29 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.ipc.IBluetoothMapMse"); 30 31 enum Code { 32 MSE_REGISTER_OBSERVER = 0, 33 MSE_DE_REGISTER_OBSERVER, 34 MSE_GET_STATE, 35 MSE_DISCONNECT, 36 MSE_ISCONNECTED, 37 MSE_GET_CONNECTED_DEVICES, 38 MSE_GET_DEVICES_BY_STATES, 39 MSE_GET_CONNECTION_STATE, 40 MSE_SET_CONNECTION_STRATEGY, 41 MSE_GET_CONNECTION_STRATEGY, 42 MSE_GRANT_PERMISSION, 43 }; 44 45 // IBluetoothMapMse: 46 virtual void RegisterObserver( 47 const sptr<IBluetoothMapMseObserver> &observer) = 0; 48 virtual void DeregisterObserver( 49 const sptr<IBluetoothMapMseObserver> &observer) = 0; 50 virtual void GetState(int32_t &ret) = 0; 51 virtual void Disconnect( 52 const BluetoothRawAddress &device, int32_t &ret) = 0; 53 virtual void IsConnected( 54 const BluetoothRawAddress &device, bool &ret) = 0; 55 virtual void GetConnectedDevices( 56 std::vector<BluetoothRawAddress> &devices) = 0; 57 virtual void GetDevicesByStates(const std::vector<int32_t> &states, 58 std::vector<BluetoothRawAddress> &devices) = 0; 59 virtual void GetConnectionState( 60 const BluetoothRawAddress &device, int32_t &ret) = 0; 61 virtual void SetConnectionStrategy( 62 const BluetoothRawAddress &device, int32_t strategy, bool &ret) = 0; 63 virtual void GetConnectionStrategy( 64 const BluetoothRawAddress &device, int32_t &ret) = 0; 65 virtual void GrantPermission( 66 const BluetoothRawAddress &device, bool allow, bool save) = 0; 67 }; 68 } // namespace Bluetooth 69 } // namespace OHOS 70 #endif // OHOS_BLUETOOTH_STANDARD_MAP_MSE_INTERFACE_H 71