Chromium Code Reviews| Index: device/bluetooth/bluetooth_remote_gatt_characteristic_mac.h |
| diff --git a/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.h b/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.h |
| index 4db6bacd82fb4f4843fb29b0d5d55a1f59e7ea18..b09f89d596833621c271b9f26221dc60f8814b43 100644 |
| --- a/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.h |
| +++ b/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.h |
| @@ -8,6 +8,7 @@ |
| #include "device/bluetooth/bluetooth_remote_gatt_characteristic.h" |
| #include "base/mac/scoped_nsobject.h" |
| +#include "base/memory/weak_ptr.h" |
| #if defined(__OBJC__) |
| #import <CoreBluetooth/CoreBluetooth.h> |
| @@ -60,13 +61,20 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothRemoteGattCharacteristicMac |
| // Called by the BluetoothRemoteGattServiceMac instance when the |
| // characteristics value has been read. |
| void DidUpdateValue(NSError* error); |
| + // Updates the value_ and send notify the mac adapter for the new value |
|
ortuno
2016/06/28 19:18:58
grammar nit: Updates value_ and notifies the adapt
jlebel
2016/06/28 21:09:33
Done.
|
| + void UpdateValueAndNotify(); |
| // Called by the BluetoothRemoteGattServiceMac instance when the |
| // characteristics value has been written. |
| void DidWriteValue(NSError* error); |
| + // Called by the BluetoothRemoteGattServiceMac instance when the notify |
| + // session has been started or failed. |
| + void DidUpdateNotificationState(NSError* error); |
| // Returns true if the characteristic is readable. |
| bool IsReadable() const; |
| // Returns true if the characteristic is writable. |
| bool IsWritable() const; |
| + // Returns true if the characteristic supports notifications or indications. |
| + bool SupportsNotificationsOrIndications() const; |
| // Returns the write type (with or without responses). |
| CBCharacteristicWriteType GetCBWriteType() const; |
| // Returns CoreBluetooth characteristic. |
| @@ -88,6 +96,13 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothRemoteGattCharacteristicMac |
| std::pair<ValueCallback, ErrorCallback> read_characteristic_value_callbacks_; |
| // WriteRemoteCharacteristic request callbacks. |
| std::pair<base::Closure, ErrorCallback> write_characteristic_value_callbacks_; |
| + // Stores StartNotifySession request callbacks. |
| + typedef std::pair<NotifySessionCallback, ErrorCallback> |
| + PendingStartNotifyCall; |
| + std::vector<PendingStartNotifyCall> start_notify_session_callbacks_; |
| + // Flag indicates if GATT event registration is in progress. |
| + bool start_notifications_in_progress_; |
| + base::WeakPtrFactory<BluetoothRemoteGattCharacteristicMac> weak_ptr_factory_; |
| }; |
| } // namespace device |