Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_gatt_characteristic.h" | 5 #include "device/bluetooth/bluetooth_gatt_characteristic.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "device/bluetooth/bluetooth_gatt_descriptor.h" | |
| 8 | 9 |
| 9 namespace device { | 10 namespace device { |
| 10 | 11 |
| 11 BluetoothGattCharacteristic::BluetoothGattCharacteristic() { | 12 BluetoothGattCharacteristic::BluetoothGattCharacteristic() { |
| 12 } | 13 } |
| 13 | 14 |
| 14 BluetoothGattCharacteristic::~BluetoothGattCharacteristic() { | 15 BluetoothGattCharacteristic::~BluetoothGattCharacteristic() { |
| 15 } | 16 } |
| 16 | 17 |
| 17 // static | 18 // static |
| 18 BluetoothGattCharacteristic* BluetoothGattCharacteristic::Create( | 19 BluetoothGattCharacteristic* BluetoothGattCharacteristic::Create( |
| 19 const BluetoothUUID& uuid, | 20 const BluetoothUUID& uuid, |
| 20 const std::vector<uint8_t>& value, | 21 const std::vector<uint8_t>& value, |
| 21 Properties properties, | 22 Properties properties, |
| 22 Permissions permissions) { | 23 Permissions permissions) { |
| 23 LOG(ERROR) << "Creating local GATT characteristics currently not supported."; | 24 LOG(ERROR) << "Creating local GATT characteristics currently not supported."; |
| 24 return NULL; | 25 return NULL; |
| 25 } | 26 } |
| 26 | 27 |
| 28 BluetoothGattDescriptor* BluetoothGattCharacteristic::GetDescriptorForUUID( | |
|
scheib
2016/03/02 06:15:20
We should add a test to bluetooth_gatt_characteris
scheib
2016/03/11 03:17:30
Done.
| |
| 29 const BluetoothUUID& uuid) { | |
| 30 for (BluetoothGattDescriptor* descriptor : GetDescriptors()) { | |
| 31 if (descriptor->GetUUID() == uuid) { | |
| 32 return descriptor; | |
| 33 } | |
| 34 } | |
| 35 return NULL; | |
|
ortuno
2016/03/04 17:39:47
nit: nullptr
scheib
2016/03/11 03:17:30
Done.
| |
| 36 } | |
| 37 | |
| 27 } // namespace device | 38 } // namespace device |
| OLD | NEW |