Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1128)

Unified Diff: device/bluetooth/bluetooth_remote_gatt_service.cc

Issue 2785383002: Update unit tests for BluetoothDevice::GetPrimaryServicesByUUID() etc. (Closed)
Patch Set: added TODO Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/bluetooth_remote_gatt_service.cc
diff --git a/device/bluetooth/bluetooth_remote_gatt_service.cc b/device/bluetooth/bluetooth_remote_gatt_service.cc
index 6acb9d6b41f5a8c06acab5cf070ca8cb88917123..352b34d8332f46eda4fa7f90f667c941ed0ea76e 100644
--- a/device/bluetooth/bluetooth_remote_gatt_service.cc
+++ b/device/bluetooth/bluetooth_remote_gatt_service.cc
@@ -4,10 +4,27 @@
#include "device/bluetooth/bluetooth_remote_gatt_service.h"
+#include "device/bluetooth/bluetooth_remote_gatt_characteristic.h"
+#include "device/bluetooth/bluetooth_uuid.h"
+
namespace device {
BluetoothRemoteGattService::BluetoothRemoteGattService() {}
BluetoothRemoteGattService::~BluetoothRemoteGattService() {}
+std::vector<BluetoothRemoteGattCharacteristic*>
+BluetoothRemoteGattService::GetCharacteristicsByUUID(
+ const BluetoothUUID& characteristic_uuid) {
+ std::vector<BluetoothRemoteGattCharacteristic*> result;
+ std::vector<BluetoothRemoteGattCharacteristic*> characteristics =
+ GetCharacteristics();
+ for (auto* characteristic : characteristics) {
+ if (characteristic->GetUUID() == characteristic_uuid) {
+ result.push_back(characteristic);
+ }
+ }
+ return result;
+}
+
} // namespace device

Powered by Google App Engine
This is Rietveld 408576698