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_A2DP_SINK_SERVER_H 17 #define OHOS_BLUETOOTH_STANDARD_A2DP_SINK_SERVER_H 18 19 #include "bluetooth_a2dp_sink_stub.h" 20 #include "raw_address.h" 21 #include "bluetooth_types.h" 22 #include "i_bluetooth_a2dp_sink.h" 23 #include "if_system_ability_manager.h" 24 #include "iservice_registry.h" 25 #include "system_ability.h" 26 27 namespace OHOS { 28 namespace Bluetooth { 29 class BluetoothA2dpSinkServer : public BluetoothA2dpSinkStub { 30 public: 31 BluetoothA2dpSinkServer(); 32 ~BluetoothA2dpSinkServer() override; 33 34 // IBluetoothHost overrides: 35 void RegisterObserver(const sptr<IBluetoothA2dpSinkObserver> &observer) override; 36 void DeregisterObserver(const sptr<IBluetoothA2dpSinkObserver> &observer) override; 37 int Connect(const RawAddress &device) override; 38 int Disconnect(const RawAddress &device) override; 39 int GetDeviceState(const RawAddress &device) override; 40 std::vector<RawAddress> GetDevicesByStates(const std::vector<int32_t> &states) override; 41 int GetPlayingState(const RawAddress &device, int &state) override; 42 int SetConnectStrategy(const RawAddress &device, int strategy) override; 43 int GetConnectStrategy(const RawAddress &device) override; 44 int SendDelay(const RawAddress &device, int32_t delayValue) override; 45 46 private: 47 BLUETOOTH_DECLARE_IMPL(); 48 BLUETOOTH_DISALLOW_COPY_AND_ASSIGN(BluetoothA2dpSinkServer); 49 }; 50 } // namespace Bluetooth 51 } // namespace OHOS 52 #endif // OHOS_BLUETOOTH_STANDARD_A2DP_SINK_SERVER_H