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..602d55de9ae883fa85c9ebae64113ab7a4385feb 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 16:24:50
nit: Usually the "|" are used when referring to a
jlebel
2016/06/28 18:09:52
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 is notifiable or indicatable. |
|
ortuno
2016/06/28 16:24:49
nit: ... if the characteristic supports notificati
jlebel
2016/06/28 18:09:52
Done.
|
| + bool IsNotifiableOrIndicatable() const; |
|
ortuno
2016/06/28 16:24:49
nit: SupportsNotificationsOrIndications.
jlebel
2016/06/28 18:09:52
Done.
|
| // Returns the write type (with or without responses). |
| CBCharacteristicWriteType GetCBWriteType() const; |
| // Returns CoreBluetooth characteristic. |
| @@ -88,6 +96,12 @@ 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_; |
| + // Vector stores StartNotifySession request callbacks. |
|
ortuno
2016/06/28 16:24:49
nit: Remove "Vector". The type is easy to see alre
jlebel
2016/06/28 18:09:52
Done.
|
| + std::vector<std::pair<NotifySessionCallback, ErrorCallback>> |
|
ortuno
2016/06/28 16:24:49
nit optional: make the pair a typedef like https:/
jlebel
2016/06/28 18:09:52
Done.
|
| + start_notify_session_callbacks_; |
| + // Flag indicates if GATT event registration is in progress. |
| + bool gatt_event_registeration_in_progress_; |
|
ortuno
2016/06/28 16:24:49
nit: change this to start_notifications_in_progres
jlebel
2016/06/28 18:09:52
Done.
|
| + base::WeakPtrFactory<BluetoothRemoteGattCharacteristicMac> weak_ptr_factory_; |
| }; |
| } // namespace device |