linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] Add UUID property to GATT service object
Date: Tue, 8 Feb 2011 15:00:58 -0800	[thread overview]
Message-ID: <20110208225958.GA17287@jh-x301> (raw)
In-Reply-To: <1296828067-20496-1-git-send-email-epx@signove.com>

Hi Elvis,

On Fri, Feb 04, 2011, Elvis Pf??tzenreuter wrote:
> @@ -962,6 +963,10 @@ static DBusMessage *prim_get_properties(DBusConnection *conn, DBusMessage *msg,
>  
>  	dict_append_array(&dict, "Characteristics", DBUS_TYPE_OBJECT_PATH,
>  								&chars, i);
> +	uuid = g_strdup(prim->att->uuid);
> +	dict_append_entry(&dict, "UUID", DBUS_TYPE_STRING, &uuid);
> +
> +	g_free(uuid);
>  	g_free(chars);
>  
>  	dbus_message_iter_close_container(&iter, &dict);

I'd rather avoid the unnecessary memory allocation here. The following
should be enough:

const char *uuid;
...
uuid = prim->att->uuid;
dict_append_entry(..., DBUS_TYPE_STRING, &uuid);

Johan

      reply	other threads:[~2011-02-08 23:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-04 14:01 [PATCH] Add UUID property to GATT service object Elvis Pfützenreuter
2011-02-08 23:00 ` Johan Hedberg [this message]

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=20110208225958.GA17287@jh-x301 \
    --to=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.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).