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

Side by Side Diff: device/bluetooth/bluetooth_remote_gatt_service.cc

Issue 2785383002: Update unit tests for BluetoothDevice::GetPrimaryServicesByUUID() etc. (Closed)
Patch Set: address more comments 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 unified diff | Download patch
OLDNEW
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698