• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include "bluetooth_a2dp_src_observer.h"
17 #include <hdf_log.h>
18 
OnConnectionStateChanged(const OHOS::bluetooth::RawAddress & device,int state)19 void BluetoothA2dpSrcObserver::OnConnectionStateChanged(const OHOS::bluetooth::RawAddress &device, int state)
20 {
21     HDF_LOGI("BluetoothA2dpSrcObserver::OnConnectionStateChanged");
22     if ((callbacks_ != nullptr) && (callbacks_->OnConnectionStateChanged)) {
23         callbacks_->OnConnectionStateChanged(device, state);
24     }
25 }
26 
OnPlayingStatusChanged(const OHOS::bluetooth::RawAddress & device,int playingState,int error)27 void BluetoothA2dpSrcObserver::OnPlayingStatusChanged(
28     const OHOS::bluetooth::RawAddress &device, int playingState, int error)
29 {
30     HDF_LOGI("BluetoothA2dpSrcObserver::OnPlayingStatusChanged");
31     if ((callbacks_ != nullptr) && (callbacks_->OnPlayingStatusChanged)) {
32         callbacks_->OnPlayingStatusChanged(device, playingState, error);
33     }
34 }
35 
OnConfigurationChanged(const OHOS::bluetooth::RawAddress & device,const OHOS::Bluetooth::BluetoothA2dpCodecInfo & info,int error)36 void BluetoothA2dpSrcObserver::OnConfigurationChanged
37     (const OHOS::bluetooth::RawAddress &device, const OHOS::Bluetooth::BluetoothA2dpCodecInfo &info, int error)
38 {
39     HDF_LOGI("BluetoothA2dpSrcObserver::OnConfigurationChanged");
40     if ((callbacks_ != nullptr) && (callbacks_->OnConfigurationChanged)) {
41         callbacks_->OnConfigurationChanged(device, info, error);
42     }
43 }