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

Unified Diff: device/bluetooth/dbus/fake_bluetooth_gatt_application_service_provider.cc

Issue 1920693002: Complete //device/bt implementation for hosting local GATT attributes. (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/dbus/fake_bluetooth_gatt_application_service_provider.cc
diff --git a/device/bluetooth/dbus/fake_bluetooth_gatt_application_service_provider.cc b/device/bluetooth/dbus/fake_bluetooth_gatt_application_service_provider.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a52491d9f3cb3d513de80bcfb7eff016fd98f5b4
--- /dev/null
+++ b/device/bluetooth/dbus/fake_bluetooth_gatt_application_service_provider.cc
@@ -0,0 +1,44 @@
+// Copyright 2016 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/dbus/fake_bluetooth_gatt_application_service_provider.h"
+
+#include <string>
+
+#include "base/logging.h"
+#include "device/bluetooth/dbus/bluez_dbus_manager.h"
+#include "device/bluetooth/dbus/fake_bluetooth_gatt_manager_client.h"
+
+namespace bluez {
+
+FakeBluetoothGattApplicationServiceProvider::
+ FakeBluetoothGattApplicationServiceProvider(
+ const dbus::ObjectPath& object_path,
+ const std::map<dbus::ObjectPath, BluetoothLocalGattServiceBlueZ*>&
+ services)
+ : object_path_(object_path) {
+ VLOG(1) << "Creating Bluetooth GATT service: " << object_path_.value();
+
+ FakeBluetoothGattManagerClient* fake_bluetooth_gatt_manager_client =
+ static_cast<FakeBluetoothGattManagerClient*>(
+ bluez::BluezDBusManager::Get()->GetBluetoothGattManagerClient());
+ fake_bluetooth_gatt_manager_client->RegisterApplicationServiceProvider(this);
+
+ BluetoothGattApplicationServiceProvider::CreateAttributeServiceProviders(
+ nullptr, services, &service_providers_, &characteristic_providers_,
+ &descriptor_providers_);
+}
+
+FakeBluetoothGattApplicationServiceProvider::
+ ~FakeBluetoothGattApplicationServiceProvider() {
+ VLOG(1) << "Cleaning up Bluetooth GATT application: " << object_path_.value();
+
+ FakeBluetoothGattManagerClient* fake_bluetooth_gatt_manager_client =
+ static_cast<FakeBluetoothGattManagerClient*>(
+ bluez::BluezDBusManager::Get()->GetBluetoothGattManagerClient());
+ fake_bluetooth_gatt_manager_client->UnregisterApplicationServiceProvider(
+ this);
+}
+
+} // namespace bluez

Powered by Google App Engine
This is Rietveld 408576698