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 #ifndef OHOS_BLUETOOTH_STANDARD_MAP_MSE_SERVER_H 16 #define OHOS_BLUETOOTH_STANDARD_MAP_MSE_SERVER_H 17 18 #include <string> 19 #include <vector> 20 21 #include "i_bluetooth_map_mse.h" 22 #include "bluetooth_map_mse_stub.h" 23 #include "if_system_ability_manager.h" 24 #include "iservice_registry.h" 25 #include "system_ability.h" 26 #include "bluetooth_types.h" 27 28 namespace OHOS { 29 namespace Bluetooth { 30 class BluetoothMapMseServer : public BluetoothMapMseStub { 31 public: 32 explicit BluetoothMapMseServer(); 33 ~BluetoothMapMseServer() override; 34 35 // IBluetoothMapMse overrides: 36 void RegisterObserver( 37 const sptr<IBluetoothMapMseObserver> &observer) override; 38 void DeregisterObserver( 39 const sptr<IBluetoothMapMseObserver> &observer) override; 40 void GetState(int32_t &ret) override; 41 void Disconnect( 42 const BluetoothRawAddress &device, int32_t &ret) override; 43 void IsConnected( 44 const BluetoothRawAddress &device, bool &ret) override; 45 void GetConnectedDevices( 46 std::vector<BluetoothRawAddress> &devices) override; 47 void GetDevicesByStates(const std::vector<int32_t> &states, 48 std::vector<BluetoothRawAddress> &devices) override; 49 void GetConnectionState( 50 const BluetoothRawAddress &device, int32_t &ret) override; 51 void SetConnectionStrategy( 52 const BluetoothRawAddress &device, int32_t strategy, bool &ret) override; 53 void GetConnectionStrategy( 54 const BluetoothRawAddress &device, int32_t &ret) override; 55 void GrantPermission( 56 const BluetoothRawAddress &device, bool allow, bool save) override; 57 58 private: 59 BLUETOOTH_DECLARE_IMPL(); 60 BLUETOOTH_DISALLOW_COPY_AND_ASSIGN(BluetoothMapMseServer); 61 }; 62 } // namespace Bluetooth 63 } // namespace OHOS 64 #endif // OHOS_BLUETOOTH_STANDARD_MAP_MSE_SERVER_H 65