summaryrefslogtreecommitdiffstats
path: root/device/bluetooth/bluetooth_gatt_characteristic.cc
diff options
context:
space:
mode:
authortommyt <tommyt@opera.com>2016-03-14 15:12:28 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-14 22:14:58 +0000
commit0348fa65c3d808f854f745fb9f8f185a5b74b922 (patch)
treea5dd2b2dc34bad55c18d974fb6d633ad13354493 /device/bluetooth/bluetooth_gatt_characteristic.cc
parent59d3539fc7ce60355ccf52c00733d33dde5e118a (diff)
downloadchromium_src-0348fa65c3d808f854f745fb9f8f185a5b74b922.zip
chromium_src-0348fa65c3d808f854f745fb9f8f185a5b74b922.tar.gz
chromium_src-0348fa65c3d808f854f745fb9f8f185a5b74b922.tar.bz2
bluetooth: android: Confirm the notify session after the descriptor has been written.
This change also implements WriteRemoteDescriptor and ReadRemoteDescriptor. Because of this, I've also added quite a few descriptor unit tests. These tests are pretty much the same as the read/write tests for characteristics. BUG=584369 Review URL: https://codereview.chromium.org/1712593002 Cr-Commit-Position: refs/heads/master@{#381088}
Diffstat (limited to 'device/bluetooth/bluetooth_gatt_characteristic.cc')
-rw-r--r--device/bluetooth/bluetooth_gatt_characteristic.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/device/bluetooth/bluetooth_gatt_characteristic.cc b/device/bluetooth/bluetooth_gatt_characteristic.cc
index f7bb6d8..66c39f6 100644
--- a/device/bluetooth/bluetooth_gatt_characteristic.cc
+++ b/device/bluetooth/bluetooth_gatt_characteristic.cc
@@ -5,6 +5,7 @@
#include "device/bluetooth/bluetooth_gatt_characteristic.h"
#include "base/logging.h"
+#include "device/bluetooth/bluetooth_gatt_descriptor.h"
namespace device {
@@ -24,4 +25,14 @@ BluetoothGattCharacteristic* BluetoothGattCharacteristic::Create(
return NULL;
}
+BluetoothGattDescriptor* BluetoothGattCharacteristic::GetDescriptorForUUID(
+ const BluetoothUUID& uuid) {
+ for (BluetoothGattDescriptor* descriptor : GetDescriptors()) {
+ if (descriptor->GetUUID() == uuid) {
+ return descriptor;
+ }
+ }
+ return NULL;
+}
+
} // namespace device