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

Unified Diff: device/bluetooth/bluez/bluetooth_adapter_bluez.h

Issue 1919683002: Adapter changes for implementing local GATT attributes and tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dbus_classes
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/bluez/bluetooth_adapter_bluez.h
diff --git a/device/bluetooth/bluez/bluetooth_adapter_bluez.h b/device/bluetooth/bluez/bluetooth_adapter_bluez.h
index 07732c1645cf949e41f7eddcd8bc7d805b502a62..33e6f5680f82ce8431c1475bd75fd919bb8e5f35 100644
--- a/device/bluetooth/bluez/bluetooth_adapter_bluez.h
+++ b/device/bluetooth/bluez/bluetooth_adapter_bluez.h
@@ -23,6 +23,7 @@
#include "device/bluetooth/bluetooth_device.h"
#include "device/bluetooth/bluetooth_discovery_session.h"
#include "device/bluetooth/bluetooth_export.h"
+#include "device/bluetooth/bluetooth_gatt_service.h"
#include "device/bluetooth/dbus/bluetooth_adapter_client.h"
#include "device/bluetooth/dbus/bluetooth_agent_service_provider.h"
#include "device/bluetooth/dbus/bluetooth_device_client.h"
@@ -45,6 +46,7 @@ class BluetoothBlueZTest;
class BluetoothAdapterProfileBlueZ;
class BluetoothDeviceBlueZ;
class BluetoothLocalGattServiceBlueZ;
+class BluetoothGattApplicationServiceProvider;
class BluetoothPairingBlueZ;
// The BluetoothAdapterBlueZ class implements BluetoothAdapter for platforms
@@ -150,9 +152,25 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterBlueZ
void ReleaseProfile(const dbus::ObjectPath& device_path,
BluetoothAdapterProfileBlueZ* profile);
+ // Add a local GATT service to the list of services owned by this adapter.
void AddLocalGattService(
std::unique_ptr<BluetoothLocalGattServiceBlueZ> service);
+ // Register a GATT service. The service must belong to this adapter.
+ void RegisterGattService(
+ BluetoothLocalGattServiceBlueZ* service,
+ const base::Closure& callback,
+ const device::BluetoothGattService::ErrorCallback& error_callback);
+
+ // Unregister a GATT service. The service must already be registered.
+ void UnregisterGattService(
+ BluetoothLocalGattServiceBlueZ* service,
+ const base::Closure& callback,
+ const device::BluetoothGattService::ErrorCallback& error_callback);
+
+ // Returns the object path of the adapter.
+ dbus::ObjectPath GetApplicationObjectPath() const;
+
protected:
// BluetoothAdapter:
void RemovePairingDelegateInternal(
@@ -348,6 +366,12 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterBlueZ
// ended (with either success or failure).
void ProcessQueuedDiscoveryRequests();
+ // Make the call to GattManager1 to register the services currently exported
+ // by the GATT Application service provider.
+ void RegisterApplication(
+ const base::Closure& callback,
+ const device::BluetoothGattService::ErrorCallback& error_callback);
+
InitCallback init_callback_;
bool initialized_;
@@ -396,9 +420,19 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterBlueZ
std::unique_ptr<device::BluetoothDiscoveryFilter> current_filter_;
+ // List of GATT services that are owned by this adapter.
std::vector<std::unique_ptr<BluetoothLocalGattServiceBlueZ>>
owned_gatt_services_;
+ // GATT services that are currently available on the GATT server.
+ std::map<dbus::ObjectPath, BluetoothLocalGattServiceBlueZ*>
+ registered_gatt_services_;
+
+ // DBus Object Manager that acts as a service provider for all the services
+ // that are registered with this adapter.
+ std::unique_ptr<BluetoothGattApplicationServiceProvider>
+ gatt_application_provider_;
+
// Note: This should remain the last member so it'll be destroyed and
// invalidate its weak pointers before any other members are destroyed.
base::WeakPtrFactory<BluetoothAdapterBlueZ> weak_ptr_factory_;
« no previous file with comments | « device/bluetooth/bluetooth_local_gatt_descriptor_unittest.cc ('k') | device/bluetooth/bluez/bluetooth_adapter_bluez.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698