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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/bluetooth_local_gatt_characteristic_bluez.cc
diff --git a/device/bluetooth/bluetooth_local_gatt_characteristic_bluez.cc b/device/bluetooth/bluetooth_local_gatt_characteristic_bluez.cc
new file mode 100644
index 0000000000000000000000000000000000000000..416de0ba8cc57057291bac63dd2ffc0468367800
--- /dev/null
+++ b/device/bluetooth/bluetooth_local_gatt_characteristic_bluez.cc
@@ -0,0 +1,56 @@
+// 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_local_gatt_characteristic_bluez.h"
+
+#include <limits>
+#include <utility>
+
+#include "base/logging.h"
+#include "base/strings/stringprintf.h"
+#include "device/bluetooth/bluetooth_adapter_bluez.h"
+#include "device/bluetooth/bluetooth_device.h"
+#include "device/bluetooth/bluetooth_gatt_descriptor_bluez.h"
+#include "device/bluetooth/bluetooth_gatt_notify_session_bluez.h"
+#include "device/bluetooth/bluetooth_local_gatt_service_bluez.h"
+#include "device/bluetooth/dbus/bluez_dbus_manager.h"
+#include "third_party/cros_system_api/dbus/service_constants.h"
+
+namespace bluez {
+
+BluetoothLocalGattCharacteristicBlueZ::BluetoothLocalGattCharacteristicBlueZ(
+ BluetoothLocalGattServiceBlueZ* service,
+ const dbus::ObjectPath& object_path)
+ : BluetoothGattCharacteristicBlueZ(service, object_path),
+ weak_ptr_factory_(this) {
+ VLOG(1) << "Creating local GATT characteristic with identifier: "
+ << GetIdentifier() << ", UUID: " << GetUUID().canonical_value();
+}
+
+BluetoothLocalGattCharacteristicBlueZ::
+ ~BluetoothLocalGattCharacteristicBlueZ() {}
+
+bool BluetoothLocalGattCharacteristicBlueZ::IsLocal() const {
+ return true;
+}
+
+bool BluetoothLocalGattCharacteristicBlueZ::AddDescriptor(
+ device::BluetoothGattDescriptor* descriptor) {
+ VLOG(1) << "Descriptors cannot be added to a remote GATT characteristic.";
+ return false;
+}
+
+bool BluetoothLocalGattCharacteristicBlueZ::UpdateValue(
+ const std::vector<uint8_t>& value) {
+ VLOG(1) << "Cannot update the value of a remote GATT characteristic.";
+ return false;
+}
+
+void BluetoothLocalGattCharacteristicBlueZ::StartNotifySession(
+ const NotifySessionCallback& callback,
+ const ErrorCallback& error_callback) {
+ // Doesn't apply for a local characteristic.
+}
+
+} // namespace bluez

Powered by Google App Engine
This is Rietveld 408576698