From ae672c6f3ed45263be3b57fe9f15b9f3417cfcc5 Mon Sep 17 00:00:00 2001 From: Martin Date: Fri, 5 Jul 2013 17:38:26 +0800 Subject: [PATCH] obexd/client: Add Target property to Session interface Target property is already documented property but it was not implemented. --- obexd/client/session.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/obexd/client/session.c b/obexd/client/session.c index d9719829b..44e2bf8b8 100644 --- a/obexd/client/session.c +++ b/obexd/client/session.c @@ -675,10 +675,32 @@ static const GDBusMethodTable session_methods[] = { { } }; +static gboolean get_target(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *data) +{ + struct obc_session *session = data; + + if (session->driver->uuid == NULL) + return FALSE; + + dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, + &session->driver->uuid); + + return TRUE; +} + +static gboolean target_exists(const GDBusPropertyTable *property, void *data) +{ + struct obc_session *session = data; + + return session->driver->uuid != NULL; +} + static const GDBusPropertyTable session_properties[] = { { "Source", "s", get_source, NULL, source_exists }, { "Destination", "s", get_destination }, { "Channel", "y", get_channel }, + { "Target", "s", get_target, NULL, target_exists }, { } }; -- 2.47.3