All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] obexd/client: Add client session properties
@ 2013-07-05  9:08 martin.xu
  2013-07-08 15:52 ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 9+ messages in thread
From: martin.xu @ 2013-07-05  9:08 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Martin

From: Martin <martin.xu@linux.intel.com>

---
 obexd/client/session.c |   38 ++++++++++++++++++++++++++++++++------
 1 file changed, 32 insertions(+), 6 deletions(-)

diff --git a/obexd/client/session.c b/obexd/client/session.c
index 8d32ed0..e9cbf00 100644
--- a/obexd/client/session.c
+++ b/obexd/client/session.c
@@ -630,9 +630,6 @@ static gboolean get_source(const GDBusPropertyTable *property,
 {
 	struct obc_session *session = data;
 
-	if (session->source == NULL)
-		return FALSE;
-
 	dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING,
 							&session->source);
 
@@ -675,10 +672,35 @@ static const GDBusMethodTable session_methods[] = {
 	{ }
 };
 
+static gboolean get_target(const GDBusPropertyTable *property,
+					DBusMessageIter *iter, void *data)
+{
+	struct obc_session *session = data;
+	char *uuid;
+
+	uuid = g_strdup(session->driver->uuid);
+
+	dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &uuid);
+	g_free(uuid);
+
+	return TRUE;
+}
+
+static gboolean session_target_exists(const GDBusPropertyTable *property,
+								void *data)
+{
+	struct obc_session *session = data;
+	if (session->driver)
+		return session->driver->uuid ? TRUE : FALSE;
+
+	return FALSE;
+}
+
 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, session_target_exists },
 	{ }
 };
 
@@ -854,9 +876,13 @@ const char *obc_session_register(struct obc_session *session,
 	session->path = g_strdup_printf("%s/session%ju",
 						SESSION_BASEPATH, counter++);
 
-	if (g_dbus_register_interface(session->conn, session->path,
-					SESSION_INTERFACE, session_methods,
-					NULL, NULL, session, destroy) == FALSE)
+	if (g_dbus_register_interface(session->conn,
+					session->path,
+					SESSION_INTERFACE,
+					session_methods,
+					NULL,
+					session_properties,
+					session, destroy) == FALSE)
 		goto fail;
 
 	if (session->driver->probe && session->driver->probe(session) < 0) {
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] obexd/client: Add client session properties
  2013-07-05  9:08 [PATCH] obexd/client: Add client session properties martin.xu
@ 2013-07-08 15:52 ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 9+ messages in thread
From: Luiz Augusto von Dentz @ 2013-07-08 15:52 UTC (permalink / raw)
  To: martin.xu; +Cc: linux-bluetooth

Hi Martin,

On Fri, Jul 5, 2013 at 12:08 PM,  <martin.xu@linux.intel.com> wrote:
> From: Martin <martin.xu@linux.intel.com>
>
> ---
>  obexd/client/session.c |   38 ++++++++++++++++++++++++++++++++------
>  1 file changed, 32 insertions(+), 6 deletions(-)
>
> diff --git a/obexd/client/session.c b/obexd/client/session.c
> index 8d32ed0..e9cbf00 100644
> --- a/obexd/client/session.c
> +++ b/obexd/client/session.c
> @@ -630,9 +630,6 @@ static gboolean get_source(const GDBusPropertyTable *property,
>  {
>         struct obc_session *session = data;
>
> -       if (session->source == NULL)
> -               return FALSE;
> -
>         dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING,
>                                                         &session->source);
>
> @@ -675,10 +672,35 @@ static const GDBusMethodTable session_methods[] = {
>         { }
>  };
>
> +static gboolean get_target(const GDBusPropertyTable *property,
> +                                       DBusMessageIter *iter, void *data)
> +{
> +       struct obc_session *session = data;
> +       char *uuid;
> +
> +       uuid = g_strdup(session->driver->uuid);
> +
> +       dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &uuid);
> +       g_free(uuid);
> +
> +       return TRUE;
> +}
> +
> +static gboolean session_target_exists(const GDBusPropertyTable *property,
> +                                                               void *data)
> +{
> +       struct obc_session *session = data;
> +       if (session->driver)
> +               return session->driver->uuid ? TRUE : FALSE;
> +
> +       return FALSE;
> +}
> +
>  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, session_target_exists },
>         { }
>  };
>
> @@ -854,9 +876,13 @@ const char *obc_session_register(struct obc_session *session,
>         session->path = g_strdup_printf("%s/session%ju",
>                                                 SESSION_BASEPATH, counter++);
>
> -       if (g_dbus_register_interface(session->conn, session->path,
> -                                       SESSION_INTERFACE, session_methods,
> -                                       NULL, NULL, session, destroy) == FALSE)
> +       if (g_dbus_register_interface(session->conn,
> +                                       session->path,
> +                                       SESSION_INTERFACE,
> +                                       session_methods,
> +                                       NULL,
> +                                       session_properties,
> +                                       session, destroy) == FALSE)
>                 goto fail;
>
>         if (session->driver->probe && session->driver->probe(session) < 0) {
> --
> 1.7.10.4

After some cleanup Ive applied it, thanks.

--
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH] obexd/client: Add client session properties
  2013-07-05 10:04 ` Luiz Augusto von Dentz
@ 2013-07-08  0:21   ` Xu, Martin
  0 siblings, 0 replies; 9+ messages in thread
From: Xu, Martin @ 2013-07-08  0:21 UTC (permalink / raw)
  To: Luiz Augusto von Dentz, martin.xu; +Cc: linux-bluetooth

> -----Original Message-----
> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
> owner@vger.kernel.org] On Behalf Of Luiz Augusto von Dentz
> Sent: Friday, July 05, 2013 18:04
> To: martin.xu@linux.intel.com
> Cc: linux-bluetooth@vger.kernel.org
> Subject: Re: [PATCH] obexd/client: Add client session properties
> 
> Hi Martin,
> 
> On Fri, Jul 5, 2013 at 12:38 PM,  <martin.xu@linux.intel.com> wrote:
> > From: Martin <martin.xu@linux.intel.com>
> 
> Please add a description why are the changes necessary.
> 
> > ---
> >  obexd/client/session.c |   38 ++++++++++++++++++++++++++++++++------
> >  1 file changed, 32 insertions(+), 6 deletions(-)
> >
> > diff --git a/obexd/client/session.c b/obexd/client/session.c index
> > 8d32ed0..e9cbf00 100644
> > --- a/obexd/client/session.c
> > +++ b/obexd/client/session.c
> > @@ -630,9 +630,6 @@ static gboolean get_source(const
> > GDBusPropertyTable *property,  {
> >         struct obc_session *session = data;
> >
> > -       if (session->source == NULL)
> > -               return FALSE;
> 
> I guess you haven't read carefully may comments from the last time, did
> you? This should not be necessary here, otherwise create another patch.
Looks like I lost your last mail, could you repeat that.
For others comments, I will resend the patch.
Thanks!

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] obexd/client: Add client session properties
  2013-07-05  9:38 martin.xu
@ 2013-07-05 10:04 ` Luiz Augusto von Dentz
  2013-07-08  0:21   ` Xu, Martin
  0 siblings, 1 reply; 9+ messages in thread
From: Luiz Augusto von Dentz @ 2013-07-05 10:04 UTC (permalink / raw)
  To: martin.xu; +Cc: linux-bluetooth

Hi Martin,

On Fri, Jul 5, 2013 at 12:38 PM,  <martin.xu@linux.intel.com> wrote:
> From: Martin <martin.xu@linux.intel.com>

Please add a description why are the changes necessary.

> ---
>  obexd/client/session.c |   38 ++++++++++++++++++++++++++++++++------
>  1 file changed, 32 insertions(+), 6 deletions(-)
>
> diff --git a/obexd/client/session.c b/obexd/client/session.c
> index 8d32ed0..e9cbf00 100644
> --- a/obexd/client/session.c
> +++ b/obexd/client/session.c
> @@ -630,9 +630,6 @@ static gboolean get_source(const GDBusPropertyTable *property,
>  {
>         struct obc_session *session = data;
>
> -       if (session->source == NULL)
> -               return FALSE;

I guess you haven't read carefully may comments from the last time,
did you? This should not be necessary here, otherwise create another
patch.

>         dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING,
>                                                         &session->source);
>
> @@ -675,10 +672,35 @@ static const GDBusMethodTable session_methods[] = {
>         { }
>  };
>
> +static gboolean get_target(const GDBusPropertyTable *property,
> +                                       DBusMessageIter *iter, void *data)
> +{
> +       struct obc_session *session = data;
> +       char *uuid;
> +
> +       uuid = g_strdup(session->driver->uuid);

You don't really need a copy here, just use session->driver->uuid directly.

> +       dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &uuid);
> +       g_free(uuid);
> +
> +       return TRUE;
> +}
> +
> +static gboolean session_target_exists(const GDBusPropertyTable *property,
> +                                                               void *data)
> +{
> +       struct obc_session *session = data;
> +       if (session->driver)
> +               return session->driver->uuid ? TRUE : FALSE;
> +
> +       return FALSE;
> +}
> +
>  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, session_target_exists },
>         { }
>  };
>
> @@ -854,9 +876,13 @@ const char *obc_session_register(struct obc_session *session,
>         session->path = g_strdup_printf("%s/session%ju",
>                                                 SESSION_BASEPATH, counter++);
>
> -       if (g_dbus_register_interface(session->conn, session->path,
> -                                       SESSION_INTERFACE, session_methods,
> -                                       NULL, NULL, session, destroy) == FALSE)
> +       if (g_dbus_register_interface(session->conn,
> +                                       session->path,
> +                                       SESSION_INTERFACE,
> +                                       session_methods,
> +                                       NULL,
> +                                       session_properties,
> +                                       session, destroy) == FALSE)
>                 goto fail;

Im not sure why you are reformatting the lines above, they were fine
according to codestyle and even if they were not you should not mix
changes that are not related to the patch.



--
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] obexd/client: Add client session properties
@ 2013-07-05  9:38 martin.xu
  2013-07-05 10:04 ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 9+ messages in thread
From: martin.xu @ 2013-07-05  9:38 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Martin

From: Martin <martin.xu@linux.intel.com>

---
 obexd/client/session.c |   38 ++++++++++++++++++++++++++++++++------
 1 file changed, 32 insertions(+), 6 deletions(-)

diff --git a/obexd/client/session.c b/obexd/client/session.c
index 8d32ed0..e9cbf00 100644
--- a/obexd/client/session.c
+++ b/obexd/client/session.c
@@ -630,9 +630,6 @@ static gboolean get_source(const GDBusPropertyTable *property,
 {
 	struct obc_session *session = data;
 
-	if (session->source == NULL)
-		return FALSE;
-
 	dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING,
 							&session->source);
 
@@ -675,10 +672,35 @@ static const GDBusMethodTable session_methods[] = {
 	{ }
 };
 
+static gboolean get_target(const GDBusPropertyTable *property,
+					DBusMessageIter *iter, void *data)
+{
+	struct obc_session *session = data;
+	char *uuid;
+
+	uuid = g_strdup(session->driver->uuid);
+
+	dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &uuid);
+	g_free(uuid);
+
+	return TRUE;
+}
+
+static gboolean session_target_exists(const GDBusPropertyTable *property,
+								void *data)
+{
+	struct obc_session *session = data;
+	if (session->driver)
+		return session->driver->uuid ? TRUE : FALSE;
+
+	return FALSE;
+}
+
 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, session_target_exists },
 	{ }
 };
 
@@ -854,9 +876,13 @@ const char *obc_session_register(struct obc_session *session,
 	session->path = g_strdup_printf("%s/session%ju",
 						SESSION_BASEPATH, counter++);
 
-	if (g_dbus_register_interface(session->conn, session->path,
-					SESSION_INTERFACE, session_methods,
-					NULL, NULL, session, destroy) == FALSE)
+	if (g_dbus_register_interface(session->conn,
+					session->path,
+					SESSION_INTERFACE,
+					session_methods,
+					NULL,
+					session_properties,
+					session, destroy) == FALSE)
 		goto fail;
 
 	if (session->driver->probe && session->driver->probe(session) < 0) {
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] obexd/client: Add client session properties
  2013-07-01  3:13 martin.xu
@ 2013-07-02  8:11 ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 9+ messages in thread
From: Luiz Augusto von Dentz @ 2013-07-02  8:11 UTC (permalink / raw)
  To: martin.xu; +Cc: linux-bluetooth

Hi Martin,

On Mon, Jul 1, 2013 at 6:13 AM,  <martin.xu@linux.intel.com> wrote:
> From: Martin <martin.xu@linux.intel.com>
>
> ---
>  obexd/client/session.c |   38 ++++++++++++++++++++++++++++++++------
>  1 file changed, 32 insertions(+), 6 deletions(-)
>
> diff --git a/obexd/client/session.c b/obexd/client/session.c
> index 8d32ed0..e9cbf00 100644
> --- a/obexd/client/session.c
> +++ b/obexd/client/session.c
> @@ -630,9 +630,6 @@ static gboolean get_source(const GDBusPropertyTable *property,
>  {
>         struct obc_session *session = data;
>
> -       if (session->source == NULL)
> -               return FALSE;
> -

Not sure what is this for? Anyway it doesn't seems related to the
subject so I would at least have it as separate patch.

>         dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING,
>                                                         &session->source);
>
> @@ -675,10 +672,35 @@ static const GDBusMethodTable session_methods[] = {
>         { }
>  };
>
> +static gboolean get_target(const GDBusPropertyTable *property,
> +                                       DBusMessageIter *iter, void *data)
> +{
> +       struct obc_session *session = data;
> +       char *uuid;
> +
> +       uuid = g_strdup(session->driver->uuid);

You don't really need this copy, libdbus have its own copy, so you can
pass session->driver->uuid directly.

> +
> +       dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &uuid);
> +       g_free(uuid);
> +
> +       return TRUE;
> +}
> +
> +static gboolean session_target_exists(const GDBusPropertyTable *property,
> +                                                               void *data)
> +{
> +       struct obc_session *session = data;
> +       if (session->driver)
> +               return session->driver->uuid ? TRUE : FALSE;

I prefer if (session->driver == NULL) return FALSE; then return
session->driver->uuid != NULL;

> +
> +       return FALSE;
> +}
> +
>  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, session_target_exists },
>         { }
>  };
>
> @@ -854,9 +876,13 @@ const char *obc_session_register(struct obc_session *session,
>         session->path = g_strdup_printf("%s/session%ju",
>                                                 SESSION_BASEPATH, counter++);
>
> -       if (g_dbus_register_interface(session->conn, session->path,
> -                                       SESSION_INTERFACE, session_methods,
> -                                       NULL, NULL, session, destroy) == FALSE)
> +       if (g_dbus_register_interface(session->conn,
> +                                       session->path,
> +                                       SESSION_INTERFACE,
> +                                       session_methods,
> +                                       NULL,
> +                                       session_properties,
> +                                       session, destroy) == FALSE)

The change above does not apply as I already applied similar fix, please rebase.



--
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] obexd/client: Add client session properties
@ 2013-07-01  3:13 martin.xu
  2013-07-02  8:11 ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 9+ messages in thread
From: martin.xu @ 2013-07-01  3:13 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Martin

From: Martin <martin.xu@linux.intel.com>

---
 obexd/client/session.c |   38 ++++++++++++++++++++++++++++++++------
 1 file changed, 32 insertions(+), 6 deletions(-)

diff --git a/obexd/client/session.c b/obexd/client/session.c
index 8d32ed0..e9cbf00 100644
--- a/obexd/client/session.c
+++ b/obexd/client/session.c
@@ -630,9 +630,6 @@ static gboolean get_source(const GDBusPropertyTable *property,
 {
 	struct obc_session *session = data;
 
-	if (session->source == NULL)
-		return FALSE;
-
 	dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING,
 							&session->source);
 
@@ -675,10 +672,35 @@ static const GDBusMethodTable session_methods[] = {
 	{ }
 };
 
+static gboolean get_target(const GDBusPropertyTable *property,
+					DBusMessageIter *iter, void *data)
+{
+	struct obc_session *session = data;
+	char *uuid;
+
+	uuid = g_strdup(session->driver->uuid);
+
+	dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &uuid);
+	g_free(uuid);
+
+	return TRUE;
+}
+
+static gboolean session_target_exists(const GDBusPropertyTable *property,
+								void *data)
+{
+	struct obc_session *session = data;
+	if (session->driver)
+		return session->driver->uuid ? TRUE : FALSE;
+
+	return FALSE;
+}
+
 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, session_target_exists },
 	{ }
 };
 
@@ -854,9 +876,13 @@ const char *obc_session_register(struct obc_session *session,
 	session->path = g_strdup_printf("%s/session%ju",
 						SESSION_BASEPATH, counter++);
 
-	if (g_dbus_register_interface(session->conn, session->path,
-					SESSION_INTERFACE, session_methods,
-					NULL, NULL, session, destroy) == FALSE)
+	if (g_dbus_register_interface(session->conn,
+					session->path,
+					SESSION_INTERFACE,
+					session_methods,
+					NULL,
+					session_properties,
+					session, destroy) == FALSE)
 		goto fail;
 
 	if (session->driver->probe && session->driver->probe(session) < 0) {
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH] obexd/client: Add client session properties
@ 2013-07-01  3:11 martin.xu
  0 siblings, 0 replies; 9+ messages in thread
From: martin.xu @ 2013-07-01  3:11 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Martin

From: Martin <martin.xu@linux.intel.com>

---
 obexd/client/session.c |   38 ++++++++++++++++++++++++++++++++------
 1 file changed, 32 insertions(+), 6 deletions(-)

diff --git a/obexd/client/session.c b/obexd/client/session.c
index 8d32ed0..e9cbf00 100644
--- a/obexd/client/session.c
+++ b/obexd/client/session.c
@@ -630,9 +630,6 @@ static gboolean get_source(const GDBusPropertyTable *property,
 {
 	struct obc_session *session = data;
 
-	if (session->source == NULL)
-		return FALSE;
-
 	dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING,
 							&session->source);
 
@@ -675,10 +672,35 @@ static const GDBusMethodTable session_methods[] = {
 	{ }
 };
 
+static gboolean get_target(const GDBusPropertyTable *property,
+					DBusMessageIter *iter, void *data)
+{
+	struct obc_session *session = data;
+	char *uuid;
+
+	uuid = g_strdup(session->driver->uuid);
+
+	dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &uuid);
+	g_free(uuid);
+
+	return TRUE;
+}
+
+static gboolean session_target_exists(const GDBusPropertyTable *property,
+								void *data)
+{
+	struct obc_session *session = data;
+	if (session->driver)
+		return session->driver->uuid ? TRUE : FALSE;
+
+	return FALSE;
+}
+
 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, session_target_exists },
 	{ }
 };
 
@@ -854,9 +876,13 @@ const char *obc_session_register(struct obc_session *session,
 	session->path = g_strdup_printf("%s/session%ju",
 						SESSION_BASEPATH, counter++);
 
-	if (g_dbus_register_interface(session->conn, session->path,
-					SESSION_INTERFACE, session_methods,
-					NULL, NULL, session, destroy) == FALSE)
+	if (g_dbus_register_interface(session->conn,
+					session->path,
+					SESSION_INTERFACE,
+					session_methods,
+					NULL,
+					session_properties,
+					session, destroy) == FALSE)
 		goto fail;
 
 	if (session->driver->probe && session->driver->probe(session) < 0) {
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH] obexd/client: Add client session properties
@ 2013-06-28  8:13 martin.xu
  0 siblings, 0 replies; 9+ messages in thread
From: martin.xu @ 2013-06-28  8:13 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Martin

From: Martin <martin.xu@linux.intel.com>

---
 obexd/client/session.c |   38 ++++++++++++++++++++++++++++++++------
 1 file changed, 32 insertions(+), 6 deletions(-)

diff --git a/obexd/client/session.c b/obexd/client/session.c
index 8d32ed0..e9cbf00 100644
--- a/obexd/client/session.c
+++ b/obexd/client/session.c
@@ -630,9 +630,6 @@ static gboolean get_source(const GDBusPropertyTable *property,
 {
 	struct obc_session *session = data;
 
-	if (session->source == NULL)
-		return FALSE;
-
 	dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING,
 							&session->source);
 
@@ -675,10 +672,35 @@ static const GDBusMethodTable session_methods[] = {
 	{ }
 };
 
+static gboolean get_target(const GDBusPropertyTable *property,
+					DBusMessageIter *iter, void *data)
+{
+	struct obc_session *session = data;
+	char *uuid;
+
+	uuid = g_strdup(session->driver->uuid);
+
+	dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &uuid);
+	g_free(uuid);
+
+	return TRUE;
+}
+
+static gboolean session_target_exists(const GDBusPropertyTable *property,
+								void *data)
+{
+	struct obc_session *session = data;
+	if (session->driver)
+		return session->driver->uuid ? TRUE : FALSE;
+
+	return FALSE;
+}
+
 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, session_target_exists },
 	{ }
 };
 
@@ -854,9 +876,13 @@ const char *obc_session_register(struct obc_session *session,
 	session->path = g_strdup_printf("%s/session%ju",
 						SESSION_BASEPATH, counter++);
 
-	if (g_dbus_register_interface(session->conn, session->path,
-					SESSION_INTERFACE, session_methods,
-					NULL, NULL, session, destroy) == FALSE)
+	if (g_dbus_register_interface(session->conn,
+					session->path,
+					SESSION_INTERFACE,
+					session_methods,
+					NULL,
+					session_properties,
+					session, destroy) == FALSE)
 		goto fail;
 
 	if (session->driver->probe && session->driver->probe(session) < 0) {
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-07-08 15:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-05  9:08 [PATCH] obexd/client: Add client session properties martin.xu
2013-07-08 15:52 ` Luiz Augusto von Dentz
  -- strict thread matches above, loose matches on Subject: below --
2013-07-05  9:38 martin.xu
2013-07-05 10:04 ` Luiz Augusto von Dentz
2013-07-08  0:21   ` Xu, Martin
2013-07-01  3:13 martin.xu
2013-07-02  8:11 ` Luiz Augusto von Dentz
2013-07-01  3:11 martin.xu
2013-06-28  8:13 martin.xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.