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

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

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.h
diff --git a/device/bluetooth/dbus/fake_bluetooth_gatt_application_service_provider.h b/device/bluetooth/dbus/fake_bluetooth_gatt_application_service_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..4154c8b9766ca63b44a803f5c2ce7570c67f5942
--- /dev/null
+++ b/device/bluetooth/dbus/fake_bluetooth_gatt_application_service_provider.h
@@ -0,0 +1,60 @@
+// 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.
+
+#ifndef DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_GATT_APPLICATION_SERVICE_PROVIDER_H_
+#define DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_GATT_APPLICATION_SERVICE_PROVIDER_H_
+
+#include <map>
+#include <vector>
+
+#include "base/macros.h"
+#include "dbus/object_path.h"
+#include "device/bluetooth/bluetooth_export.h"
+#include "device/bluetooth/bluez/bluetooth_local_gatt_service_bluez.h"
+#include "device/bluetooth/dbus/bluetooth_gatt_application_service_provider.h"
+#include "device/bluetooth/dbus/bluetooth_gatt_characteristic_service_provider.h"
+#include "device/bluetooth/dbus/bluetooth_gatt_descriptor_service_provider.h"
+#include "device/bluetooth/dbus/bluetooth_gatt_service_service_provider.h"
+
+namespace bluez {
+
+class BluetoothLocalGattCharacteristicBlueZ;
+class BluetoothLocalGattDescriptorBlueZ;
+class BluetoothLocalGattServiceBlueZ;
+
+// FakeBluetoothGattApplicationServiceProvider simulates behavior of a local
+// GATT service object and is used both in test cases in place of a mock and on
+// the Linux desktop.
+class DEVICE_BLUETOOTH_EXPORT FakeBluetoothGattApplicationServiceProvider
+ : public BluetoothGattApplicationServiceProvider {
+ public:
+ FakeBluetoothGattApplicationServiceProvider(
+ const dbus::ObjectPath& object_path,
+ const std::map<dbus::ObjectPath, BluetoothLocalGattServiceBlueZ*>&
+ services);
+ ~FakeBluetoothGattApplicationServiceProvider() override;
+
+ const dbus::ObjectPath& object_path() const { return object_path_; }
+
+ private:
+ // D-Bus object path of the fake GATT service.
+ dbus::ObjectPath object_path_;
+
+ // List of GATT Service service providers managed by this object manager.
+ std::vector<std::unique_ptr<BluetoothGattServiceServiceProvider>>
+ service_providers_;
+ // List of GATT Characteristic service providers managed by this object
+ // manager.
+ std::vector<std::unique_ptr<BluetoothGattCharacteristicServiceProvider>>
+ characteristic_providers_;
+ // List of GATT Descriptor service providers managed by this object manager.
+ std::vector<std::unique_ptr<BluetoothGattDescriptorServiceProvider>>
+ descriptor_providers_;
+
+ DISALLOW_COPY_AND_ASSIGN(FakeBluetoothGattApplicationServiceProvider);
+};
+
+} // namespace bluez
+
+#endif // DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_GATT_APPLICATION_SERVICE_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698