Change D-Bus namespace to org.bluez.obex
Luiz Augusto von Dentz
maintainerv2 cover Change D-Bus namespace to org.bluez.obex
From: Luiz Augusto von Dentz <[email protected]>
The following patches changes the namespace from org.openobex to org.bluez.obex, getting rid of the last remaining references to openobex dependency.
This also serve as a fundation for the possible move of obexd inside BlueZ repository.
v2: Fix invalid syntax on pbap-client
Luiz Augusto von Dentz (23):
obexd-api: Change D-Bus namespace to org.bluez.obexd
core: Change D-Bus namespace to org.bluez.obex
core: Change D-Bus service file to use org.bluez.obex
agent-api: Change D-Bus namespace to org.bluez.obexd
core: Change agent interface to org.bluez.obex.Agent
test: Use org.bluez.obex namespace in simple-agent script
client-api: Change D-Bus namespace to org.bluez.obex.client
client: Change namespace to org.bluez.obex.client
client: Change D-Bus service file to use org.bluez.obex.client
client-api: Rename session interface to org.bluez.obex.Session
client-api: Rename ObjectPush interface to org.bluez.obex.ObjectPush
client-api: Rename FileTransfer interface to
org.bluez.obex.FileTransfer
client-api: Rename PhonebookAccess interface to
org.bluez.obex.PhonebookAccess
client-api: Rename Synchronization interface to
org.bluez.obex.Synchronization
client-api: Rename MessageAccess interface to
org.bluez.obex.MessageAccess
client-api: Rename Transfer interface to org.bluez.obex.Transfer
test: Use org.bluez.obex namespace in exchange-business-cards script
test: Use org.bluez.obex namespace in list-folders script
test: Use org.bluez.obex namespace in ftp-client script
test: Use org.bluez.obex namespace in map-client script
test: Use org.bluez.obex namespace in opp-client script
test: Use org.bluez.obex namespace in pbap-client script
test: Use org.bluez.obex namespace in get-capabilities script
client/ftp.c | 2 +- client/manager.c | 6 +++--- client/map.c | 2 +- client/obex-client.service.in | 2 +- client/opp.c | 2 +- client/pbap.c | 2 +- client/session.c | 4 ++-- client/sync.c | 2 +- client/transfer.c | 4 ++-- doc/agent-api.txt | 6 +++--- doc/client-api.txt | 30 ++++++++++++++--------------- doc/obexd-api.txt | 16 ++++++++-------- plugins/syncevolution.c | 3 +-- src/manager.c | 42 ++++++++++++++++++++--------------------- src/manager.h | 2 +- src/obexd.service.in | 2 +- test/exchange-business-cards | 11 +++++------ test/ftp-client | 27 +++++++++++++------------- test/get-capabilities | 8 ++++---- test/list-folders | 10 +++++----- test/map-client | 10 +++++----- test/opp-client | 25 ++++++++++++------------ test/pbap-client | 38 +++++++++++++++++++++---------------- test/simple-agent | 37 ++++++++++++++++++------------------ 24 files changed, 149 insertions(+), 144 deletions(-)
Signature · 1 line
1.7.10.2
Luiz Augusto von Dentz
maintainerPATCH v2 1/23 obexd-api: Change D-Bus namespace to org.bluez.obexd
From: Luiz Augusto von Dentz <[email protected]>
obexd not longer depend on openobex so it doesn't make any sense to use its namespace.
--- doc/obexd-api.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
doc/obexd-api.txt +8 -8
@@ -8,8 +8,8 @@ Copyright (C) 2007-2010 Marcel Holtmann <[email protected]> Manager hierarchy =============== -Service org.openobex -Interface org.openobex.Manager +Service org.bluez.obex +Interface org.bluez.obex.Manager Object path / Methods
@@ -19,7 +19,7 @@ Methods the user to accept/reject objects. Object push service needs to authorize each received object. - Possible errors: org.openobex.Error.AlreadyExists + Possible errors: org.bluez.obex.Error.AlreadyExists void UnregisterAgent(object agent)
@@ -27,7 +27,7 @@ Methods registered. The object path parameter must match the same value that has been used on registration. - Possible errors: org.openobex.Error.DoesNotExist + Possible errors: org.bluez.obex.Error.DoesNotExist Signals SessionCreated(object session)
@@ -54,8 +54,8 @@ Signals SessionCreated(object session) Transfer hierarchy =============== -Service org.openobex -Interface org.openobex.Transfer +Service org.bluez.obex +Interface org.bluez.obex.Transfer Object path /transfer{0, 1, 2, ...} Methods
@@ -70,8 +70,8 @@ Signals Session hierarchy =============== -Service org.openobex -Interface org.openobex.Session +Service org.bluez.obex +Interface org.bluez.obex.Session Object path /session{0, 1, 2, ...} Methods
Signature · 1 line
1.7.10.2
Luiz Augusto von Dentz
maintainerPATCH v2 2/23 core: Change D-Bus namespace to org.bluez.obex
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
This changes the namespace from org.openobex to org.bluez.obex
--- src/manager.c | 37 ++++++++++++++++++------------------- src/manager.h | 2 +- 2 files changed, 19 insertions(+), 20 deletions(-)
src/manager.c +18 -19
@@ -44,11 +44,11 @@#include "btio.h" #include "service.h" -#define OPENOBEX_MANAGER_PATH "/" -#define OPENOBEX_MANAGER_INTERFACE OPENOBEX_SERVICE ".Manager" -#define ERROR_INTERFACE OPENOBEX_SERVICE ".Error" -#define TRANSFER_INTERFACE OPENOBEX_SERVICE ".Transfer" -#define SESSION_INTERFACE OPENOBEX_SERVICE ".Session" +#define OBEX_MANAGER_PATH "/" +#define OBEX_MANAGER_INTERFACE OBEXD_SERVICE ".Manager" +#define ERROR_INTERFACE OBEXD_SERVICE ".Error" +#define TRANSFER_INTERFACE OBEXD_SERVICE ".Transfer" +#define SESSION_INTERFACE OBEXD_SERVICE ".Session"#define TIMEOUT 60*1000/* Timeout for user response (miliseconds) */
@@ -353,8 +353,7 @@ gboolean manager_init(void)dbus_error_init (&err); - connection =g_dbus_setup_bus (DBUS_BUS_SESSION ,OPENOBEX_SERVICE , - &err); + connection =g_dbus_setup_bus (DBUS_BUS_SESSION ,OBEXD_SERVICE , &err);if (connection ==NULL ) {if (dbus_error_is_set (&err) == TRUE) {fprintf (stderr,"%s\n" , err.message);
@@ -364,8 +363,8 @@ gboolean manager_init(void)return FALSE; } -return g_dbus_register_interface (connection,OPENOBEX_MANAGER_PATH , -OPENOBEX_MANAGER_INTERFACE , +return g_dbus_register_interface (connection,OBEX_MANAGER_PATH , +OBEX_MANAGER_INTERFACE , manager_methods, manager_signals,NULL ,NULL ,NULL ); }
@@ -374,8 +373,8 @@ void manager_cleanup(void) {DBG ("" ); -g_dbus_unregister_interface (connection,OPENOBEX_MANAGER_PATH , -OPENOBEX_MANAGER_INTERFACE ); +g_dbus_unregister_interface (connection,OBEX_MANAGER_PATH , +OBEX_MANAGER_INTERFACE );/* FIXME: Release agent? */
@@ -389,8 +388,8 @@ void manager_emit_transfer_started(struct obex_session *os) {char *path =g_strdup_printf ("/transfer%u" , os->id); -g_dbus_emit_signal (connection,OPENOBEX_MANAGER_PATH , -OPENOBEX_MANAGER_INTERFACE ,"TransferStarted" , +g_dbus_emit_signal (connection,OBEX_MANAGER_PATH , +OBEX_MANAGER_INTERFACE ,"TransferStarted" ,DBUS_TYPE_OBJECT_PATH , &path,DBUS_TYPE_INVALID );
@@ -401,8 +400,8 @@ static void emit_transfer_completed(struct obex_session *os, gboolean success) {char *path =g_strdup_printf ("/transfer%u" , os->id); -g_dbus_emit_signal (connection,OPENOBEX_MANAGER_PATH , -OPENOBEX_MANAGER_INTERFACE ,"TransferCompleted" , +g_dbus_emit_signal (connection,OBEX_MANAGER_PATH , +OBEX_MANAGER_INTERFACE ,"TransferCompleted" ,DBUS_TYPE_OBJECT_PATH , &path,DBUS_TYPE_BOOLEAN , &success,DBUS_TYPE_INVALID );
@@ -616,8 +615,8 @@ void manager_register_session(struct obex_session *os) goto done; } -g_dbus_emit_signal (connection,OPENOBEX_MANAGER_PATH , -OPENOBEX_MANAGER_INTERFACE ,"SessionCreated" , +g_dbus_emit_signal (connection,OBEX_MANAGER_PATH , +OBEX_MANAGER_INTERFACE ,"SessionCreated" ,DBUS_TYPE_OBJECT_PATH , &path,DBUS_TYPE_INVALID );
@@ -629,8 +628,8 @@ void manager_unregister_session(struct obex_session *os) {char *path =g_strdup_printf ("/session%u" ,GPOINTER_TO_UINT (os)); -g_dbus_emit_signal (connection,OPENOBEX_MANAGER_PATH , -OPENOBEX_MANAGER_INTERFACE ,"SessionRemoved" , +g_dbus_emit_signal (connection,OBEX_MANAGER_PATH , +OBEX_MANAGER_INTERFACE ,"SessionRemoved" ,DBUS_TYPE_OBJECT_PATH , &path,DBUS_TYPE_INVALID );
src/manager.h +1 -1
@@ -23,7 +23,7 @@#include <dbus/dbus.h> -#define OPENOBEX_SERVICE "org.openobex" +#define OBEXD_SERVICE "org.bluez.obex"void manager_register_session (struct obex_session *os);void manager_unregister_session (struct obex_session *os);
Signature · 1 line
1.7.10.2
Luiz Augusto von Dentz
maintainerPATCH v2 3/23 core: Change D-Bus service file to use org.bluez.obex
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
--- src/obexd.service.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/obexd.service.in +1 -1
@@ -1,3 +1,3 @@ [D-BUS Service] -Name=org.openobex +Name=org.bluez.obex Exec=@libexecdir@/obexd --nodaemon
Signature · 1 line
1.7.10.2
Luiz Augusto von Dentz
maintainerPATCH v2 4/23 agent-api: Change D-Bus namespace to org.bluez.obexd
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
--- doc/agent-api.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
doc/agent-api.txt +3 -3
@@ -9,7 +9,7 @@ Agent hierarchy =============== Service unique name -Interface org.openobex.Agent +Interface org.bluez.obex.Agent Object path freely definable Methods
@@ -21,8 +21,8 @@ Methods Returns the full path (including the filename) where the object shall be stored. - Possible errors: org.openobex.Error.Rejected - org.openobex.Error.Canceled + Possible errors: org.bluez.obex.Error.Rejected + org.bluez.obex.Error.Canceled void Cancel()
Signature · 1 line
1.7.10.2
Luiz Augusto von Dentz
maintainerPATCH v2 5/23 core: Change agent interface to org.bluez.obex.Agent
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
--- plugins/syncevolution.c | 3 +-- src/manager.c | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-)
plugins/syncevolution.c +1 -2
@@ -365,8 +365,7 @@ static ssize_t synce_read(void *object, void *buf, size_t count)append_dict_entry (&dict,"id" ,DBUS_TYPE_STRING , context->id); -snprintf (transport,sizeof (transport),"%s.obexd" , -OPENOBEX_SERVICE ); +snprintf (transport,sizeof (transport),"%s.obexd" ,OBEXD_SERVICE );append_dict_entry (&dict,"transport" ,DBUS_TYPE_STRING , transport); snprintf(transport_description, sizeof(transport_description),
src/manager.c +3 -2
@@ -49,6 +49,7 @@#define ERROR_INTERFACE OBEXD_SERVICE ".Error"#define TRANSFER_INTERFACE OBEXD_SERVICE ".Transfer"#define SESSION_INTERFACE OBEXD_SERVICE ".Session" +#define AGENT_INTERFACE OBEXD_SERVICE ".Agent"#define TIMEOUT 60*1000/* Timeout for user response (miliseconds) */
@@ -461,7 +462,7 @@ static void agent_cancel(void)return ; msg =dbus_message_new_method_call (agent->bus_name, agent->path, -"org.openobex.Agent" ,"Cancel" ); +AGENT_INTERFACE ,"Cancel" );g_dbus_send_message (connection, msg); }
@@ -547,7 +548,7 @@ int manager_request_authorization(struct obex_session *os, int32_t time, path =g_strdup_printf ("/transfer%u" , os->id); msg =dbus_message_new_method_call (agent->bus_name, agent->path, -"org.openobex.Agent" ,"Authorize" ); +AGENT_INTERFACE ,"Authorize" ); dbus_message_append_args(msg, DBUS_TYPE_OBJECT_PATH, &path,
Signature · 1 line
1.7.10.2
Luiz Augusto von Dentz
maintainerPATCH v2 6/23 test: Use org.bluez.obex namespace in simple-agent script
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
--- test/simple-agent | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-)
test/simple-agent +19 -18
@@ -12,8 +12,8 @@ class Agent(dbus.service.Object): dbus.service.Object.__init__(self, conn, obj_path) self.pending_auth = False - @dbus.service.method("org.openobex.Agent", - in_signature="osssii", out_signature="s") + @dbus.service.method("org.bluez.obex.Agent", in_signature="osssii", + out_signature="s") def Authorize(self, dpath, device, filename, ftype, length, time): global transfers
@@ -23,8 +23,9 @@ class Agent(dbus.service.Object): if auth == "n" or auth == "N": self.pending_auth = False - raise dbus.DBusException("org.openobex.Error.Rejected: " - "Not Autorized") + raise dbus.DBusException( + "org.bluez.obex.Error.Rejected: " + "Not Autorized") print "Full filename (including path):" self.pending_auth = False
@@ -32,8 +33,8 @@ class Agent(dbus.service.Object): transfers.append(Transfer(dpath, filename, 0, length)) return raw_input().strip("\n ") - @dbus.service.method("org.openobex.Agent", - in_signature="", out_signature="") + @dbus.service.method("org.bluez.obex.Agent", in_signature="", + out_signature="") def Cancel(self): print "Authorization Canceled" self.pending_auth = False
@@ -53,9 +54,9 @@ class Transfer(object): self.size = total def cancel(self): - transfer_iface = dbus.Interface(bus.get_object("org.openobex", - self.dpath), - "org.openobex.Transfer") + transfer_iface = dbus.Interface(bus.get_object( + "org.bluez.obex", self.dpath), + "org.bluez.obex.Transfer") transfer_iface.Cancel() def __str__(self):
@@ -71,9 +72,9 @@ if __name__ == '__main__': def new_transfer(dpath): print "new transfer" bus.add_signal_receiver(progress, - dbus_interface="org.openobex.Transfer", - signal_name="Progress", - path_keyword="dpath") + dbus_interface="org.bluez.obex.Transfer", + signal_name="Progress", + path_keyword="dpath") def transfer_completed(dpath, success): global transfers
@@ -96,15 +97,15 @@ if __name__ == '__main__': dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) bus = dbus.SessionBus() - manager = dbus.Interface(bus.get_object("org.openobex", "/"), - "org.openobex.Manager") + manager = dbus.Interface(bus.get_object("org.bluez.obex", "/"), + "org.bluez.obex.Manager") bus.add_signal_receiver(new_transfer, - dbus_interface="org.openobex.Manager", - signal_name="TransferStarted") + dbus_interface="org.bluez.obex.Manager", + signal_name="TransferStarted") bus.add_signal_receiver(transfer_completed, - dbus_interface="org.openobex.Manager", - signal_name="TransferCompleted") + dbus_interface="org.bluez.obex.Manager", + signal_name="TransferCompleted") path = "/test/agent" agent = Agent(bus, path)
Signature · 1 line
1.7.10.2
Luiz Augusto von Dentz
maintainerPATCH v2 7/23 client-api: Change D-Bus namespace to org.bluez.obex.client
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
--- doc/client-api.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
doc/client-api.txt +9 -9
@@ -8,8 +8,8 @@ Copyright (C) 2011-2012 BMW Car IT GmbH. All rights reserved. Client hierarchy ================ -Service org.openobex.client -Interface org.openobex.Client +Service org.bluez.obex.client +Interface org.bluez.obex.Client Object path / Methods object CreateSession(string destination, dict args)
@@ -39,7 +39,7 @@ Methods object CreateSession(string destination, dict args) Session hierarchy ================= -Service org.openobex.client +Service org.bluez.obex.client Interface org.openobex.Session Object path [variable prefix]/{session0,session1,...}
@@ -60,7 +60,7 @@ Properties string Source [readonly] Object Push hierarchy ===================== -Service org.openobex.client +Service org.bluez.obex.client Interface org.openobex.ObjectPush Object path [variable prefix]/{session0,session1,...}
@@ -110,7 +110,7 @@ Methods object, dict SendFile(string sourcefile) File Transfer hierarchy ======================= -Service org.openobex.client +Service org.bluez.obex.client Interface org.openobex.FileTransfer Object path [variable prefix]/{session0,session1,...}
@@ -183,7 +183,7 @@ Methods void ChangeFolder(string folder) Phonebook Access hierarchy ======================= -Service org.openobex.client +Service org.bluez.obex.client Interface org.openobex.PhonebookAccess Object path [variable prefix]/{session0,session1,...}
@@ -297,7 +297,7 @@ Methods void Select(string location, string phonebook) Synchronization hierarchy ======================= -Service org.openobex.client +Service org.bluez.obex.client Interface org.openobex.Synchronization Object path [variable prefix]/{session0,session1,...}
@@ -343,7 +343,7 @@ Methods void SetLocation(string location) Message Access hierarchy ========================= -Service org.openobex.client +Service org.bluez.obex.client Interface org.openobex.MessageAccess Object path [variable prefix]/{session0,session1,...}
@@ -355,7 +355,7 @@ Methods void SetFolder(string name) Transfer hierarchy ================== -Service org.openobex.client +Service org.bluez.obex.client Interface org.openobex.Transfer Object path [variable prefix]/{transfer0,transfer1,...}
Signature · 1 line
1.7.10.2
Luiz Augusto von Dentz
maintainerPATCH v2 8/23 client: Change namespace to org.bluez.obex.client
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
--- client/manager.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
client/manager.c +3 -3
@@ -45,10 +45,10 @@#include "sync.h" #include "map.h" -#define CLIENT_SERVICE "org.openobex.client" +#define CLIENT_SERVICE "org.bluez.obex.client" -#define CLIENT_INTERFACE "org.openobex.Client" -#define CLIENT_PATH "/" +#define CLIENT_INTERFACE "org.bluez.obex.Client" +#define CLIENT_PATH "/"struct send_data {DBusConnection *connection;
Signature · 1 line
1.7.10.2
Luiz Augusto von Dentz
maintainerPATCH v2 9/23 client: Change D-Bus service file to use org.bluez.obex.client
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
--- client/obex-client.service.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
client/obex-client.service.in +1 -1
@@ -1,3 +1,3 @@ [D-BUS Service] -Name=org.openobex.client +Name=org.bluez.obex.client Exec=@libexecdir@/obex-client
Signature · 1 line
1.7.10.2
Luiz Augusto von Dentz
maintainerPATCH v2 10/23 client-api: Rename session interface to org.bluez.obex.Session
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
The base is also changed to /org/bluez/obex to follow the new namespace
--- client/session.c | 4 ++-- doc/client-api.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
client/session.c +2 -2
@@ -45,8 +45,8 @@#include "driver.h" #include "transport.h" -#define SESSION_INTERFACE "org.openobex.Session" -#define SESSION_BASEPATH "/org/openobex" +#define SESSION_INTERFACE "org.bluez.obex.Session" +#define SESSION_BASEPATH "/org/bluez/obex"#define OBEX_IO_ERROR obex_io_error_quark()#define OBEX_IO_ERROR_FIRST (0xff + 1)
doc/client-api.txt +1 -1
@@ -40,7 +40,7 @@ Session hierarchy ================= Service org.bluez.obex.client -Interface org.openobex.Session +Interface org.bluez.obex.Session Object path [variable prefix]/{session0,session1,...} Methods dict GetProperties()
Signature · 1 line
1.7.10.2
Luiz Augusto von Dentz
maintainerPATCH v2 11/23 client-api: Rename ObjectPush interface to org.bluez.obex.ObjectPush
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
--- client/opp.c | 2 +- doc/client-api.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
client/opp.c +1 -1
@@ -36,7 +36,7 @@#include "opp.h" #define OPP_UUID "00001105-0000-1000-8000-00805f9b34fb" -#define OPP_INTERFACE "org.openobex.ObjectPush" +#define OPP_INTERFACE "org.bluez.obex.ObjectPush"#define ERROR_INF OPP_INTERFACE ".Error"struct opp_data {
doc/client-api.txt +1 -1
@@ -61,7 +61,7 @@ Object Push hierarchy ===================== Service org.bluez.obex.client -Interface org.openobex.ObjectPush +Interface org.bluez.obex.ObjectPush Object path [variable prefix]/{session0,session1,...} Methods object, dict SendFile(string sourcefile)
Signature · 1 line
1.7.10.2
Luiz Augusto von Dentz
maintainerPATCH v2 12/23 client-api: Rename FileTransfer interface to org.bluez.obex.FileTransfer
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
--- client/ftp.c | 2 +- doc/client-api.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
client/ftp.c +1 -1
@@ -42,7 +42,7 @@ "\xF9\xEC\x7B\xC4\x95\x3C\x11\xD2\x98\x4E\x52\x54\x00\xDC\x9E\x09"#define OBEX_FTP_UUID_LEN 16 -#define FTP_INTERFACE "org.openobex.FileTransfer" +#define FTP_INTERFACE "org.bluez.obex.FileTransfer"#define FTP_UUID "00001106-0000-1000-8000-00805f9b34fb"#define PCSUITE_UUID "00005005-0000-1000-8000-0002ee000001"
doc/client-api.txt +1 -1
@@ -111,7 +111,7 @@ File Transfer hierarchy ======================= Service org.bluez.obex.client -Interface org.openobex.FileTransfer +Interface org.bluez.obex.FileTransfer Object path [variable prefix]/{session0,session1,...} Methods void ChangeFolder(string folder)
Signature · 1 line
1.7.10.2
Luiz Augusto von Dentz
maintainerPATCH v2 13/23 client-api: Rename PhonebookAccess interface to org.bluez.obex.PhonebookAccess
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
--- client/pbap.c | 2 +- doc/client-api.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
client/pbap.c +1 -1
@@ -122,7 +122,7 @@ static const char *filter_list[] = {#define FILTER_BIT_MAX 63#define FILTER_ALL 0xFFFFFFFFFFFFFFFFULL -#define PBAP_INTERFACE "org.openobex.PhonebookAccess" +#define PBAP_INTERFACE "org.bluez.obex.PhonebookAccess"#define PBAP_UUID "0000112f-0000-1000-8000-00805f9b34fb"struct pbap_data {
doc/client-api.txt +1 -1
@@ -184,7 +184,7 @@ Phonebook Access hierarchy ======================= Service org.bluez.obex.client -Interface org.openobex.PhonebookAccess +Interface org.bluez.obex.PhonebookAccess Object path [variable prefix]/{session0,session1,...} Methods void Select(string location, string phonebook)
Signature · 1 line
1.7.10.2
Luiz Augusto von Dentz
maintainerPATCH v2 14/23 client-api: Rename Synchronization interface to org.bluez.obex.Synchronization
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
--- client/sync.c | 2 +- doc/client-api.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
client/sync.c +1 -1
@@ -42,7 +42,7 @@#define OBEX_SYNC_UUID "IRMC-SYNC"#define OBEX_SYNC_UUID_LEN 9 -#define SYNC_INTERFACE "org.openobex.Synchronization" +#define SYNC_INTERFACE "org.bluez.obex.Synchronization"#define ERROR_INF SYNC_INTERFACE ".Error"#define SYNC_UUID "00001104-0000-1000-8000-00805f9b34fb"
doc/client-api.txt +1 -1
@@ -298,7 +298,7 @@ Synchronization hierarchy ======================= Service org.bluez.obex.client -Interface org.openobex.Synchronization +Interface org.bluez.obex.Synchronization Object path [variable prefix]/{session0,session1,...} Methods void SetLocation(string location)
Signature · 1 line
1.7.10.2
Luiz Augusto von Dentz
maintainerPATCH v2 15/23 client-api: Rename MessageAccess interface to org.bluez.obex.MessageAccess
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
--- client/map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
client/map.c +1 -1
@@ -40,7 +40,7 @@ "\xBB\x58\x2B\x40\x42\x0C\x11\xDB\xB0\xDE\x08\x00\x20\x0C\x9A\x66"#define OBEX_MAS_UUID_LEN 16 -#define MAP_INTERFACE "org.openobex.MessageAccess" +#define MAP_INTERFACE "org.bluez.obex.MessageAccess"#define MAS_UUID "00001132-0000-1000-8000-00805f9b34fb"struct map_data {
Signature · 1 line
1.7.10.2
Luiz Augusto von Dentz
maintainerPATCH v2 16/23 client-api: Rename Transfer interface to org.bluez.obex.Transfer
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
--- client/transfer.c | 4 ++-- doc/client-api.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
client/transfer.c +2 -2
@@ -43,8 +43,8 @@#include "log.h" #include "transfer.h" -#define TRANSFER_INTERFACE "org.openobex.Transfer" -#define TRANSFER_BASEPATH "/org/openobex" +#define TRANSFER_INTERFACE "org.bluez.obex.Transfer" +#define TRANSFER_BASEPATH "/org/bluez/obex"#define OBC_TRANSFER_ERROR obc_transfer_error_quark()
doc/client-api.txt +1 -1
@@ -356,7 +356,7 @@ Transfer hierarchy ================== Service org.bluez.obex.client -Interface org.openobex.Transfer +Interface org.bluez.obex.Transfer Object path [variable prefix]/{transfer0,transfer1,...} Methods dict GetProperties()
Signature · 1 line
1.7.10.2
Luiz Augusto von Dentz
maintainerPATCH v2 17/23 test: Use org.bluez.obex namespace in exchange-business-cards script
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
--- test/exchange-business-cards | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
test/exchange-business-cards +5 -6
@@ -4,17 +4,16 @@ import sys import dbus bus = dbus.SessionBus() -client = dbus.Interface(bus.get_object("org.openobex.client", "/"), - "org.openobex.Client") +client = dbus.Interface(bus.get_object("org.bluez.obex.client", "/"), + "org.bluez.obex.Client") if (len(sys.argv) < 4): print "Usage: %s <device> <clientfile> <file>" % (sys.argv[0]) sys.exit(1) print "Creating Session" -session_path = client.CreateSession(sys.argv[1], { "Target": "OPP" }) -opp = dbus.Interface(bus.get_object("org.openobex.client", - session_path), - "org.openobex.ObjectPush") +path = client.CreateSession(sys.argv[1], { "Target": "OPP" }) +opp = dbus.Interface(bus.get_object("org.bluez.obex.client", path), + "org.bluez.obex.ObjectPush") opp.ExchangeBusinessCards(sys.argv[2], sys.argv[3])
Signature · 1 line
1.7.10.2
Luiz Augusto von Dentz
maintainerPATCH v2 18/23 test: Use org.bluez.obex namespace in list-folders script
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
--- test/list-folders | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
test/list-folders +5 -5
@@ -6,13 +6,13 @@ import dbus def list_folder(folder): bus = dbus.SessionBus() - client = dbus.Interface(bus.get_object("org.openobex.client", "/"), - "org.openobex.Client") + client = dbus.Interface(bus.get_object("org.bluez.obex.client", "/"), + "org.bluez.obex.Client") - session_path = client.CreateSession(sys.argv[1], { "Target": "ftp" }) + path = client.CreateSession(sys.argv[1], { "Target": "ftp" }) - ftp = dbus.Interface(bus.get_object("org.openobex.client", session_path), - "org.openobex.FileTransfer") + ftp = dbus.Interface(bus.get_object("org.bluez.obex.client", path), + "org.bluez.obex.FileTransfer") if folder: for node in folder.split("/"):
Signature · 1 line
1.7.10.2
Luiz Augusto von Dentz
maintainerPATCH v2 19/23 test: Use org.bluez.obex namespace in ftp-client script
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
--- test/ftp-client | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-)
test/ftp-client +13 -14
@@ -38,17 +38,17 @@ class FtpClient: self.transfer_path = None self.verbose = verbose bus = dbus.SessionBus() - obj = bus.get_object("org.openobex.client", session_path) - self.session = dbus.Interface(obj, "org.openobex.Session") - self.ftp = dbus.Interface(obj, "org.openobex.FileTransfer") + obj = bus.get_object("org.bluez.obex.client", session_path) + self.session = dbus.Interface(obj, "org.bluez.obex.Session") + self.ftp = dbus.Interface(obj, "org.bluez.obex.FileTransfer") bus.add_signal_receiver(self.transfer_complete, - dbus_interface="org.openobex.Transfer", - signal_name="Complete", - path_keyword="path") + dbus_interface="org.bluez.obex.Transfer", + signal_name="Complete", + path_keyword="path") bus.add_signal_receiver(self.transfer_error, - dbus_interface="org.openobex.Transfer", - signal_name="Error", - path_keyword="path") + dbus_interface="org.bluez.obex.Transfer", + signal_name="Error", + path_keyword="path") def create_transfer_reply(self, reply): (path, properties) = reply
@@ -130,14 +130,13 @@ if __name__ == '__main__': bus = dbus.SessionBus() mainloop = gobject.MainLoop() - client = dbus.Interface(bus.get_object("org.openobex.client", "/"), - "org.openobex.Client") + client = dbus.Interface(bus.get_object("org.bluez.obex.client", "/"), + "org.bluez.obex.Client") print "Creating Session" - session_path = client.CreateSession(options.device, - { "Target": "ftp" }) + path = client.CreateSession(options.device, { "Target": "ftp" }) - ftp_client = FtpClient(session_path) + ftp_client = FtpClient(path) if options.new_dir: ftp_client.change_folder(options.new_dir)
Signature · 1 line
1.7.10.2
Luiz Augusto von Dentz
maintainerPATCH v2 20/23 test: Use org.bluez.obex namespace in map-client script
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
--- test/map-client | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
test/map-client +5 -5
@@ -38,14 +38,14 @@ if __name__ == '__main__': bus = dbus.SessionBus() mainloop = gobject.MainLoop() - client = dbus.Interface(bus.get_object("org.openobex.client", "/"), - "org.openobex.Client") + client = dbus.Interface(bus.get_object("org.bluez.obex.client", "/"), + "org.bluez.obex.Client") path = client.CreateSession(options.device, { "Target": "map" }) - obj = bus.get_object("org.openobex.client", path) - session = dbus.Interface(obj, "org.openobex.Session") - map = dbus.Interface(obj, "org.openobex.MessageAccess") + obj = bus.get_object("org.bluez.obex.client", path) + session = dbus.Interface(obj, "org.bluez.obex.Session") + map = dbus.Interface(obj, "org.bluez.obex.MessageAccess") if options.new_dir: set_folder(map, options.new_dir)
Signature · 1 line
1.7.10.2
Luiz Augusto von Dentz
maintainerPATCH v2 21/23 test: Use org.bluez.obex namespace in opp-client script
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
--- test/opp-client | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)
test/opp-client +13 -13
@@ -21,17 +21,17 @@ class OppClient: def __init__(self, session_path): self.transfer_path = None bus = dbus.SessionBus() - obj = bus.get_object("org.openobex.client", session_path) - self.session = dbus.Interface(obj, "org.openobex.Session") - self.opp = dbus.Interface(obj, "org.openobex.ObjectPush") + obj = bus.get_object("org.bluez.obex.client", session_path) + self.session = dbus.Interface(obj, "org.bluez.obex.Session") + self.opp = dbus.Interface(obj, "org.bluez.obex.ObjectPush") bus.add_signal_receiver(self.transfer_complete, - dbus_interface="org.openobex.Transfer", - signal_name="Complete", - path_keyword="path") + dbus_interface="org.bluez.obex.Transfer", + signal_name="Complete", + path_keyword="path") bus.add_signal_receiver(self.transfer_error, - dbus_interface="org.openobex.Transfer", - signal_name="Error", - path_keyword="path") + dbus_interface="org.bluez.obex.Transfer", + signal_name="Error", + path_keyword="path") def create_transfer_reply(self, reply): (path, properties) = reply
@@ -79,13 +79,13 @@ if __name__ == '__main__': bus = dbus.SessionBus() mainloop = gobject.MainLoop() - client = dbus.Interface(bus.get_object("org.openobex.client", "/"), - "org.openobex.Client") + client = dbus.Interface(bus.get_object("org.bluez.obex.client", "/"), + "org.bluez.obex.Client") print "Creating Session" - session_path = client.CreateSession(options.device, { "Target": "OPP" }) + path = client.CreateSession(options.device, { "Target": "OPP" }) - opp_client = OppClient(session_path) + opp_client = OppClient(path) if options.pull_to_file: opp_client.pull_business_card(options.pull_to_file)
Signature · 1 line
1.7.10.2
Luiz Augusto von Dentz
maintainerPATCH v2 22/23 test: Use org.bluez.obex namespace in pbap-client script
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
--- test/pbap-client | 54 +++++++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 25 deletions(-)
test/pbap-client +29 -25
@@ -16,27 +16,28 @@ class Transfer: class PbapClient: def __init__(self, session_path): - self.pending_transfers = 0 - self.transfer_dict = dict() + self.transfers = 0 + self.props = dict() self.flush_func = None bus = dbus.SessionBus() - obj = bus.get_object("org.openobex.client", session_path) - self.session = dbus.Interface(obj, "org.openobex.Session") - self.pbap = dbus.Interface(obj, "org.openobex.PhonebookAccess") + obj = bus.get_object("org.bluez.obex.client", session_path) + self.session = dbus.Interface(obj, "org.bluez.obex.Session") + self.pbap = dbus.Interface(obj, + "org.bluez.obex.PhonebookAccess") bus.add_signal_receiver(self.transfer_complete, - dbus_interface="org.openobex.Transfer", - signal_name="Complete", - path_keyword="path") + dbus_interface="org.bluez.obex.Transfer", + signal_name="Complete", + path_keyword="path") bus.add_signal_receiver(self.transfer_error, - dbus_interface="org.openobex.Transfer", - signal_name="Error", - path_keyword="path") + dbus_interface="org.bluez.obex.Transfer", + signal_name="Error", + path_keyword="path") def register(self, reply, transfer): (path, properties) = reply transfer.path = path transfer.filename = properties["Filename"] - self.transfer_dict[path] = transfer + self.props[path] = transfer print "Transfer created: %s (file %s)" % (path, transfer.filename)
@@ -45,25 +46,25 @@ class PbapClient: mainloop.quit() def transfer_complete(self, path): - req = self.transfer_dict.get(path) + req = self.props.get(path) if req == None: return - self.pending_transfers -= 1 + self.transfers -= 1 print "Transfer %s finished" % path f = open(req.filename, "r") os.remove(req.filename) lines = f.readlines() - del self.transfer_dict[path] + del self.props[path] req.callback_func(lines) - if (len(self.transfer_dict) == 0) and (self.pending_transfers == 0): + if (len(self.props) == 0) and (self.transfers == 0): if self.flush_func != None: f = self.flush_func self.flush_func = None f() def transfer_error(self, code, message, path): - req = self.transfer_dict.get(path) + req = self.props.get(path) if req == None: return print "Transfer finished with error %s: %s" % (code, message)
@@ -74,17 +75,17 @@ class PbapClient: self.pbap.Pull(vcard, "", reply_handler=lambda r: self.register(r, req), error_handler=self.error) - self.pending_transfers += 1 + self.transfers += 1 def pull_all(self, func): req = Transfer(func) self.pbap.PullAll("", reply_handler=lambda r: self.register(r, req), error_handler=self.error) - self.pending_transfers += 1 + self.transfers += 1 def flush_transfers(self, func): - if (len(self.transfer_dict) == 0) and (self.pending_transfers == 0): + if (len(self.props) == 0) and (self.transfers == 0): return self.flush_func = func
@@ -98,8 +99,8 @@ if __name__ == '__main__': bus = dbus.SessionBus() mainloop = gobject.MainLoop() - client = dbus.Interface(bus.get_object("org.openobex.client", "/"), - "org.openobex.Client") + client = dbus.Interface(bus.get_object("org.bluez.obex.client", "/"), + "org.bluez.obex.Client") if (len(sys.argv) < 2): print "Usage: %s <device>" % (sys.argv[0])
@@ -138,12 +139,15 @@ if __name__ == '__main__': for item in ret: print "%s : %s" % (item[0], item[1]) pbap_client.interface().SetFormat("vcard30") - pbap_client.interface().SetFilter(["VERSION", "FN", "TEL"]); - pbap_client.pull(item[0], lambda x: process_result(x, None)) + pbap_client.interface().SetFilter(["VERSION", "FN", + "TEL"]); + pbap_client.pull(item[0], + lambda x: process_result(x, None)) pbap_client.interface().SetFormat("vcard30") pbap_client.interface().SetFilter(["VERSION", "FN", "TEL"]); - pbap_client.pull_all(lambda x: process_result(x, "\n--- PullAll ---\n")) + pbap_client.pull_all(lambda x: process_result(x, + "\n--- PullAll ---\n")) pbap_client.flush_transfers(lambda: test_paths(paths[1:]))
Signature · 1 line
1.7.10.2
Luiz Augusto von Dentz
maintainerPATCH v2 23/23 test: Use org.bluez.obex namespace in get-capabilities script
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
--- test/get-capabilities | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
test/get-capabilities +4 -4
@@ -4,8 +4,8 @@ import sys import dbus bus = dbus.SessionBus() -client = dbus.Interface(bus.get_object("org.openobex.client", "/"), - "org.openobex.Client") +client = dbus.Interface(bus.get_object("org.bluez.obex.client", "/"), + "org.bluez.obex.Client") if (len(sys.argv) < 3): print "Usage: %s <device> <target>" % (sys.argv[0])
@@ -13,7 +13,7 @@ if (len(sys.argv) < 3): print "Creating Session" session_path = client.CreateSession(sys.argv[1], { "Target": sys.argv[2] }) -session = dbus.Interface(bus.get_object("org.openobex.client", session_path), - "org.openobex.Session") +session = dbus.Interface(bus.get_object("org.bluez.obex.client", session_path), + "org.bluez.obex.Session") print session.GetCapabilities()
Signature · 1 line
1.7.10.2
Luiz Augusto von Dentz
maintainerHi,
Quoted 60 lines · Luiz Augusto von Dentz
From: Luiz Augusto von Dentz <[email protected]>
The following patches changes the namespace from org.openobex to org.bluez.obex, getting rid of the last remaining references to openobex dependency.
This also serve as a fundation for the possible move of obexd inside BlueZ repository.
v2: Fix invalid syntax on pbap-client
Luiz Augusto von Dentz (23):
obexd-api: Change D-Bus namespace to org.bluez.obexd
core: Change D-Bus namespace to org.bluez.obex
core: Change D-Bus service file to use org.bluez.obex
agent-api: Change D-Bus namespace to org.bluez.obexd
core: Change agent interface to org.bluez.obex.Agent
test: Use org.bluez.obex namespace in simple-agent script
client-api: Change D-Bus namespace to org.bluez.obex.client
client: Change namespace to org.bluez.obex.client
client: Change D-Bus service file to use org.bluez.obex.client
client-api: Rename session interface to org.bluez.obex.Session
client-api: Rename ObjectPush interface to org.bluez.obex.ObjectPush
client-api: Rename FileTransfer interface to org.bluez.obex.FileTransfer
client-api: Rename PhonebookAccess interface to org.bluez.obex.PhonebookAccess
client-api: Rename Synchronization interface to org.bluez.obex.Synchronization
client-api: Rename MessageAccess interface to org.bluez.obex.MessageAccess
client-api: Rename Transfer interface to org.bluez.obex.Transfer
test: Use org.bluez.obex namespace in exchange-business-cards script
test: Use org.bluez.obex namespace in list-folders script
test: Use org.bluez.obex namespace in ftp-client script
test: Use org.bluez.obex namespace in map-client script
test: Use org.bluez.obex namespace in opp-client script
test: Use org.bluez.obex namespace in pbap-client script
test: Use org.bluez.obex namespace in get-capabilities scriptclient/ftp.c | 2 +-
client/manager.c | 6 +++---
client/map.c | 2 +-
client/obex-client.service.in | 2 +-
client/opp.c | 2 +-
client/pbap.c | 2 +-
client/session.c | 4 ++--
client/sync.c | 2 +-client/transfer.c | 4 ++-- doc/agent-api.txt | 6 +++--- doc/client-api.txt | 30 ++++++++++++++--------------- doc/obexd-api.txt | 16 ++++++++--------plugins/syncevolution.c | 3 +--
src/manager.c | 42 ++++++++++++++++++++---------------------src/manager.h| 2 +-
src/obexd.service.in | 2 +- test/exchange-business-cards | 11 +++++------
test/ftp-client | 27 +++++++++++++------------- test/get-capabilities | 8 ++++----
test/list-folders | 10 +++++-----
Quoted 8 lines
test/map-client | 10 +++++----- test/opp-client | 25 ++++++++++++------------ test/pbap-client | 38 +++++++++++++++++++++---------------- test/simple-agent | 37 ++++++++++++++++++------------------ 24 files changed, 149 insertions(+), 144 deletions(-)--
1.7.10.2
This changes are now upstream.
Signature · 1 line
Luiz Augusto von Dentz