| Index: device/bluetooth/bluetooth_adapter_mac.mm
|
| diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm
|
| index 0db7131318d218b8003124231e7d7c87357608b6..e7e723afec49fbe8879bc6b7b2e295ed80b0852a 100644
|
| --- a/device/bluetooth/bluetooth_adapter_mac.mm
|
| +++ b/device/bluetooth/bluetooth_adapter_mac.mm
|
| @@ -561,13 +561,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;
|
| 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_FAILED;
|
| + VLOG(1) << "Fail to connect to peripheral";
|
| + 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);
|
| }
|
|
|
| @@ -579,11 +581,16 @@ 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) << "Peripheral disconnected";
|
| + if (error) {
|
| + VLOG(1) << "Bluetooth error, domain: " << error.domain.UTF8String
|
| + << ", error code: " << error.code;
|
| + BluetoothDevice::ConnectErrorCode error_code =
|
| + BluetoothDeviceMac::GetConnectErrorCodeFromNSError(error);
|
| + device_mac->DidDisconnectPeripheral(error_code);
|
| + } else {
|
| + device_mac->DidDisconnectPeripheral();
|
| + }
|
| }
|
|
|
| BluetoothLowEnergyDeviceMac*
|
|
|