[pulseaudio-discuss] [PATCH] bluetooth: Add discovery to pa_bluetooth_backend_new

Luiz Augusto von Dentz luiz.dentz at gmail.com
Wed Sep 10 02:48:23 PDT 2014


From: Luiz Augusto von Dentz <luiz.von.dentz at intel.com>

---
 src/modules/bluetooth/backend-null.c  | 2 +-
 src/modules/bluetooth/backend-ofono.c | 4 +++-
 src/modules/bluetooth/bluez5-util.c   | 2 +-
 src/modules/bluetooth/bluez5-util.h   | 2 +-
 4 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/modules/bluetooth/backend-null.c b/src/modules/bluetooth/backend-null.c
index f8a145b..6e621a7 100644
--- a/src/modules/bluetooth/backend-null.c
+++ b/src/modules/bluetooth/backend-null.c
@@ -27,7 +27,7 @@
 
 #include "bluez5-util.h"
 
-pa_bluetooth_backend *pa_bluetooth_backend_new(pa_core *c) {
+pa_bluetooth_backend *pa_bluetooth_backend_new(pa_core *c, pa_bluetooth_discovery *y) {
     pa_log_debug("Bluetooth Headset Backend API support disabled");
     return NULL;
 }
diff --git a/src/modules/bluetooth/backend-ofono.c b/src/modules/bluetooth/backend-ofono.c
index bf0db47..99ff09d 100644
--- a/src/modules/bluetooth/backend-ofono.c
+++ b/src/modules/bluetooth/backend-ofono.c
@@ -54,6 +54,7 @@
 
 struct pa_bluetooth_backend {
     pa_core *core;
+    pa_bluetooth_discovery *discovery;
     pa_dbus_connection *connection;
 };
 
@@ -104,7 +105,7 @@ static DBusHandlerResult hf_audio_agent_handler(DBusConnection *c, DBusMessage *
     return DBUS_HANDLER_RESULT_HANDLED;
 }
 
-pa_bluetooth_backend *pa_bluetooth_backend_new(pa_core *c) {
+pa_bluetooth_backend *pa_bluetooth_backend_new(pa_core *c, pa_bluetooth_discovery *y) {
     pa_bluetooth_backend *backend;
     DBusError err;
     static const DBusObjectPathVTable vtable_hf_audio_agent = {
@@ -115,6 +116,7 @@ pa_bluetooth_backend *pa_bluetooth_backend_new(pa_core *c) {
 
     backend = pa_xnew0(pa_bluetooth_backend, 1);
     backend->core = c;
+    backend->discovery = y;
 
     dbus_error_init(&err);
 
diff --git a/src/modules/bluetooth/bluez5-util.c b/src/modules/bluetooth/bluez5-util.c
index 97862d5..8bb57f4 100644
--- a/src/modules/bluetooth/bluez5-util.c
+++ b/src/modules/bluetooth/bluez5-util.c
@@ -896,7 +896,7 @@ static void get_managed_objects_reply(DBusPendingCall *pending, void *userdata)
     y->objects_listed = true;
 
     if (!y->backend)
-        y->backend = pa_bluetooth_backend_new(y->core);
+        y->backend = pa_bluetooth_backend_new(y->core, y);
 
 finish:
     dbus_message_unref(r);
diff --git a/src/modules/bluetooth/bluez5-util.h b/src/modules/bluetooth/bluez5-util.h
index d41bf28..8db4a17 100644
--- a/src/modules/bluetooth/bluez5-util.h
+++ b/src/modules/bluetooth/bluez5-util.h
@@ -106,7 +106,7 @@ struct pa_bluetooth_adapter {
     bool valid;
 };
 
-pa_bluetooth_backend *pa_bluetooth_backend_new(pa_core *c);
+pa_bluetooth_backend *pa_bluetooth_backend_new(pa_core *c, pa_bluetooth_discovery *y);
 void pa_bluetooth_backend_free(pa_bluetooth_backend *b);
 
 pa_bluetooth_transport *pa_bluetooth_transport_new(pa_bluetooth_device *d, const char *owner, const char *path,
-- 
1.9.3



More information about the pulseaudio-discuss mailing list