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

Unified Diff: device/bluetooth/bluetooth_low_energy_central_manager_delegate.mm

Issue 1538173003: Implementing GATT connection/disconnect on OS X. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing patch Created 4 years, 10 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_central_manager_delegate.mm
diff --git a/device/bluetooth/bluetooth_low_energy_central_manager_delegate.mm b/device/bluetooth/bluetooth_low_energy_central_manager_delegate.mm
index 598e4b97bcf70a177ce756c6a909519117f2a7e4..95e452c9c6399bd8a37e62c67180bf7f5ba13816 100644
--- a/device/bluetooth/bluetooth_low_energy_central_manager_delegate.mm
+++ b/device/bluetooth/bluetooth_low_energy_central_manager_delegate.mm
@@ -33,6 +33,20 @@ class BluetoothLowEnergyCentralManagerBridge {
adapter_->LowEnergyCentralManagerUpdatedState();
}
+ virtual void DidConnectPeripheral(CBPeripheral* peripheral) {
+ adapter_->DidConnectPeripheral(peripheral);
+ }
+
+ virtual void DidFailToConnectPeripheral(CBPeripheral* peripheral,
+ NSError* error) {
+ adapter_->DidFailToConnectPeripheral(peripheral, error);
+ }
+
+ virtual void DidDisconnectPeripheral(CBPeripheral* peripheral,
+ NSError* error) {
+ adapter_->DidDisconnectPeripheral(peripheral, error);
+ }
+
private:
BluetoothLowEnergyDiscoveryManagerMac* discovery_manager_;
BluetoothAdapterMac* adapter_;
@@ -65,4 +79,21 @@ class BluetoothLowEnergyCentralManagerBridge {
bridge_->UpdatedState();
}
+- (void)centralManager:(CBCentralManager*)central
+ didConnectPeripheral:(CBPeripheral*)peripheral {
+ bridge_->DidConnectPeripheral(peripheral);
+}
+
+- (void)centralManager:(CBCentralManager*)central
+ didFailToConnectPeripheral:(CBPeripheral*)peripheral
+ error:(nullable NSError*)error {
+ bridge_->DidFailToConnectPeripheral(peripheral, error);
+}
+
+- (void)centralManager:(CBCentralManager*)central
+ didDisconnectPeripheral:(CBPeripheral*)peripheral
+ error:(nullable NSError*)error {
+ bridge_->DidDisconnectPeripheral(peripheral, error);
+}
+
@end

Powered by Google App Engine
This is Rietveld 408576698