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

Unified Diff: device/bluetooth/bluetooth_remote_gatt_descriptor_mac.h

Issue 2767813002: Bluetooth: macOS: Implementing read/write for descriptors (Closed)
Patch Set: . Created 3 years, 8 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_remote_gatt_descriptor_mac.h
diff --git a/device/bluetooth/bluetooth_remote_gatt_descriptor_mac.h b/device/bluetooth/bluetooth_remote_gatt_descriptor_mac.h
index 60d4062498790ff2fb79facd2696f89d1d7fa7c0..e7c10354c20aaf11ed6e36d0bd1413cd2360b6fb 100644
--- a/device/bluetooth/bluetooth_remote_gatt_descriptor_mac.h
+++ b/device/bluetooth/bluetooth_remote_gatt_descriptor_mac.h
@@ -44,8 +44,19 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothRemoteGattDescriptorMac
const ErrorCallback& error_callback) override;
private:
+ friend class BluetoothLowEnergyDeviceMac;
friend class BluetoothRemoteGattCharacteristicMac;
+ friend class BluetoothTestMac;
+ // Calls callbacks, when -[id<CBPeripheralDelegate>
+ // peripheral:didUpdateValueForDescriptor:error:] is called.
+ void DidUpdateValueForDescriptor(NSError* error);
+ // Calls callbacks, when -[id<CBPeripheralDelegate>
+ // peripheral:didWriteValueForDescriptor:error:] is called.
+ void DidWriteValueForDescriptor(NSError* error);
+
+ // Returns CoreBluetooth peripheral.
+ CBPeripheral* GetCBPeripheral() const;
// Returns CoreBluetooth descriptor.
CBDescriptor* GetCBDescriptor() const;
// gatt_characteristic_ owns instances of this class.
@@ -58,6 +69,12 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothRemoteGattDescriptorMac
BluetoothUUID uuid_;
// Descriptor value.
std::vector<uint8_t> value_;
+ // True if a gatt read or write request is in progress.
+ bool value_read_or_write_in_progress_;
+ // ReadRemoteDescriptor request callbacks.
+ std::pair<ValueCallback, ErrorCallback> read_value_callbacks_;
+ // WriteRemoteDescriptor request callbacks.
+ std::pair<base::Closure, ErrorCallback> write_value_callbacks_;
};
// Stream operator for logging.
« no previous file with comments | « device/bluetooth/bluetooth_remote_gatt_characteristic_mac.h ('k') | device/bluetooth/bluetooth_remote_gatt_descriptor_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698