OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/proximity_auth/ble/bluetooth_low_energy_connection.h" | 5 #include "components/proximity_auth/ble/bluetooth_low_energy_connection.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
114 Disconnect(); | 114 Disconnect(); |
115 } | 115 } |
116 } | 116 } |
117 | 117 |
118 void BluetoothLowEnergyConnection::GattDiscoveryCompleteForService( | 118 void BluetoothLowEnergyConnection::GattDiscoveryCompleteForService( |
119 BluetoothAdapter* adapter, | 119 BluetoothAdapter* adapter, |
120 BluetoothGattService* service) { | 120 BluetoothGattService* service) { |
121 if (service && service->GetUUID() == remote_service_.uuid) { | 121 if (service && service->GetUUID() == remote_service_.uuid) { |
122 VLOG(1) << "All characteristics discovered for " | 122 VLOG(1) << "All characteristics discovered for " |
123 << remote_service_.uuid.canonical_value(); | 123 << remote_service_.uuid.canonical_value(); |
124 | |
Tim Song
2015/05/20 07:47:00
Is this accidental?
sacomoto
2015/05/20 22:34:21
Yes. Reverted.
| |
125 if (to_peripheral_char_.id.empty() || from_peripheral_char_.id.empty()) { | 124 if (to_peripheral_char_.id.empty() || from_peripheral_char_.id.empty()) { |
126 VLOG(1) << "Connection error, missing characteristics for SmartLock " | 125 VLOG(1) << "Connection error, missing characteristics for SmartLock " |
127 "service.\n" | 126 "service.\n" |
128 << (to_peripheral_char_.id.empty() | 127 << (to_peripheral_char_.id.empty() |
129 ? to_peripheral_char_.uuid.canonical_value() | 128 ? to_peripheral_char_.uuid.canonical_value() |
130 : "") | 129 : "") |
131 << (from_peripheral_char_.id.empty() | 130 << (from_peripheral_char_.id.empty() |
132 ? ", " + from_peripheral_char_.uuid.canonical_value() | 131 ? ", " + from_peripheral_char_.uuid.canonical_value() |
133 : "") << " not found."; | 132 : "") << " not found."; |
134 Disconnect(); | 133 Disconnect(); |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
351 | 350 |
352 bytes[0] = static_cast<uint8>(value); | 351 bytes[0] = static_cast<uint8>(value); |
353 bytes[1] = static_cast<uint8>(value >> 8); | 352 bytes[1] = static_cast<uint8>(value >> 8); |
354 bytes[2] = static_cast<uint8>(value >> 12); | 353 bytes[2] = static_cast<uint8>(value >> 12); |
355 bytes[3] = static_cast<uint8>(value >> 24); | 354 bytes[3] = static_cast<uint8>(value >> 24); |
356 | 355 |
357 return std::string(bytes); | 356 return std::string(bytes); |
358 } | 357 } |
359 | 358 |
360 } // namespace proximity_auth | 359 } // namespace proximity_auth |
OLD | NEW |