[email protected] | a9154e3 | 2014-02-11 04:29:57 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "device/bluetooth/bluetooth_gatt_characteristic.h" |
| 6 | |
| 7 | #include "base/logging.h" |
tommyt | 0348fa6 | 2016-03-14 22:12:28 | [diff] [blame^] | 8 | #include "device/bluetooth/bluetooth_gatt_descriptor.h" |
[email protected] | a9154e3 | 2014-02-11 04:29:57 | [diff] [blame] | 9 | |
| 10 | namespace device { |
| 11 | |
| 12 | BluetoothGattCharacteristic::BluetoothGattCharacteristic() { |
| 13 | } |
| 14 | |
| 15 | BluetoothGattCharacteristic::~BluetoothGattCharacteristic() { |
| 16 | } |
| 17 | |
| 18 | // static |
| 19 | BluetoothGattCharacteristic* BluetoothGattCharacteristic::Create( |
[email protected] | 8148ad4 | 2014-04-04 04:10:38 | [diff] [blame] | 20 | const BluetoothUUID& uuid, |
avi | 176e269 | 2015-12-22 19:26:52 | [diff] [blame] | 21 | const std::vector<uint8_t>& value, |
[email protected] | a9154e3 | 2014-02-11 04:29:57 | [diff] [blame] | 22 | Properties properties, |
| 23 | Permissions permissions) { |
| 24 | LOG(ERROR) << "Creating local GATT characteristics currently not supported."; |
| 25 | return NULL; |
| 26 | } |
| 27 | |
tommyt | 0348fa6 | 2016-03-14 22:12:28 | [diff] [blame^] | 28 | BluetoothGattDescriptor* BluetoothGattCharacteristic::GetDescriptorForUUID( |
| 29 | const BluetoothUUID& uuid) { |
| 30 | for (BluetoothGattDescriptor* descriptor : GetDescriptors()) { |
| 31 | if (descriptor->GetUUID() == uuid) { |
| 32 | return descriptor; |
| 33 | } |
| 34 | } |
| 35 | return NULL; |
| 36 | } |
| 37 | |
[email protected] | a9154e3 | 2014-02-11 04:29:57 | [diff] [blame] | 38 | } // namespace device |