From fe22983f433d927768c6e343640881ae211573e6 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 30 Sep 2013 10:01:48 +0300 Subject: [PATCH] tools/obexctl: Add proxy handling for org.bluez.obex.PhonebookAccess1 This adds proxy handling for org.bluez.obex.PhonebookAccess1 so changes to the proxy are printed in the output. --- tools/obexctl.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tools/obexctl.c b/tools/obexctl.c index b943fbb18..bab9ad8cf 100644 --- a/tools/obexctl.c +++ b/tools/obexctl.c @@ -54,6 +54,7 @@ #define OBEX_CLIENT_INTERFACE "org.bluez.obex.Client1" #define OBEX_OPP_INTERFACE "org.bluez.obex.ObjectPush1" #define OBEX_FTP_INTERFACE "org.bluez.obex.FileTransfer1" +#define OBEX_PBAP_INTERFACE "org.bluez.obex.PhonebookAccess1" static GMainLoop *main_loop; static DBusConnection *dbus_conn; @@ -61,6 +62,7 @@ static GDBusProxy *default_session; static GSList *sessions = NULL; static GSList *opps = NULL; static GSList *ftps = NULL; +static GSList *pbaps = NULL; static GSList *transfers = NULL; static GDBusProxy *client = NULL; @@ -1438,6 +1440,13 @@ static void ftp_added(GDBusProxy *proxy) print_proxy(proxy, "FileTransfer", COLORED_NEW); } +static void pbap_added(GDBusProxy *proxy) +{ + pbaps = g_slist_append(pbaps, proxy); + + print_proxy(proxy, "PhonebookAccess", COLORED_NEW); +} + static void proxy_added(GDBusProxy *proxy, void *user_data) { const char *interface; @@ -1454,6 +1463,8 @@ static void proxy_added(GDBusProxy *proxy, void *user_data) opp_added(proxy); else if (!strcmp(interface, OBEX_FTP_INTERFACE)) ftp_added(proxy); + else if (!strcmp(interface, OBEX_PBAP_INTERFACE)) + pbap_added(proxy); } static void client_removed(GDBusProxy *proxy) @@ -1495,6 +1506,13 @@ static void ftp_removed(GDBusProxy *proxy) ftps = g_slist_remove(ftps, proxy); } +static void pbap_removed(GDBusProxy *proxy) +{ + print_proxy(proxy, "PhonebookAccess", COLORED_DEL); + + pbaps = g_slist_remove(pbaps, proxy); +} + static void proxy_removed(GDBusProxy *proxy, void *user_data) { const char *interface; @@ -1511,6 +1529,8 @@ static void proxy_removed(GDBusProxy *proxy, void *user_data) opp_removed(proxy); else if (!strcmp(interface, OBEX_FTP_INTERFACE)) ftp_removed(proxy); + else if (!strcmp(interface, OBEX_PBAP_INTERFACE)) + pbap_removed(proxy); } static void session_property_changed(GDBusProxy *proxy, const char *name, -- 2.11.0