linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Inga Stotland <ingas@codeaurora.org>
To: linux-bluetooth@vger.kernel.org
Cc: rshaffer@codeaurora.org, marcel@holtmann.org,
	johan.hedberg@gmail.com, Inga Stotland <ingas@codeaurora.org>
Subject: [PATCH 4/5] Handle arrays in device properties dictionary
Date: Thu, 22 Jul 2010 09:06:19 -0700	[thread overview]
Message-ID: <1279814780-29673-5-git-send-email-ingas@codeaurora.org> (raw)
In-Reply-To: <1279814780-29673-1-git-send-email-ingas@codeaurora.org>

---
 src/adapter.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/adapter.c b/src/adapter.c
index c1e1768..b22b086 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -2715,6 +2715,7 @@ static void append_dict_valist(DBusMessageIter *iter,
 	DBusMessageIter dict;
 	const char *key;
 	int type;
+	int n_elements;
 	void *val;
 
 	dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY,
@@ -2726,7 +2727,12 @@ static void append_dict_valist(DBusMessageIter *iter,
 	while (key) {
 		type = va_arg(var_args, int);
 		val = va_arg(var_args, void *);
-		dict_append_entry(&dict, key, type, val);
+		if (type == DBUS_TYPE_ARRAY) {
+			n_elements = va_arg(var_args, int);
+			if (n_elements > 0)
+				dict_append_array(&dict, key, DBUS_TYPE_STRING, val, n_elements);
+		} else
+			dict_append_entry(&dict, key, type, val);
 		key = va_arg(var_args, char *);
 	}
 
-- 
1.7.1

-- 
Inga Stotland
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

  parent reply	other threads:[~2010-07-22 16:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-22 16:06 [PATCH v4 0/5] Enhanced support for extended inquiry response Inga Stotland
2010-07-22 16:06 ` [PATCH 1/5] Spec constants for Extended Inquiry Response field types Inga Stotland
2010-07-22 16:06 ` [PATCH 2/5] Support for adding UUID128 to extended inquiry response Inga Stotland
2010-07-27 18:25   ` Luiz Augusto von Dentz
2010-07-27 20:08     ` ingas
2010-07-28  5:59       ` Luiz Augusto von Dentz
2010-07-22 16:06 ` [PATCH 3/5] Update EIR whenever record is added or removed Inga Stotland
2010-07-22 16:06 ` Inga Stotland [this message]
2010-07-22 16:06 ` [PATCH 5/5] Extended support for generating dictionary value of service UUIDs Inga Stotland
2010-07-23  8:20 ` [PATCH v4 0/5] Enhanced support for extended inquiry response Johan Hedberg
2010-07-23  8:27   ` Johan Hedberg
2010-07-23  8:43     ` Johan Hedberg
2010-07-25 22:48       ` ingas
2010-07-26  9:44         ` Johan Hedberg
2010-07-28 20:08           ` ingas
2010-08-02 18:55             ` Johan Hedberg
2010-08-02 21:24               ` ingas
  -- strict thread matches above, loose matches on Subject: below --
2010-07-20 21:56 [PATCH v3 " Inga Stotland
2010-07-20 21:56 ` [PATCH 4/5] Handle arrays in device properties dictionary Inga Stotland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1279814780-29673-5-git-send-email-ingas@codeaurora.org \
    --to=ingas@codeaurora.org \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=rshaffer@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).