summaryrefslogtreecommitdiffstats
path: root/device/bluetooth/bluetooth_gatt_characteristic.cc
blob: d4b3427bab26f767674a40d32e994eb4d83cc4a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "device/bluetooth/bluetooth_gatt_characteristic.h"

#include "base/logging.h"
#include "device/bluetooth/bluetooth_gatt_descriptor.h"

namespace device {

BluetoothGattCharacteristic::BluetoothGattCharacteristic() {
}

BluetoothGattCharacteristic::~BluetoothGattCharacteristic() {
}

// static
BluetoothGattCharacteristic* BluetoothGattCharacteristic::Create(
    const BluetoothUUID& uuid,
    const std::vector<uint8_t>& value,
    Properties properties,
    Permissions permissions) {
  LOG(ERROR) << "Creating local GATT characteristics currently not supported.";
  return NULL;
}

std::vector<BluetoothGattDescriptor*>
BluetoothGattCharacteristic::GetDescriptorsByUUID(const BluetoothUUID& uuid) {
  std::vector<BluetoothGattDescriptor*> descriptors;
  for (BluetoothGattDescriptor* descriptor : GetDescriptors()) {
    if (descriptor->GetUUID() == uuid) {
      descriptors.push_back(descriptor);
    }
  }
  return descriptors;
}

}  // namespace device