Chromium Code Reviews| Index: device/bluetooth/bluetooth_low_energy_device_mac.mm |
| diff --git a/device/bluetooth/bluetooth_low_energy_device_mac.mm b/device/bluetooth/bluetooth_low_energy_device_mac.mm |
| index 677c59557087bc8be0e1cb5f92a9d631ec910e7b..e395af5ba7632b9553059602113c17ab8dcbcc6d 100644 |
| --- a/device/bluetooth/bluetooth_low_energy_device_mac.mm |
| +++ b/device/bluetooth/bluetooth_low_energy_device_mac.mm |
| @@ -127,7 +127,7 @@ bool BluetoothLowEnergyDeviceMac::IsConnectable() const { |
| } |
| bool BluetoothLowEnergyDeviceMac::IsConnecting() const { |
| - return false; |
| + return (GetPeripheralState() == CBPeripheralStateConnecting); |
| } |
| BluetoothDevice::UUIDList BluetoothLowEnergyDeviceMac::GetUUIDs() const { |
| @@ -213,12 +213,6 @@ void BluetoothLowEnergyDeviceMac::ConnectToServiceInsecurely( |
| NOTIMPLEMENTED(); |
| } |
| -void BluetoothLowEnergyDeviceMac::CreateGattConnection( |
| - const GattConnectionCallback& callback, |
| - const ConnectErrorCallback& error_callback) { |
| - NOTIMPLEMENTED(); |
| -} |
| - |
| NSDate* BluetoothLowEnergyDeviceMac::GetLastUpdateTime() const { |
| return last_update_time_.get(); |
| } |
| @@ -228,15 +222,30 @@ std::string BluetoothLowEnergyDeviceMac::GetDeviceName() const { |
| } |
| void BluetoothLowEnergyDeviceMac::CreateGattConnectionImpl() { |
| - // Mac implementation does not yet use the default CreateGattConnection |
| - // implementation. http://crbug.com/520774 |
| - NOTIMPLEMENTED(); |
| + BluetoothAdapterMac* adapter = |
| + static_cast<BluetoothAdapterMac*>(this->adapter_); |
| + adapter->CreateGattConnection(this); |
| +} |
| + |
| +void BluetoothLowEnergyDeviceMac::GattConnected() { |
|
scheib
2016/01/27 01:09:03
Please match declaration and definition order. (mo
jlebel
2016/02/10 13:38:51
Done.
|
| + this->DidConnectGatt(); |
| } |
| void BluetoothLowEnergyDeviceMac::DisconnectGatt() { |
| - // Mac implementation does not yet use the default CreateGattConnection |
| - // implementation. http://crbug.com/520774 |
| - NOTIMPLEMENTED(); |
| + BluetoothAdapterMac* adapter = |
| + static_cast<BluetoothAdapterMac*>(this->adapter_); |
| + adapter->DisconnectGatt(this); |
| +} |
| + |
| +device::BluetoothAdapterMac* |
| +BluetoothLowEnergyDeviceMac::GetBluetoothAdapterMac() { |
| + BluetoothAdapterMac* adapter = |
| + static_cast<BluetoothAdapterMac*>(this->adapter_); |
| + return adapter; |
| +} |
| + |
| +CBPeripheral* BluetoothLowEnergyDeviceMac::GetPeripheral() { |
| + return peripheral_; |
| } |
| // static |