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(); |
ortuno
2017/04/04 22:14:12
Nice! I thought we might have to refactor all impl
juncai
2017/04/05 00:36:46
Thanks! :).
|
+ for (auto* characteristic : characteristics) { |
+ if (characteristic->GetUUID() == characteristic_uuid) { |
+ result.push_back(characteristic); |
+ } |
+ } |
+ return result; |
+} |
+ |
} // namespace device |