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

Unified Diff: device/bluetooth/bluetooth_low_energy_device_mac.mm

Issue 1538173003: Implementing GATT connection/disconnect on OS X. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing chromium.gyp_env Created 4 years, 11 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
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

Powered by Google App Engine
This is Rietveld 408576698