From dc30b0deaa5b973bc2ad270881f14aceb82aba3c Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Thu, 20 Dec 2012 20:12:35 +0200 Subject: [PATCH] obex-client: Rename org.bluez.obex.Session to org.bluez.obex.Session1 Rename the interface and move it to obexd-api.txt since it now belongs to the same daemon. --- doc/obex-client-api.txt | 17 --------------- doc/obexd-api.txt | 46 +++++++++++++++++++++++++++-------------- obexd/client/session.c | 2 +- obexd/src/manager.c | 22 +++++++++++++++++++- 4 files changed, 53 insertions(+), 34 deletions(-) diff --git a/doc/obex-client-api.txt b/doc/obex-client-api.txt index 7c8de162e..63aff1a4f 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 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 3b77e74eb..502d1ce3e 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 40d6c9c26..cc10f8857 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 55b03d9ec..1202bfb10 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; -- 2.47.3