OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "device/bluetooth/bluetooth_classic_win.h" |
| 6 |
| 7 namespace { |
| 8 static device::win::BluetoothClassicWrapper* g_instance_ = nullptr; |
| 9 } // namespace |
| 10 |
| 11 namespace device { |
| 12 namespace win { |
| 13 |
| 14 BluetoothClassicWrapper* BluetoothClassicWrapper::GetInstance() { |
| 15 if (g_instance_ == nullptr) { |
| 16 g_instance_ = new BluetoothClassicWrapper(); |
| 17 } |
| 18 return g_instance_; |
| 19 } |
| 20 |
| 21 void BluetoothClassicWrapper::DeleteInstance() { |
| 22 delete g_instance_; |
| 23 g_instance_ = nullptr; |
| 24 } |
| 25 |
| 26 void BluetoothClassicWrapper::SetInstanceForTest( |
| 27 BluetoothClassicWrapper* instance) { |
| 28 delete g_instance_; |
| 29 g_instance_ = instance; |
| 30 } |
| 31 |
| 32 BluetoothClassicWrapper::BluetoothClassicWrapper() {} |
| 33 BluetoothClassicWrapper::~BluetoothClassicWrapper() {} |
| 34 |
| 35 HBLUETOOTH_RADIO_FIND BluetoothClassicWrapper::FindFirstRadio( |
| 36 const BLUETOOTH_FIND_RADIO_PARAMS* params, |
| 37 HANDLE* out_handle) { |
| 38 return BluetoothFindFirstRadio(params, out_handle); |
| 39 } |
| 40 |
| 41 DWORD BluetoothClassicWrapper::GetRadioInfo( |
| 42 HANDLE handle, |
| 43 PBLUETOOTH_RADIO_INFO out_radio_info) { |
| 44 return BluetoothGetRadioInfo(handle, out_radio_info); |
| 45 } |
| 46 |
| 47 BOOL BluetoothClassicWrapper::FindRadioClose(HBLUETOOTH_RADIO_FIND handle) { |
| 48 return BluetoothFindRadioClose(handle); |
| 49 } |
| 50 |
| 51 BOOL BluetoothClassicWrapper::IsConnectable(HANDLE handle) { |
| 52 return BluetoothIsConnectable(handle); |
| 53 } |
| 54 |
| 55 HBLUETOOTH_DEVICE_FIND BluetoothClassicWrapper::FindFirstDevice( |
| 56 const BLUETOOTH_DEVICE_SEARCH_PARAMS* params, |
| 57 BLUETOOTH_DEVICE_INFO* out_device_info) { |
| 58 return BluetoothFindFirstDevice(params, out_device_info); |
| 59 } |
| 60 |
| 61 BOOL BluetoothClassicWrapper::FindNextDevice( |
| 62 HBLUETOOTH_DEVICE_FIND handle, |
| 63 BLUETOOTH_DEVICE_INFO* out_device_info) { |
| 64 return BluetoothFindNextDevice(handle, out_device_info); |
| 65 } |
| 66 |
| 67 BOOL BluetoothClassicWrapper::FindDeviceClose(HBLUETOOTH_DEVICE_FIND handle) { |
| 68 return BluetoothFindDeviceClose(handle); |
| 69 } |
| 70 |
| 71 BOOL BluetoothClassicWrapper::EnableDiscovery(HANDLE handle, BOOL is_enable) { |
| 72 return BluetoothEnableDiscovery(handle, is_enable); |
| 73 } |
| 74 |
| 75 BOOL BluetoothClassicWrapper::EnableIncomingConnections(HANDLE handle, |
| 76 BOOL is_enable) { |
| 77 return BluetoothEnableIncomingConnections(handle, is_enable); |
| 78 } |
| 79 |
| 80 } // namespace win |
| 81 } // namespace device |
OLD | NEW |