OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "device/bluetooth/bluetooth_remote_gatt_service.h" | 5 #include "device/bluetooth/bluetooth_remote_gatt_service.h" |
6 | 6 |
7 #include "device/bluetooth/bluetooth_remote_gatt_characteristic.h" | |
8 #include "device/bluetooth/bluetooth_uuid.h" | |
9 | |
7 namespace device { | 10 namespace device { |
8 | 11 |
9 BluetoothRemoteGattService::BluetoothRemoteGattService() {} | 12 BluetoothRemoteGattService::BluetoothRemoteGattService() {} |
10 | 13 |
11 BluetoothRemoteGattService::~BluetoothRemoteGattService() {} | 14 BluetoothRemoteGattService::~BluetoothRemoteGattService() {} |
12 | 15 |
16 std::vector<BluetoothRemoteGattCharacteristic*> | |
17 BluetoothRemoteGattService::GetCharacteristicsByUUID( | |
18 const BluetoothUUID& characteristic_uuid) { | |
19 std::vector<BluetoothRemoteGattCharacteristic*> result; | |
20 std::vector<BluetoothRemoteGattCharacteristic*> characteristics = | |
21 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! :).
| |
22 for (auto* characteristic : characteristics) { | |
23 if (characteristic->GetUUID() == characteristic_uuid) { | |
24 result.push_back(characteristic); | |
25 } | |
26 } | |
27 return result; | |
28 } | |
29 | |
13 } // namespace device | 30 } // namespace device |
OLD | NEW |