Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: device/bluetooth/bluetooth_low_energy_device_mac.mm

Issue 2783283002: bluetooth: macOS: Adding log in BluetoothAdapterMac::DisconnectGatt() (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "device/bluetooth/bluetooth_low_energy_device_mac.h" 5 #include "device/bluetooth/bluetooth_low_energy_device_mac.h"
6 6
7 #import <CoreFoundation/CoreFoundation.h> 7 #import <CoreFoundation/CoreFoundation.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 169
170 void BluetoothLowEnergyDeviceMac::ConnectToServiceInsecurely( 170 void BluetoothLowEnergyDeviceMac::ConnectToServiceInsecurely(
171 const device::BluetoothUUID& uuid, 171 const device::BluetoothUUID& uuid,
172 const ConnectToServiceCallback& callback, 172 const ConnectToServiceCallback& callback,
173 const ConnectToServiceErrorCallback& error_callback) { 173 const ConnectToServiceErrorCallback& error_callback) {
174 NOTIMPLEMENTED(); 174 NOTIMPLEMENTED();
175 } 175 }
176 176
177 void BluetoothLowEnergyDeviceMac::CreateGattConnectionImpl() { 177 void BluetoothLowEnergyDeviceMac::CreateGattConnectionImpl() {
178 if (!IsGattConnected()) { 178 if (!IsGattConnected()) {
179 VLOG(1) << *this << ": CreateGattConnection.";
180 GetMacAdapter()->CreateGattConnection(this); 179 GetMacAdapter()->CreateGattConnection(this);
181 } 180 }
182 } 181 }
183 182
184 void BluetoothLowEnergyDeviceMac::DisconnectGatt() { 183 void BluetoothLowEnergyDeviceMac::DisconnectGatt() {
185 VLOG(1) << *this << ": Disconnect.";
186 GetMacAdapter()->DisconnectGatt(this); 184 GetMacAdapter()->DisconnectGatt(this);
187 } 185 }
188 186
189 void BluetoothLowEnergyDeviceMac::DidDiscoverPrimaryServices(NSError* error) { 187 void BluetoothLowEnergyDeviceMac::DidDiscoverPrimaryServices(NSError* error) {
190 --discovery_pending_count_; 188 --discovery_pending_count_;
191 if (discovery_pending_count_ < 0) { 189 if (discovery_pending_count_ < 0) {
192 // This should never happens, just in case it happens with a device, 190 // This should never happens, just in case it happens with a device,
193 // discovery_pending_count_ is set back to 0. 191 // discovery_pending_count_ is set back to 0.
194 VLOG(1) << *this 192 VLOG(1) << *this
195 << ": BluetoothLowEnergyDeviceMac::discovery_pending_count_ " 193 << ": BluetoothLowEnergyDeviceMac::discovery_pending_count_ "
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 std::ostream& operator<<(std::ostream& out, 435 std::ostream& operator<<(std::ostream& out,
438 const BluetoothLowEnergyDeviceMac& device) { 436 const BluetoothLowEnergyDeviceMac& device) {
439 // TODO(crbug.com/703878): Should use 437 // TODO(crbug.com/703878): Should use
440 // BluetoothLowEnergyDeviceMac::GetNameForDisplay() instead. 438 // BluetoothLowEnergyDeviceMac::GetNameForDisplay() instead.
441 base::Optional<std::string> name = device.GetName(); 439 base::Optional<std::string> name = device.GetName();
442 const char* name_cstr = name ? name->c_str() : ""; 440 const char* name_cstr = name ? name->c_str() : "";
443 return out << "<BluetoothLowEnergyDeviceMac " << device.GetAddress() << "/" 441 return out << "<BluetoothLowEnergyDeviceMac " << device.GetAddress() << "/"
444 << &device << ", \"" << name_cstr << "\">"; 442 << &device << ", \"" << name_cstr << "\">";
445 } 443 }
446 } // namespace device 444 } // namespace device
OLDNEW
« device/bluetooth/bluetooth_adapter_mac.mm ('K') | « device/bluetooth/bluetooth_adapter_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698