| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "device/bluetooth/bluetooth_classic_win.h" | 5 #include "device/bluetooth/bluetooth_classic_win.h" |
| 6 | 6 |
| 7 namespace { | 7 namespace { |
| 8 static device::win::BluetoothClassicWrapper* g_instance_ = nullptr; | 8 static device::win::BluetoothClassicWrapper* g_instance_ = nullptr; |
| 9 } // namespace | 9 } // namespace |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 delete g_instance_; | 28 delete g_instance_; |
| 29 g_instance_ = instance; | 29 g_instance_ = instance; |
| 30 } | 30 } |
| 31 | 31 |
| 32 BluetoothClassicWrapper::BluetoothClassicWrapper() {} | 32 BluetoothClassicWrapper::BluetoothClassicWrapper() {} |
| 33 BluetoothClassicWrapper::~BluetoothClassicWrapper() {} | 33 BluetoothClassicWrapper::~BluetoothClassicWrapper() {} |
| 34 | 34 |
| 35 HBLUETOOTH_RADIO_FIND BluetoothClassicWrapper::FindFirstRadio( | 35 HBLUETOOTH_RADIO_FIND BluetoothClassicWrapper::FindFirstRadio( |
| 36 const BLUETOOTH_FIND_RADIO_PARAMS* params, | 36 const BLUETOOTH_FIND_RADIO_PARAMS* params, |
| 37 HANDLE* out_handle) { | 37 HANDLE* out_handle) { |
| 38 return BluetoothFindFirstRadio(params, out_handle); | 38 HANDLE radio_handle = NULL; |
| 39 HBLUETOOTH_RADIO_FIND radio_find_handle = |
| 40 BluetoothFindFirstRadio(params, &radio_handle); |
| 41 if (radio_find_handle) { |
| 42 opened_radio_handle_.Set(radio_handle); |
| 43 *out_handle = opened_radio_handle_.Get(); |
| 44 } |
| 45 return radio_find_handle; |
| 39 } | 46 } |
| 40 | 47 |
| 41 DWORD BluetoothClassicWrapper::GetRadioInfo( | 48 DWORD BluetoothClassicWrapper::GetRadioInfo( |
| 42 HANDLE handle, | 49 HANDLE handle, |
| 43 PBLUETOOTH_RADIO_INFO out_radio_info) { | 50 PBLUETOOTH_RADIO_INFO out_radio_info) { |
| 44 return BluetoothGetRadioInfo(handle, out_radio_info); | 51 return BluetoothGetRadioInfo(handle, out_radio_info); |
| 45 } | 52 } |
| 46 | 53 |
| 47 BOOL BluetoothClassicWrapper::FindRadioClose(HBLUETOOTH_RADIO_FIND handle) { | 54 BOOL BluetoothClassicWrapper::FindRadioClose(HBLUETOOTH_RADIO_FIND handle) { |
| 48 return BluetoothFindRadioClose(handle); | 55 return BluetoothFindRadioClose(handle); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 70 | 77 |
| 71 BOOL BluetoothClassicWrapper::EnableDiscovery(HANDLE handle, BOOL is_enable) { | 78 BOOL BluetoothClassicWrapper::EnableDiscovery(HANDLE handle, BOOL is_enable) { |
| 72 return BluetoothEnableDiscovery(handle, is_enable); | 79 return BluetoothEnableDiscovery(handle, is_enable); |
| 73 } | 80 } |
| 74 | 81 |
| 75 BOOL BluetoothClassicWrapper::EnableIncomingConnections(HANDLE handle, | 82 BOOL BluetoothClassicWrapper::EnableIncomingConnections(HANDLE handle, |
| 76 BOOL is_enable) { | 83 BOOL is_enable) { |
| 77 return BluetoothEnableIncomingConnections(handle, is_enable); | 84 return BluetoothEnableIncomingConnections(handle, is_enable); |
| 78 } | 85 } |
| 79 | 86 |
| 87 DWORD BluetoothClassicWrapper::LastError() { |
| 88 return GetLastError(); |
| 89 } |
| 90 |
| 80 } // namespace win | 91 } // namespace win |
| 81 } // namespace device | 92 } // namespace device |
| OLD | NEW |