Diff between 35990b8bdd577081a581f1ae865bccc439cc5311 and dc30b0deaa5b973bc2ad270881f14aceb82aba3c

Changed Files

File Additions Deletions Status
doc/obex-client-api.txt +0 -17 modified
doc/obexd-api.txt +31 -15 modified
obexd/client/session.c +1 -1 modified
obexd/src/manager.c +21 -1 modified

Full Patch

diff --git a/doc/obex-client-api.txt b/doc/obex-client-api.txt
index 7c8de16..63aff1a 100644
--- a/doc/obex-client-api.txt
+++ b/doc/obex-client-api.txt
@@ -4,23 +4,6 @@ OBEX client API description
 Copyright (C) 2007-2010  Marcel Holtmann <marcel@holtmann.org>
 Copyright (C) 2011-2012  BMW Car IT GmbH. All rights reserved.
 
-Session hierarchy
-=================
-
-Service		org.bluez.obex
-Interface	org.bluez.obex.Session
-Object path	[variable prefix]/{session0,session1,...}
-
-Methods		string GetCapabilities()
-
-			Get remote device capabilities.
-
-Properties	string Source [readonly]
-
-		string Destination [readonly]
-
-		byte Channel [readonly]
-
 Object Push hierarchy
 =====================
 
diff --git a/doc/obexd-api.txt b/doc/obexd-api.txt
index 3b77e74..502d1ce 100644
--- a/doc/obexd-api.txt
+++ b/doc/obexd-api.txt
@@ -59,6 +59,37 @@ Methods		object CreateSession(string destination, dict args)
 
 			Unregister session and abort pending transfers.
 
+Session hierarchy
+=================
+
+Service		org.bluez.obex
+Interface	org.bluez.obex.Session1
+Object path	/org/bluez/obex/session{0, 1, 2, ...}
+
+Methods		string GetCapabilities()
+
+			Get remote device capabilities.
+
+Properties	string Source [readonly]
+
+			Bluetooth adapter address
+
+		string Destination [readonly]
+
+			Bluetooth device address
+
+		byte Channel [readonly]
+
+			Bluetooth channel
+
+		string Target [readonly]
+
+			Target UUID
+
+		string Root [readonly]
+
+			Root path
+
 Transfer hierarchy
 ===============
 
@@ -94,18 +125,3 @@ Properties	string Status [readonly]
 
 			Number of bytes transferred. For queued transfers, this
 			value will not be present.
-
-Session hierarchy
-===============
-
-Service		org.bluez.obex
-Interface	org.bluez.obex.Session1
-Object path	/org/bluez/obex/session{0, 1, 2, ...}
-
-Properties	string Target [readonly]
-
-			Target UUID
-
-		string Root [readonly]
-
-			Root path
diff --git a/obexd/client/session.c b/obexd/client/session.c
index 40d6c9c..cc10f88 100644
--- a/obexd/client/session.c
+++ b/obexd/client/session.c
@@ -45,7 +45,7 @@
 #include "driver.h"
 #include "transport.h"
 
-#define SESSION_INTERFACE "org.bluez.obex.Session"
+#define SESSION_INTERFACE "org.bluez.obex.Session1"
 #define ERROR_INTERFACE "org.bluez.obex.Error"
 #define SESSION_BASEPATH "/org/bluez/obex"
 
diff --git a/obexd/src/manager.c b/obexd/src/manager.c
index 55b03d9..1202bfb 100644
--- a/obexd/src/manager.c
+++ b/obexd/src/manager.c
@@ -98,6 +98,13 @@ static inline DBusMessage *invalid_args(DBusMessage *msg)
 			"Invalid arguments in method call");
 }
 
+static inline DBusMessage *not_supported(DBusMessage *msg)
+{
+	return g_dbus_create_error(msg,
+			ERROR_INTERFACE ".NotSupported",
+			"Operation is not supported");
+}
+
 static inline DBusMessage *agent_already_exists(DBusMessage *msg)
 {
 	return g_dbus_create_error(msg,
@@ -711,13 +718,26 @@ int manager_request_authorization(struct obex_transfer *transfer, int32_t time,
 	return 0;
 }
 
+static DBusMessage *session_get_capabilities(DBusConnection *connection,
+					DBusMessage *message, void *user_data)
+{
+	return not_supported(message);
+}
+
+static const GDBusMethodTable session_methods[] = {
+	{ GDBUS_ASYNC_METHOD("GetCapabilities",
+				NULL, GDBUS_ARGS({ "capabilities", "s" }),
+				session_get_capabilities) },
+	{ }
+};
+
 void manager_register_session(struct obex_session *os)
 {
 	char *path = g_strdup_printf("%s/session%u", OBEX_BASE_PATH, os->id);
 
 	if (!g_dbus_register_interface(connection, path,
 				SESSION_INTERFACE,
-				NULL, NULL,
+				session_methods, NULL,
 				session_properties, os, NULL)) {
 		error("Cannot register Session interface.");
 		goto done;