| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_low_energy_win.h" | 5 #include "device/bluetooth/bluetooth_low_energy_win.h" |
| 6 | 6 |
| 7 #include "base/files/file.h" | 7 #include "base/files/file.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #include "base/win/scoped_handle.h" | 10 #include "base/win/scoped_handle.h" |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 return true; | 645 return true; |
| 646 case kError: | 646 case kError: |
| 647 return false; | 647 return false; |
| 648 case kOk: | 648 case kOk: |
| 649 devices->push_back(device_info.release()); | 649 devices->push_back(device_info.release()); |
| 650 } | 650 } |
| 651 } | 651 } |
| 652 } | 652 } |
| 653 | 653 |
| 654 bool EnumerateKnownBluetoothLowEnergyServices( | 654 bool EnumerateKnownBluetoothLowEnergyServices( |
| 655 BluetoothLowEnergyDeviceInfo* device_info, | 655 const base::FilePath& device_path, |
| 656 ScopedVector<BluetoothLowEnergyServiceInfo>* services, | 656 ScopedVector<BluetoothLowEnergyServiceInfo>* services, |
| 657 std::string* error) { | 657 std::string* error) { |
| 658 return CollectBluetoothLowEnergyDeviceServices( | 658 if (!IsBluetoothLowEnergySupported()) { |
| 659 device_info->path, services, error); | 659 *error = kPlatformNotSupported; |
| 660 return false; |
| 661 } |
| 662 |
| 663 return CollectBluetoothLowEnergyDeviceServices(device_path, services, error); |
| 660 } | 664 } |
| 661 | 665 |
| 662 bool ExtractBluetoothAddressFromDeviceInstanceIdForTesting( | 666 bool ExtractBluetoothAddressFromDeviceInstanceIdForTesting( |
| 663 const std::string& instance_id, | 667 const std::string& instance_id, |
| 664 BLUETOOTH_ADDRESS* btha, | 668 BLUETOOTH_ADDRESS* btha, |
| 665 std::string* error) { | 669 std::string* error) { |
| 666 return ExtractBluetoothAddressFromDeviceInstanceId(instance_id, btha, error); | 670 return ExtractBluetoothAddressFromDeviceInstanceId(instance_id, btha, error); |
| 667 } | 671 } |
| 668 | 672 |
| 669 } // namespace win | 673 } // namespace win |
| 670 } // namespace device | 674 } // namespace device |
| OLD | NEW |