| Index: device/bluetooth/bluetooth_adapter_mac.mm
|
| diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm
|
| index 78c9ee9264fc977ab9d9e0013d7800013feaf831..2622d60e4148914889a3a4a369ff858fe01f1d73 100644
|
| --- a/device/bluetooth/bluetooth_adapter_mac.mm
|
| +++ b/device/bluetooth/bluetooth_adapter_mac.mm
|
| @@ -582,8 +582,12 @@ void BluetoothAdapterMac::DidFailToConnectPeripheral(CBPeripheral* peripheral,
|
| }
|
| VLOG(1) << "Bluetooth error, domain: " << error.domain.UTF8String
|
| << ", error code: " << error.code;
|
| - // TODO(http://crbug.com/585894): Need to convert the error.
|
| - device_mac->DidFailToConnectGatt(BluetoothClassicDeviceMac::ERROR_UNKNOWN);
|
| + BluetoothDevice::ConnectErrorCode 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);
|
| }
|
|
|
| void BluetoothAdapterMac::DidDisconnectPeripheral(CBPeripheral* peripheral,
|
| @@ -594,8 +598,11 @@ void BluetoothAdapterMac::DidDisconnectPeripheral(CBPeripheral* peripheral,
|
| [low_energy_central_manager_ cancelPeripheralConnection:peripheral];
|
| return;
|
| }
|
| - // TODO(http://crbug.com/585897): Need to pass the error.
|
| - device_mac->DidDisconnectPeripheral();
|
| + VLOG(1) << "Bluetooth error, domain: " << error.domain.UTF8String
|
| + << ", error code: " << error.code;
|
| + BluetoothDevice::ConnectErrorCode error_code =
|
| + BluetoothDeviceMac::GetConnectErrorCodeFromNSError(error);
|
| + device_mac->DidDisconnectPeripheral(error_code);
|
| }
|
|
|
| BluetoothLowEnergyDeviceMac*
|
|
|