Index: device/bluetooth/bluetooth_remote_gatt_characteristic_win.h |
diff --git a/device/bluetooth/bluetooth_remote_gatt_characteristic_win.h b/device/bluetooth/bluetooth_remote_gatt_characteristic_win.h |
index f397363f500d1e606fb935949cce3cb73910732b..9e94b696c2a51f00ba2f76a47152a1870a87bdb5 100644 |
--- a/device/bluetooth/bluetooth_remote_gatt_characteristic_win.h |
+++ b/device/bluetooth/bluetooth_remote_gatt_characteristic_win.h |
@@ -5,6 +5,8 @@ |
#ifndef DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_WIN_H_ |
#define DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_WIN_H_ |
+#include <unordered_map> |
+ |
#include "base/memory/weak_ptr.h" |
#include "base/sequenced_task_runner.h" |
#include "device/bluetooth/bluetooth_gatt_characteristic.h" |
@@ -13,6 +15,7 @@ |
namespace device { |
class BluetoothAdapterWin; |
+class BluetoothRemoteGattDescriptorWin; |
class BluetoothRemoteGattServiceWin; |
class BluetoothTaskManagerWin; |
@@ -54,6 +57,23 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothRemoteGattCharacteristicWin |
uint16_t GetAttributeHandle() const; |
private: |
+ void OnGetIncludedDescriptorsCallback( |
+ scoped_ptr<BTH_LE_GATT_DESCRIPTOR> descriptors, |
+ uint16_t num, |
+ HRESULT hr); |
+ void UpdateIncludedDescriptors(PBTH_LE_GATT_DESCRIPTOR descriptors, |
+ uint16_t num); |
+ |
+ // Checks if the descriptor with |uuid| and |attribute_handle| has already |
+ // been discovered as included descriptor. |
+ bool IsDescriptorDiscovered(BTH_LE_UUID& uuid, uint16_t attribute_handle); |
+ |
+ // Checks if |descriptor| still exists in this characteristic according to |
+ // newly discovered |num| of |descriptors|. |
+ static bool DoesDescriptorExist(PBTH_LE_GATT_DESCRIPTOR descriptors, |
+ uint16_t num, |
+ BluetoothRemoteGattDescriptorWin* descriptor); |
+ |
BluetoothAdapterWin* adapter_; |
BluetoothRemoteGattServiceWin* parent_service_; |
scoped_refptr<BluetoothTaskManagerWin> task_manager_; |
@@ -65,6 +85,17 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothRemoteGattCharacteristicWin |
std::vector<uint8_t> characteristic_value_; |
std::string characteristic_identifier_; |
+ // The key of GattDescriptorMap is the identitfier of |
+ // BluetoothRemoteGattDescriptorWin instance. |
+ typedef std::unordered_map<std::string, |
+ scoped_ptr<BluetoothRemoteGattDescriptorWin>> |
+ GattDescriptorMap; |
+ GattDescriptorMap included_descriptors_; |
+ |
+ // Flag indicates if characteristic added notification of this characteristic |
+ // has been send out to avoid duplicate notification. |
scheib
2016/03/01 00:06:22
sent
gogerald1
2016/03/01 17:00:13
Done.
|
+ bool characteristic_added_notified_; |
+ |
base::WeakPtrFactory<BluetoothRemoteGattCharacteristicWin> weak_ptr_factory_; |
DISALLOW_COPY_AND_ASSIGN(BluetoothRemoteGattCharacteristicWin); |
}; |