Chromium Code Reviews| Index: device/bluetooth/bluetooth_adapter_mac.mm |
| diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm |
| index ef4a20dee2da1156e992a84add68576b47755754..01364221aa2b6e9f4b7e69c3bc6b046e02835f23 100644 |
| --- a/device/bluetooth/bluetooth_adapter_mac.mm |
| +++ b/device/bluetooth/bluetooth_adapter_mac.mm |
| @@ -595,13 +595,15 @@ void BluetoothAdapterMac::DidFailToConnectPeripheral(CBPeripheral* peripheral, |
| [low_energy_central_manager_ cancelPeripheralConnection:peripheral]; |
| return; |
| } |
| - VLOG(1) << "Bluetooth error, domain: " << error.domain.UTF8String |
| - << ", error code: " << error.code; |
| + VLOG(1) << "Failed to connect to peripheral"; |
| BluetoothDevice::ConnectErrorCode error_code = |
| - BluetoothDeviceMac::GetConnectErrorCodeFromNSError(error); |
| - VLOG(1) << "Bluetooth error, domain: " << error.domain.UTF8String |
| - << ", error code: " << error.code |
| - << ", converted into: " << error_code; |
| + BluetoothDevice::ConnectErrorCode::ERROR_UNKNOWN; |
|
Jeffrey Yasskin
2016/08/24 23:28:13
If this happens when we explicitly disconnected wh
ortuno
2016/08/25 16:39:56
We should but I would like to do that in a separat
|
| + if (error) { |
| + error_code = BluetoothDeviceMac::GetConnectErrorCodeFromNSError(error); |
| + VLOG(1) << "Bluetooth error, domain: " << error.domain.UTF8String |
| + << ", error code: " << error.code |
| + << ", converted into: " << error_code; |
| + } |
| device_mac->DidFailToConnectGatt(error_code); |
| } |
| @@ -613,11 +615,12 @@ void BluetoothAdapterMac::DidDisconnectPeripheral(CBPeripheral* peripheral, |
| [low_energy_central_manager_ cancelPeripheralConnection:peripheral]; |
| return; |
| } |
| - VLOG(1) << "Bluetooth error, domain: " << error.domain.UTF8String |
| - << ", error code: " << error.code; |
| - BluetoothDevice::ConnectErrorCode error_code = |
| - BluetoothDeviceMac::GetConnectErrorCodeFromNSError(error); |
| - device_mac->DidDisconnectPeripheral(error_code); |
| + VLOG(1) << "Disconnected from peripheral."; |
| + if (error) { |
| + VLOG(1) << "Bluetooth error, domain: " << error.domain.UTF8String |
| + << ", error code: " << error.code; |
| + } |
| + device_mac->DidDisconnectPeripheral(error); |
| } |
| BluetoothLowEnergyDeviceMac* |