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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 return handle != INVALID_HANDLE_VALUE; | 42 return handle != INVALID_HANDLE_VALUE; |
43 } | 43 } |
44 | 44 |
45 static HDEVINFO NullHandle() { return INVALID_HANDLE_VALUE; } | 45 static HDEVINFO NullHandle() { return INVALID_HANDLE_VALUE; } |
46 | 46 |
47 private: | 47 private: |
48 DISALLOW_IMPLICIT_CONSTRUCTORS(DeviceInfoSetTraits); | 48 DISALLOW_IMPLICIT_CONSTRUCTORS(DeviceInfoSetTraits); |
49 }; | 49 }; |
50 | 50 |
51 typedef base::win::GenericScopedHandle<DeviceInfoSetTraits, | 51 typedef base::win::GenericScopedHandle<DeviceInfoSetTraits, |
52 base::win::VerifierTraits> | 52 base::win::DummyVerifierTraits> |
53 ScopedDeviceInfoSetHandle; | 53 ScopedDeviceInfoSetHandle; |
54 | 54 |
55 bool StringToBluetoothAddress(const std::string& value, | 55 bool StringToBluetoothAddress(const std::string& value, |
56 BLUETOOTH_ADDRESS* btha, | 56 BLUETOOTH_ADDRESS* btha, |
57 std::string* error) { | 57 std::string* error) { |
58 if (value.length() != 6 * 2) { | 58 if (value.length() != 6 * 2) { |
59 *error = kInvalidBluetoothAddress; | 59 *error = kInvalidBluetoothAddress; |
60 return false; | 60 return false; |
61 } | 61 } |
62 | 62 |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 | 665 |
666 bool ExtractBluetoothAddressFromDeviceInstanceIdForTesting( | 666 bool ExtractBluetoothAddressFromDeviceInstanceIdForTesting( |
667 const std::string& instance_id, | 667 const std::string& instance_id, |
668 BLUETOOTH_ADDRESS* btha, | 668 BLUETOOTH_ADDRESS* btha, |
669 std::string* error) { | 669 std::string* error) { |
670 return ExtractBluetoothAddressFromDeviceInstanceId(instance_id, btha, error); | 670 return ExtractBluetoothAddressFromDeviceInstanceId(instance_id, btha, error); |
671 } | 671 } |
672 | 672 |
673 } // namespace win | 673 } // namespace win |
674 } // namespace device | 674 } // namespace device |
OLD | NEW |