bluetooth: Add discovery to pa_bluetooth_backend_new

This commit is contained in:
Luiz Augusto von Dentz 2014-09-10 11:48:23 +02:00 committed by Tanu Kaskinen
parent 5c2ed8abed
commit f508b34b8b
4 changed files with 6 additions and 4 deletions

View file

@ -27,7 +27,7 @@
#include "bluez5-util.h" #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"); pa_log_debug("Bluetooth Headset Backend API support disabled");
return NULL; return NULL;
} }

View file

@ -54,6 +54,7 @@
struct pa_bluetooth_backend { struct pa_bluetooth_backend {
pa_core *core; pa_core *core;
pa_bluetooth_discovery *discovery;
pa_dbus_connection *connection; pa_dbus_connection *connection;
}; };
@ -104,7 +105,7 @@ static DBusHandlerResult hf_audio_agent_handler(DBusConnection *c, DBusMessage *
return DBUS_HANDLER_RESULT_HANDLED; 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; pa_bluetooth_backend *backend;
DBusError err; DBusError err;
static const DBusObjectPathVTable vtable_hf_audio_agent = { 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 = pa_xnew0(pa_bluetooth_backend, 1);
backend->core = c; backend->core = c;
backend->discovery = y;
dbus_error_init(&err); dbus_error_init(&err);

View file

@ -896,7 +896,7 @@ static void get_managed_objects_reply(DBusPendingCall *pending, void *userdata)
y->objects_listed = true; y->objects_listed = true;
if (!y->backend) if (!y->backend)
y->backend = pa_bluetooth_backend_new(y->core); y->backend = pa_bluetooth_backend_new(y->core, y);
finish: finish:
dbus_message_unref(r); dbus_message_unref(r);

View file

@ -106,7 +106,7 @@ struct pa_bluetooth_adapter {
bool valid; 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); 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, pa_bluetooth_transport *pa_bluetooth_transport_new(pa_bluetooth_device *d, const char *owner, const char *path,