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

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

Issue 1872943002: Add support for local services/characteristics/descriptors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
(Empty)
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_local_gatt_characteristic_bluez.h"
6
7 #include <limits>
8 #include <utility>
9
10 #include "base/logging.h"
11 #include "base/strings/stringprintf.h"
12 #include "device/bluetooth/bluetooth_adapter_bluez.h"
13 #include "device/bluetooth/bluetooth_device.h"
14 #include "device/bluetooth/bluetooth_gatt_descriptor_bluez.h"
15 #include "device/bluetooth/bluetooth_gatt_notify_session_bluez.h"
16 #include "device/bluetooth/bluetooth_local_gatt_service_bluez.h"
17 #include "device/bluetooth/dbus/bluez_dbus_manager.h"
18 #include "third_party/cros_system_api/dbus/service_constants.h"
19
20 namespace bluez {
21
22 BluetoothLocalGattCharacteristicBlueZ::BluetoothLocalGattCharacteristicBlueZ(
23 BluetoothLocalGattServiceBlueZ* service,
24 const dbus::ObjectPath& object_path)
25 : BluetoothGattCharacteristicBlueZ(service, object_path),
26 weak_ptr_factory_(this) {
27 VLOG(1) << "Creating local GATT characteristic with identifier: "
28 << GetIdentifier() << ", UUID: " << GetUUID().canonical_value();
29 }
30
31 BluetoothLocalGattCharacteristicBlueZ::
32 ~BluetoothLocalGattCharacteristicBlueZ() {}
33
34 bool BluetoothLocalGattCharacteristicBlueZ::IsLocal() const {
35 return true;
36 }
37
38 bool BluetoothLocalGattCharacteristicBlueZ::AddDescriptor(
39 device::BluetoothGattDescriptor* descriptor) {
40 VLOG(1) << "Descriptors cannot be added to a remote GATT characteristic.";
41 return false;
42 }
43
44 bool BluetoothLocalGattCharacteristicBlueZ::UpdateValue(
45 const std::vector<uint8_t>& value) {
46 VLOG(1) << "Cannot update the value of a remote GATT characteristic.";
47 return false;
48 }
49
50 void BluetoothLocalGattCharacteristicBlueZ::StartNotifySession(
51 const NotifySessionCallback& callback,
52 const ErrorCallback& error_callback) {
53 // Doesn't apply for a local characteristic.
54 }
55
56 } // namespace bluez
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698