debian/0000775000000000000000000000000012321547016007171 5ustar debian/obexd-server.install0000664000000000000000000000007412321517140013162 0ustar usr/lib/obexd/obexd usr/share/dbus-1/services/obexd.service debian/compat0000664000000000000000000000000212321517140010362 0ustar 8 debian/obexd-server.docs0000664000000000000000000000002212321517140012435 0ustar doc/obexd-api.txt debian/obexd-client.install0000664000000000000000000000011012321517140013121 0ustar usr/lib/obexd/obex-client usr/share/dbus-1/services/obex-client.service debian/obexd-client.examples0000664000000000000000000000021712321517140013301 0ustar test/exchange-business-cards test/ftp-client test/list-folders test/pbap-client test/pull-business-card test/send-files debian/README.examples debian/changelog0000664000000000000000000001344612321547013011050 0ustar obexd (0.46-1ubuntu7) trusty; urgency=medium * debian/patches/backport_session_code.patch: Backport session request code from bluez 5 which does away with the session request calls to BlueZ. (LP: #1285948) -- Mathieu Trudel-Lapierre Thu, 10 Apr 2014 12:59:53 -0400 obexd (0.46-1ubuntu6) trusty; urgency=medium * Avoid double source removals during tests (LP: #1263259). -- Colin Watson Mon, 06 Jan 2014 12:49:34 +0000 obexd (0.46-1ubuntu5) saucy; urgency=low * Build against libical 1.0 -- Jonathan Riddell Thu, 13 Jun 2013 13:23:56 +0100 obexd (0.46-1ubuntu4) saucy; urgency=low * Remove obsolete libebook BD; using the "dummy" (ical) phonebook driver. -- Iain Lane Wed, 29 May 2013 17:07:08 +0100 obexd (0.46-1ubuntu3) raring; urgency=low * Add sys/types.h includes to fix the build failure with glibc-2.17. -- Matthias Klose Tue, 02 Apr 2013 18:59:34 +0100 obexd (0.46-1ubuntu2) quantal; urgency=low * debian/rules: - Drop --with-phonebook=ebook. It won't build against EDS 3.5. -- Mathieu Trudel-Lapierre Wed, 12 Sep 2012 10:16:39 -0400 obexd (0.46-1ubuntu1) quantal-proposed; urgency=low * Rebase on Debian unstable, remaining Ubuntu changes: * debian/patches/tests-may-block.patch: - Don't pass SOCK_NONBLOCK as an option for the socket type to socketpair(), this doesn't work on buildds. * debian/control: - Drop libopenobex1 from Build-Depends, it's no longer needed and replaced by gobex (in source). -- Robert Ancell Tue, 03 Jul 2012 13:23:53 +1200 obexd (0.46-1) unstable; urgency=low * New upstream release. * Change source format from 1.0 to 3.0 (quilt). * Update debian/rules. Add support hardending option. * Fix build by glib-helper.h. Add patches/Remove_left_over_glib-helper.h_support.patch -- Nobuhiro Iwamatsu Mon, 28 May 2012 13:20:20 +0900 obexd (0.45-1) unstable; urgency=low * New upstream release. * Update debian/control. - Dump Standard-Version to 3.9.3 (no change needed). - Dump version of libbluetooth-dev. obexd need version 4.99 and more. - Add libebook1.2-dev to Build-Depends. * Update debian/rules. - Add --with-phonebook=ebook. -- Nobuhiro Iwamatsu Thu, 08 Mar 2012 16:54:07 +0900 obexd (0.44-1) unstable; urgency=low * New upstream release. * Fix typo in package description (device -> devices). (Closes: #636616) -- Nobuhiro Iwamatsu Tue, 24 Jan 2012 12:02:33 +0900 obexd (0.44-0ubuntu1) precise; urgency=low * New upstream release. -- Mathieu Trudel-Lapierre Wed, 18 Jan 2012 13:01:09 -0500 obexd (0.43-0ubuntu2) precise; urgency=low * debian/patches/tests-may-block.patch: don't pass SOCK_NONBLOCK as an option for the socket type to socketpair(), this doesn't work on buildds. * debian/source/format: switch to format 3.0 (quilt) so patches get applied. -- Mathieu Trudel-Lapierre Fri, 06 Jan 2012 14:47:19 -0500 obexd (0.43-0ubuntu1) precise; urgency=low * New upstream release. (LP: #879923) * debian/control: drop libopenobex1 from Build-Depends, it's no longer needed and replaced by gobex (in source). -- Mathieu Trudel-Lapierre Thu, 05 Jan 2012 17:33:25 -0500 obexd (0.42-1) unstable; urgency=low * New upstream release. -- Nobuhiro Iwamatsu Thu, 04 Aug 2011 12:26:37 +0900 obexd (0.41-1) unstable; urgency=low * New upstream release. * Update debian/control. - Update Standards-Version to 3.9.2, no changes needed. - Drop cdbs from Build-Depends. * Converted from cdbs to debhelper. * Update debian/rules. enable usb and pcsuite plugins. -- Nobuhiro Iwamatsu Mon, 04 Jul 2011 23:57:21 +0900 obexd (0.40-2) unstable; urgency=low * Upload to unstable. -- Nobuhiro Iwamatsu Thu, 10 Feb 2011 18:32:00 +0900 obexd (0.40-1) experimental; urgency=low * New upstream release. -- Nobuhiro Iwamatsu Sat, 05 Feb 2011 07:01:41 +0900 obexd (0.39-1) experimental; urgency=low * New upstream release. -- Nobuhiro Iwamatsu Wed, 12 Jan 2011 20:35:41 +0900 obexd (0.37-1) experimental; urgency=low * New upstream release. * Update debian/control. - Bumped standards-version to 3.9.1. - Fix path for Vcs-Browser. -- Nobuhiro Iwamatsu Thu, 02 Dec 2010 12:17:14 +0900 obexd (0.33-1) unstable; urgency=low * New upstream release. -- Nobuhiro Iwamatsu Fri, 10 Sep 2010 17:18:16 +0900 obexd (0.28-1) unstable; urgency=low * New upstream release (Closes: #585775). * Add libical-dev to Build-depends. -- Nobuhiro Iwamatsu Thu, 17 Jun 2010 06:19:18 +0900 obexd (0.24-1) unstable; urgency=low * New upstream release. -- Nobuhiro Iwamatsu Mon, 17 May 2010 18:34:30 +0900 obexd (0.23-1) unstable; urgency=low * New upstream release (Closes: #558710). * Update debian/control. - Remove Filippo Giunchedi from uploaders. - Add Nobuhiro Iwamatsu to Uploaders (Closes: #564570). - Bumped standards-version to 3.8.4. - Update description (Closes: #541880). * Add debian/source/format. Set source format to "1.0". -- Nobuhiro Iwamatsu Tue, 27 Apr 2010 04:17:15 +0900 obexd (0.14-1) unstable; urgency=low * First upload (Closes: #528061) + build obexd-client and obexd-server so only the latter must conflict with obex-data-server as they both use org.openobex dbus name -- Filippo Giunchedi Wed, 01 Jul 2009 12:40:00 +0200 debian/watch0000664000000000000000000000011712321517140010214 0ustar version=3 http://www.kernel.org/pub/linux/bluetooth/ .*obexd-([.\d]+)\.tar\.gz debian/source/0000775000000000000000000000000012321547016010471 5ustar debian/source/format0000664000000000000000000000001412321517140011672 0ustar 3.0 (quilt) debian/obexd-client.docs0000664000000000000000000000004512321517140012412 0ustar doc/client-api.txt doc/agent-api.txt debian/README.examples0000664000000000000000000000021212321517140011654 0ustar These examples are for demonstrating the features of obexd. python-dbus and python-gobject packages are required for the examples to run. debian/control0000664000000000000000000000270712321517140010575 0ustar Source: obexd Section: admin Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Debian Bluetooth Maintainers Uploaders: Nobuhiro Iwamatsu Build-Depends: debhelper (>= 8), dpkg-dev (>= 1.16.1~), libglib2.0-dev, libdbus-1-dev, libbluetooth-dev (>= 4.99), libical-dev (>= 1.0) Vcs-Svn: svn://svn.debian.org/svn/pkg-bluetooth/packages/obexd Vcs-Browser: http://svn.debian.org/wsvn/pkg-bluetooth/packages/obexd/ Homepage: http://www.bluez.org Standards-Version: 3.9.3 Package: obexd-client Section: admin Depends: ${shlibs:Depends}, ${misc:Depends} Architecture: any Description: D-Bus OBEX client Implementation of OBEX(OBject EXchange) client and server as a D-Bus service providing high-level functionality. . OBEX is communication protocol to facilitate the exchange of the binary object between the devices. . In this package the client is included. Package: obexd-server Section: admin Depends: ${shlibs:Depends}, ${misc:Depends} Conflicts: obex-data-server Architecture: any Description: D-Bus OBEX server Implementation of OBEX(OBject EXchange) client and server as a D-Bus service providing high-level functionality. . OBEX is communication protocol to facilitate the exchange of the binary object between the devices. . In this package the server is included. debian/obexd-server.examples0000664000000000000000000000005112321517140013325 0ustar test/simple-agent debian/README.examples debian/rules0000775000000000000000000000026612321517140010250 0ustar #!/usr/bin/make -f DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk %: dh $@ override_dh_auto_configure: dh_auto_configure -- --enable-usb \ --enable-pcsuite debian/copyright0000664000000000000000000000324712321517140011125 0ustar This package was debianized by Filippo Giunchedi on Sun May 10 14:36:03 CEST 2009 It was downloaded from http://www.bluez.org/ obexd - OBEX Server and Client Copyright: Copyright (C) 2007-2009 Marcel Holtmann Copyright (C) 2009 Nokia Corporation Copyright (C) 2007-2009 Intel Corporation Copyright (C) 2007-2008 Instituto Nokia de Tecnologia (INdT) Copyright (C) 2004-2006 Nokia Corporation. All rights reserved. License: btio/ btio.h btio.c License: GPL version 2 or any later version client/ sync.c pbap.c pbap.h main.c sync.h session.h session.c License: GPL version 2 or any later version gdbus/ object.c mainloop.c gdbus.h watch.c License: GPL version 2 or any later version gwobex/ utils.h obex-xfer.h log.h obex-priv.h utils.c gw-obex.h obex-priv.c gw-obex.c obex-xfer.c License: LGPL version 2.1 or any later version plugins/ ebook.c License: GPL version 2 or any later version src/ bluetooth.c bluetooth.h dbus.h ftp.c logging.c logging.h main.c manager.c obex.c obexd.h obex.h opp.c pbap.c phonebook.c phonebook.h plugin.c plugin.h License: GPL version 2 or any later version test/ main.c License: GPL version 2 or any later version On Debian GNU/Linux systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL', the GNU Lesser General Public License can be found in `/usr/share/common-licenses/LGPL' and the GNU Free Documentation License can be found in `/usr/share/common-licenses/GFDL'. debian/patches/0000775000000000000000000000000012321547016010620 5ustar debian/patches/Remove_left_over_glib-helper.h_support.patch0000664000000000000000000000255212321517140021436 0ustar Origin: http://git.kernel.org/?p=bluetooth/obexd.git;a=commit;h=1ae7e0cceccf301fef421f615e784e08efb581ee Bug: None Bug-Debian: None Bug-Ubuntu: None Forwarded: no Reviewed-By: No, this patch already applied in upstream. Last-Update: 2012/06/01 From 1ae7e0cceccf301fef421f615e784e08efb581ee Mon Sep 17 00:00:00 2001 From: Paul Seidler Date: Mon, 21 May 2012 16:59:27 +0200 Subject: [PATCH] Remove left over glib-helper.h support --- plugins/phonebook-ebook.c | 1 - plugins/phonebook-tracker.c | 1 - 2 files changed, 0 insertions(+), 2 deletions(-) diff --git a/plugins/phonebook-ebook.c b/plugins/phonebook-ebook.c index c2e8649..a1f06b5 100644 --- a/plugins/phonebook-ebook.c +++ b/plugins/phonebook-ebook.c @@ -37,7 +37,6 @@ #include "obex.h" #include "service.h" #include "phonebook.h" -#include "glib-helper.h" #define QUERY_FN "(contains \"family_name\" \"%s\")" #define QUERY_NAME "(contains \"given_name\" \"%s\")" diff --git a/plugins/phonebook-tracker.c b/plugins/phonebook-tracker.c index da82ff5..96635c4 100644 --- a/plugins/phonebook-tracker.c +++ b/plugins/phonebook-tracker.c @@ -35,7 +35,6 @@ #include "mimetype.h" #include "phonebook.h" #include "vcard.h" -#include "glib-helper.h" #define TRACKER_SERVICE "org.freedesktop.Tracker1" #define TRACKER_RESOURCES_PATH "/org/freedesktop/Tracker1/Resources" -- 1.7.6.5 debian/patches/includes.diff0000664000000000000000000000211012321517140013245 0ustar Index: b/plugins/filesystem.h =================================================================== --- a/plugins/filesystem.h 2012-05-17 15:12:17.000000000 +0000 +++ b/plugins/filesystem.h 2013-04-02 16:59:27.433752030 +0000 @@ -21,6 +21,8 @@ * */ +#include + ssize_t string_read(void *object, void *buf, size_t count); gboolean is_filename(const char *name); int verify_path(const char *path); Index: b/src/mimetype.h =================================================================== --- a/src/mimetype.h 2012-05-17 15:12:17.000000000 +0000 +++ b/src/mimetype.h 2013-04-02 16:59:20.197702060 +0000 @@ -21,6 +21,8 @@ * */ +#include + typedef gboolean (*obex_object_io_func) (void *object, int flags, int err, void *user_data); Index: b/src/obex.h =================================================================== --- a/src/obex.h 2012-05-17 15:12:17.000000000 +0000 +++ b/src/obex.h 2013-04-02 16:59:07.709616787 +0000 @@ -22,6 +22,8 @@ * */ +#include + #define OBJECT_SIZE_UNKNOWN -1 #define OBJECT_SIZE_DELETE -2 debian/patches/test-avoid-double-source-removals.patch0000664000000000000000000000635712321517140020322 0ustar From 8464a28d7b9d6612c29bd5d5bf8e3f3bdb5f13a6 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 6 Jan 2014 12:04:14 +0000 Subject: [PATCH] unit: Fix test failures with glib 2.39.0 glib 2.39.0 made this change: - g_source_remove() will now throw a critical in the case that you try to remove a non-existent source. We expect that there is some code in the wild that will fall afoul of this new critical but considering that we now reuse source IDs, this code is already broken and should probably be fixed. This patch fixes the test suite to keep better track of whether sources have already been removed and avoid double-removals. Forwarded: http://marc.info/?l=linux-bluetooth&m=138901175212889&w=2 Last-Update: 2014-01-06 Index: b/unit/test-gobex-transfer.c =================================================================== --- a/unit/test-gobex-transfer.c +++ b/unit/test-gobex-transfer.c @@ -1800,7 +1800,8 @@ g_source_remove(timer_id); g_io_channel_unref(io); - g_source_remove(io_id); + if (!d.io_completed) + g_source_remove(io_id); g_obex_unref(obex); g_assert_no_error(d.err); @@ -2055,7 +2056,8 @@ g_source_remove(timer_id); g_io_channel_unref(io); - g_source_remove(io_id); + if (!d.io_completed) + g_source_remove(io_id); g_obex_unref(obex); g_assert_no_error(d.err); Index: b/unit/test-gobex.c =================================================================== --- a/unit/test-gobex.c +++ b/unit/test-gobex.c @@ -230,7 +230,7 @@ GError *gerr = NULL; GIOChannel *io; GIOCondition cond; - guint io_id, timer_id, test_time; + guint timer_id, test_time; GObex *obex; create_endpoints(&obex, &io, transport_type); @@ -239,7 +239,7 @@ g_assert_no_error(gerr); cond = G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL; - io_id = g_io_add_watch(io, cond, send_rsp_func, &gerr); + g_io_add_watch(io, cond, send_rsp_func, &gerr); mainloop = g_main_loop_new(NULL, FALSE); @@ -257,7 +257,6 @@ g_source_remove(timer_id); g_io_channel_unref(io); - g_source_remove(io_id); g_obex_unref(obex); g_assert_no_error(gerr); @@ -461,6 +460,7 @@ GError *err; const guint8 *buf; gsize len; + gboolean completed; }; static gboolean rcv_data(GIOChannel *io, GIOCondition cond, gpointer user_data) @@ -500,6 +500,7 @@ done: g_main_loop_quit(mainloop); + r->completed = TRUE; return FALSE; } @@ -541,7 +542,8 @@ g_source_remove(timer_id); g_io_channel_unref(io); - g_source_remove(io_id); + if (!r.completed) + g_source_remove(io_id); g_obex_unref(obex); g_assert_no_error(r.err); @@ -656,7 +658,8 @@ g_source_remove(timer_id); g_io_channel_unref(io); - g_source_remove(io_id); + if (!r.completed) + g_source_remove(io_id); g_obex_unref(obex); g_assert_no_error(r.err); Index: b/unit/util.c =================================================================== --- a/unit/util.c +++ b/unit/util.c @@ -189,5 +189,6 @@ failed: g_main_loop_quit(d->mainloop); + d->io_completed = TRUE; return FALSE; } Index: b/unit/util.h =================================================================== --- a/unit/util.h +++ b/unit/util.h @@ -41,6 +41,7 @@ guint id; gsize total; GMainLoop *mainloop; + gboolean io_completed; }; #define TEST_ERROR test_error_quark() debian/patches/series0000664000000000000000000000022412321531303012023 0ustar Remove_left_over_glib-helper.h_support.patch test-may-block.patch includes.diff test-avoid-double-source-removals.patch backport_session_code.patch debian/patches/test-may-block.patch0000664000000000000000000000171612321517140014474 0ustar From: Mathieu Trudel-Lapierre Subject: Don't pass SOCK_NONBLOCK option for the socket type to socketpair() Forwarded: not-needed The reason for this is that it's only supported starting with kernel 2.6.27. Unfortunately, the Ubuntu buildds run on 2.6.24 at this time, so fail the tests because the parameter is invalid there. We should be able to work around this safely by just not passing this option. This will allow keeping the tests running ;) Index: obexd-0.43/unit/util.c =================================================================== --- obexd-0.43.orig/unit/util.c 2011-12-21 18:24:49.000000000 -0500 +++ obexd-0.43/unit/util.c 2012-01-06 14:00:12.360087805 -0500 @@ -87,7 +87,7 @@ GObexTransportType transport_type; int sv[2]; - if (socketpair(AF_UNIX, sock_type | SOCK_NONBLOCK, 0, sv) < 0) { + if (socketpair(AF_UNIX, sock_type, 0, sv) < 0) { g_printerr("socketpair: %s", strerror(errno)); abort(); } debian/patches/backport_session_code.patch0000664000000000000000000001443212321540322016200 0ustar From: Mathieu Trudel-Lapierre Subject: Backport session establishing code from BlueZ 5. Last-Update: 2014-04-10 --- client/bluetooth.c | 193 +---------------------------------------------------- 1 file changed, 6 insertions(+), 187 deletions(-) Index: b/client/bluetooth.c =================================================================== --- a/client/bluetooth.c +++ b/client/bluetooth.c @@ -56,11 +56,9 @@ struct bluetooth_session { bdaddr_t src; bdaddr_t dst; uint16_t port; - DBusConnection *conn; /* system bus connection */ sdp_session_t *sdp; GIOChannel *io; GSList *pending_calls; - char *adapter; char *service; obc_transport_func func; void *user_data; @@ -73,60 +71,6 @@ static GQuark obc_bt_error_quark(void) return g_quark_from_static_string("obc-bluetooth-error-quark"); } -static int send_method_call(struct bluetooth_session *session, - const char *path, - const char *interface, - const char *method, - DBusPendingCallNotifyFunction cb, - int type, ...) -{ - DBusMessage *msg; - DBusPendingCall *call; - va_list args; - - msg = dbus_message_new_method_call(BT_BUS_NAME, path, interface, - method); - if (!msg) { - error("Unable to allocate new D-Bus %s message", method); - return -ENOMEM; - } - - va_start(args, type); - - if (!dbus_message_append_args_valist(msg, type, args)) { - dbus_message_unref(msg); - va_end(args); - return -EINVAL; - } - - va_end(args); - - if (!cb) { - g_dbus_send_message(session->conn, msg); - return 0; - } - - if (!dbus_connection_send_with_reply(session->conn, msg, &call, -1)) { - error("Sending %s failed", method); - dbus_message_unref(msg); - return -EIO; - } - - dbus_pending_call_set_notify(call, cb, session, NULL); - - session->pending_calls = g_slist_prepend(session->pending_calls, call); - - return 0; -} - -static void finalize_call(DBusPendingCall *call) -{ - if (!dbus_pending_call_get_completed(call)) - dbus_pending_call_cancel(call); - - dbus_pending_call_unref(call); -} - static void session_destroy(struct bluetooth_session *session) { GSList *l; @@ -138,31 +82,15 @@ static void session_destroy(struct bluet sessions = g_slist_remove(sessions, session); - if (session->adapter) - send_method_call(session, session->adapter, BT_ADAPTER_IFACE, - "ReleaseSession", NULL, - DBUS_TYPE_INVALID); - - l = session->pending_calls; - - while (l) { - DBusPendingCall *call = l->data; - l = l->next; - - session->pending_calls = g_slist_remove(session->pending_calls, call); - finalize_call(call); - } - if (session->io != NULL) { g_io_channel_shutdown(session->io, TRUE, NULL); g_io_channel_unref(session->io); } - if (session->conn) - dbus_connection_unref(session->conn); + if (session->sdp) + sdp_close(session->sdp); g_free(session->service); - g_free(session->adapter); g_free(session); } @@ -453,111 +381,6 @@ static int session_connect(struct blueto return err; } -static void adapter_reply(DBusPendingCall *call, void *user_data) -{ - struct bluetooth_session *session = user_data; - DBusError err; - DBusMessage *reply; - GError *gerr = NULL; - - reply = dbus_pending_call_steal_reply(call); - - session->pending_calls = g_slist_remove(session->pending_calls, call); - finalize_call(call); - - dbus_error_init(&err); - if (dbus_set_error_from_message(&err, reply)) { - error("manager replied with an error: %s, %s", - err.name, err.message); - dbus_error_free(&err); - - goto failed; - } - - if (session_connect(session) == 0) - goto proceed; - -failed: - g_set_error(&gerr, OBC_BT_ERROR, -EINVAL, - "Unable to request session"); - if (session->func) - session->func(session->io, gerr, session->user_data); - g_clear_error(&gerr); - - session_destroy(session); - -proceed: - dbus_message_unref(reply); -} - -static int request_session(struct bluetooth_session *session, const char *adapter) -{ - session->adapter = g_strdup(adapter); - return send_method_call(session, adapter, BT_ADAPTER_IFACE, - "RequestSession", adapter_reply, - DBUS_TYPE_INVALID); -} - -static void manager_reply(DBusPendingCall *call, void *user_data) -{ - struct bluetooth_session *session = user_data; - DBusError err; - DBusMessage *reply; - char *adapter; - GError *gerr = NULL; - - reply = dbus_pending_call_steal_reply(call); - - session->pending_calls = g_slist_remove(session->pending_calls, call); - finalize_call(call); - - dbus_error_init(&err); - if (dbus_set_error_from_message(&err, reply)) { - error("manager replied with an error: %s, %s", - err.name, err.message); - dbus_error_free(&err); - - goto failed; - } - - if (!dbus_message_get_args(reply, NULL, - DBUS_TYPE_OBJECT_PATH, &adapter, - DBUS_TYPE_INVALID)) - goto failed; - - DBG("adapter path %s", adapter); - - if (request_session(session, adapter) == 0) - goto proceed; - -failed: - g_set_error(&gerr, OBC_BT_ERROR, -EINVAL, "No adapter found"); - if (session->func) - session->func(session->io, gerr, session->user_data); - g_clear_error(&gerr); - - session_destroy(session); - -proceed: - dbus_message_unref(reply); -} - -static int find_adapter(struct bluetooth_session *session, const char *source) -{ - if (source == NULL) { - bacpy(&session->src, BDADDR_ANY); - return send_method_call(session, BT_PATH, BT_MANAGER_IFACE, - "DefaultAdapter", manager_reply, - DBUS_TYPE_INVALID); - } - - str2ba(source, &session->src); - return send_method_call(session, BT_PATH, BT_MANAGER_IFACE, - "FindAdapter", manager_reply, - DBUS_TYPE_STRING, &source, - DBUS_TYPE_INVALID); -} - static guint bluetooth_connect(const char *source, const char *destination, const char *service, uint16_t port, obc_transport_func func, void *user_data) @@ -576,22 +399,18 @@ static guint bluetooth_connect(const cha session->id = ++id; session->func = func; + session->port = port; session->user_data = user_data; - session->conn = g_dbus_setup_bus(DBUS_BUS_SYSTEM, NULL, NULL); - if (session->conn == NULL) { - g_free(session); - return 0; - } - - session->service = g_strdup(service); str2ba(destination, &session->dst); + str2ba(source, &session->src); - if (find_adapter(session, source) < 0) { + if (session_connect(session) < 0) { g_free(session); return 0; } + session->service = g_strdup(service); sessions = g_slist_prepend(sessions, session); return session->id;