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..ab87dbb2f9bb416836d19a6966f0eefe113e94df 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 value_ and notifies the adapter of the new value. |
|
msarda
2016/06/29 07:57:39
s/value_/|value_|
jlebel
2016/06/29 08:05:56
i've been asked to remove the ||.
|
| + 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. |
|
msarda
2016/06/29 07:57:39
I do not understand what "failed" means: does this
jlebel
2016/06/29 08:05:57
Done.
|
| + 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 |