Thread (7 messages) flat view 7 messages, 3 authors, 2011-07-13
STALE5511d

[PATCH obexd v2 1/4] Add system bus connection in obex-client

From: Dmitriy Paliy <hidden>
Date: 2011-06-28 21:40:39
Subsystem: the rest · Maintainer: Linus Torvalds

Connection to system bus is added in obex-client. Purpose is to carry
out OBEX transfers within a single adapter's session.
---
 client/session.c |    9 +++++++++
 client/session.h |    1 +
 2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/client/session.c b/client/session.c
index 825bee7..c894526 100644
--- a/client/session.c
+++ b/client/session.c
@@ -200,6 +200,9 @@ static void session_free(struct session_data *session)
 	if (session->conn)
 		dbus_connection_unref(session->conn);
 
+	if (session->conn_system)
+		dbus_connection_unref(session->conn_system);
+
 	sessions = g_slist_remove(sessions, session);
 
 	g_free(session->callback);
@@ -564,6 +567,12 @@ struct session_data *session_create(const char *source,
 		return NULL;
 	}
 
+	session->conn_system = g_dbus_setup_bus(DBUS_BUS_SYSTEM, NULL, NULL);
+	if (session->conn_system == NULL) {
+		session_free(session);
+		return NULL;
+	}
+
 	if (source == NULL)
 		bacpy(&session->src, BDADDR_ANY);
 	else
diff --git a/client/session.h b/client/session.h
index 6f8a434..554b494 100644
--- a/client/session.h
+++ b/client/session.h
@@ -42,6 +42,7 @@ struct session_data {
 	uuid_t uuid;		/* Bluetooth Service Class */
 	gchar *path;		/* Session path */
 	DBusConnection *conn;
+	DBusConnection *conn_system; /* system bus connection */
 	DBusMessage *msg;
 	GwObex *obex;
 	GIOChannel *io;
-- 
1.7.4.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help