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

Unified Diff: device/bluetooth/bluetooth_adapter_mac.mm

Issue 2745983003: Bluetooth: macOS: Adding logs (Closed)
Patch Set: Changing GetIdentifier() by GetUUID() + pointer Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | device/bluetooth/bluetooth_low_energy_device_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_adapter_mac.mm
diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm
index f33d79290ca0a91ad6b37d341e59a4ad65b41997..667bbd6e06425cd14a23461624b662165cbff694 100644
--- a/device/bluetooth/bluetooth_adapter_mac.mm
+++ b/device/bluetooth/bluetooth_adapter_mac.mm
@@ -519,14 +519,16 @@ void BluetoothAdapterMac::LowEnergyDeviceUpdated(
// otherwise update the existing device.
const bool is_new_device = device_mac == nullptr;
if (is_new_device) {
- VLOG(1) << "LowEnergyDeviceUpdated new device";
// A new device has been found.
device_mac = new BluetoothLowEnergyDeviceMac(this, peripheral);
+ VLOG(1) << *device_mac << ": New Device.";
} else if (DoesCollideWithKnownDevice(peripheral, device_mac)) {
return;
}
DCHECK(device_mac);
+ VLOG(3) << *device_mac << ": Device updated with "
+ << base::SysNSStringToUTF8([advertisement_data description]);
// Get Advertised UUIDs
BluetoothDevice::UUIDList advertised_uuids;
@@ -576,7 +578,10 @@ void BluetoothAdapterMac::LowEnergyDeviceUpdated(
}
// TODO(krstnmnlsn): Implement. crbug.com/511025
-void BluetoothAdapterMac::LowEnergyCentralManagerUpdatedState() {}
+void BluetoothAdapterMac::LowEnergyCentralManagerUpdatedState() {
+ VLOG(1) << "Central manager state updated: "
+ << [low_energy_central_manager_ state];
+}
void BluetoothAdapterMac::AddPairedDevices() {
// Add any new paired devices.
@@ -594,6 +599,7 @@ BluetoothAdapterMac::RetrieveGattConnectedDevicesWithService(
const BluetoothUUID* uuid) {
NSArray* cbUUIDs = nil;
if (!uuid) {
+ VLOG(1) << "Retrieving all connected devices.";
// It is not possible to ask for all connected peripherals with
// -[CBCentralManager retrieveConnectedPeripheralsWithServices:] by passing
// nil. To try to get most of the peripherals, the search is done with
@@ -601,6 +607,8 @@ BluetoothAdapterMac::RetrieveGattConnectedDevicesWithService(
CBUUID* genericAccessServiceUUID = [CBUUID UUIDWithString:@"1800"];
cbUUIDs = @[ genericAccessServiceUUID ];
} else {
+ VLOG(1) << "Retrieving connected devices with UUID: "
+ << uuid->canonical_value();
NSString* uuidString =
base::SysUTF8ToNSString(uuid->canonical_value().c_str());
cbUUIDs = @[ [CBUUID UUIDWithString:uuidString] ];
@@ -626,6 +634,7 @@ BluetoothAdapterMac::RetrieveGattConnectedDevicesWithService(
}
}
connected_devices.push_back(device_mac);
+ VLOG(1) << *device_mac << ": New connected device.";
}
return connected_devices;
}
@@ -661,15 +670,15 @@ void BluetoothAdapterMac::DidFailToConnectPeripheral(CBPeripheral* peripheral,
[low_energy_central_manager_ cancelPeripheralConnection:peripheral];
return;
}
- VLOG(1) << "Failed to connect to peripheral";
BluetoothDevice::ConnectErrorCode error_code =
BluetoothDevice::ConnectErrorCode::ERROR_UNKNOWN;
if (error) {
error_code = BluetoothDeviceMac::GetConnectErrorCodeFromNSError(error);
- VLOG(1) << "Bluetooth error, domain: " << error.domain.UTF8String
- << ", error code: " << error.code
- << ", converted into: " << error_code;
+ VLOG(1) << "Converting Bluetooth error, domain: " << error.domain.UTF8String
+ << ", error code: " << error.code << ", to: " << error_code;
}
+ VLOG(1) << *device_mac << ": Failed to connect to peripheral with error "
+ << error;
device_mac->DidFailToConnectGatt(error_code);
}
@@ -681,11 +690,6 @@ void BluetoothAdapterMac::DidDisconnectPeripheral(CBPeripheral* peripheral,
[low_energy_central_manager_ cancelPeripheralConnection:peripheral];
return;
}
- VLOG(1) << "Disconnected from peripheral.";
- if (error) {
- VLOG(1) << "Bluetooth error, domain: " << error.domain.UTF8String
- << ", error code: " << error.code;
- }
device_mac->DidDisconnectPeripheral(error);
}
« no previous file with comments | « no previous file | device/bluetooth/bluetooth_low_energy_device_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698