Skip to contentSkip to conversation

obexd: Port session interface to use D-Bus Properties

PATCH In review Luiz Augusto von Dentz 2 participants 6 messages Dec 17, 2012 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/5 obexd: Port session interface to use D-Bus Properties

From: Luiz Augusto von Dentz <[email protected]>

---
 doc/obexd-api.txt   | 12 ++++--------
 obexd/src/manager.c | 50 ++++++++++++++++++--------------------------------
 2 files changed, 22 insertions(+), 40 deletions(-)
doc/obexd-api.txt +4 -8
index 680febe..53e61f5 100644
@@ -74,14 +74,10 @@ Service		org.bluez.obex
 Interface	org.bluez.obex.Session
 Object path	/session{0, 1, 2, ...}
 
-Methods
-		dict GetProperties()
-
-
-Signals		TBD
+Properties	string Target [readonly]
 
+			Target UUID
 
-Properties
-		string Address [readonly]
+		string Root [readonly]
 
-			Bluetooth device address or USB
+			Root path
obexd/src/manager.c +18 -32

78 lines not on this page · raw message

Signature · 1 line
1.7.11.7
author maintainer
#1 lore raw

PATCH 2/5 obexd: Enable ObjectManager

From: Luiz Augusto von Dentz <[email protected]>

---
 obexd/src/manager.c | 4 ++++
 1 file changed, 4 insertions(+)
obexd/src/manager.c +4 -0
index 85aa965..034f6ab 100644
@@ -350,6 +350,8 @@ gboolean manager_init(void)
 		return FALSE;
 	}
 
+	g_dbus_attach_object_manager(connection);
+
 	return g_dbus_register_interface(connection, OBEX_MANAGER_PATH,
 					OBEX_MANAGER_INTERFACE,
 					manager_methods, manager_signals, NULL,
@@ -368,6 +370,8 @@ void manager_cleanup(void)
 	if (agent)
 		agent_free(agent);
 
+	g_dbus_detach_object_manager(connection);
+
 	dbus_connection_unref(connection);
 }
 
Signature · 1 line
1.7.11.7
author maintainer
#2 lore raw

PATCH 3/5 obexd: Remove SessionCreated and SessionRemoved signals

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

With ObjectManager these signals no longer are necessary.

---
 doc/obexd-api.txt   | 12 +-----------
 obexd/src/manager.c | 12 ------------
 2 files changed, 1 insertion(+), 23 deletions(-)
doc/obexd-api.txt +1 -11
index 53e61f5..822157d 100644
@@ -29,17 +29,7 @@ Methods
 
 			Possible errors: org.bluez.obex.Error.DoesNotExist
 
-Signals		SessionCreated(object session)
-
-			Signal sent when OBEX connection has been accepted.
-			(FTP only)
-
-		SessionRemoved(object session)
-
-			Sent when the transport is disconnected
-			(FTP only)
-
-		TransferStarted(object transfer)
+Signals		TransferStarted(object transfer)
 
 			Signal sent when an object push operation starts.
 			(OPP only)
obexd/src/manager.c +0 -12
index 034f6ab..c585aa1 100644
@@ -310,8 +310,6 @@ static const GDBusSignalTable manager_signals[] = {
 	{ GDBUS_SIGNAL("TransferStarted", GDBUS_ARGS({ "transfer", "o"})) },
 	{ GDBUS_SIGNAL("TransferCompleted", GDBUS_ARGS({ "transfer", "o" },
 							{ "success", "b" })) },
-	{ GDBUS_SIGNAL("SessionCreated", GDBUS_ARGS({ "session", "o" })) },
-	{ GDBUS_SIGNAL("SessionRemoved", GDBUS_ARGS({ "session", "o" })) },
 	{ }
 };
 
@@ -606,11 +604,6 @@ void manager_register_session(struct obex_session *os)
 		goto done;
 	}
 
-	g_dbus_emit_signal(connection, OBEX_MANAGER_PATH,
-			OBEX_MANAGER_INTERFACE, "SessionCreated",
-			DBUS_TYPE_OBJECT_PATH, &path,
-			DBUS_TYPE_INVALID);
-
 done:
 	g_free(path);
 }
@@ -619,11 +612,6 @@ void manager_unregister_session(struct obex_session *os)
 {
 	char *path = g_strdup_printf("/session%u", GPOINTER_TO_UINT(os));
 
-	g_dbus_emit_signal(connection, OBEX_MANAGER_PATH,
-			OBEX_MANAGER_INTERFACE, "SessionRemoved",
-			DBUS_TYPE_OBJECT_PATH, &path,
-			DBUS_TYPE_INVALID);
-
 	g_dbus_unregister_interface(connection, path,
 				SESSION_INTERFACE);
 
Signature · 1 line
1.7.11.7
author maintainer
#3 lore raw

PATCH 4/5 obex-client: Enable ObjectManager

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

---
 obexd/client/manager.c | 3 +++
 1 file changed, 3 insertions(+)
obexd/client/manager.c +3 -0
index 7a7c33f..4929383 100644
@@ -269,6 +269,8 @@ int manager_init(void)
 		return -1;
 	}
 
+	g_dbus_attach_object_manager(conn);
+
 	if (g_dbus_register_interface(conn, CLIENT_PATH, CLIENT_INTERFACE,
 						client_methods, NULL, NULL,
 							NULL, NULL) == FALSE) {
@@ -299,5 +301,6 @@ void manager_exit(void)
 		module->exit();
 
 	g_dbus_unregister_interface(conn, CLIENT_PATH, CLIENT_INTERFACE);
+	g_dbus_detach_object_manager(conn);
 	dbus_connection_unref(conn);
 }
Signature · 1 line
1.7.11.7
author maintainer
#4 lore raw

PATCH 5/5 TODO: Mark Convert obexd & obex-client to ObjectManager/Properties as done

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

---
 TODO | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
TODO +2 -2
index d9a708b..5a70e40 100644
@@ -60,8 +60,6 @@ BlueZ 5
 Priority/Complexity omitted as all items are required before 5.0 is
 released.
 
-- Convert obexd & obex-client to ObjectManager/Properties
-
 - [pending] Convert storage to user per-remote device directories and
   ini-file format
 
@@ -87,6 +85,8 @@ Completed items:
 
 - Convert obexd to use org.bluez.Profile
 
+- Convert obexd & obex-client to ObjectManager/Properties
+
 - Remove org.bluez.Service interface (it has become unnecessary thanks
   to org.bluez.Profile). obexd needs to be converted to use the new
   interface first.
Signature · 1 line
1.7.11.7
#5 lore raw
In reply to Luiz Augusto von Dentz

Hi Luiz,

Quoted 4 lines · Luiz Augusto von Dentz
---
 doc/obexd-api.txt   | 12 ++++--------
 obexd/src/manager.c | 50 ++++++++++++++++++--------------------------------
 2 files changed, 22 insertions(+), 40 deletions(-)

All patches in this set have been applied. Thanks.

Johan