From: Johan Hedberg <johan.hedberg@gmail.com>
To: Bruna Moreira <bruna.moreira@openbossa.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 2/3] Extract service UUIDs from advertising data
Date: Thu, 18 Nov 2010 14:43:20 +0200 [thread overview]
Message-ID: <20101118124320.GA4918@jh-x301> (raw)
In-Reply-To: <1290009593-13658-2-git-send-email-bruna.moreira@openbossa.org>
Hi Bruna,
On Wed, Nov 17, 2010, Bruna Moreira wrote:
> + /* Extract UUIDs from extended inquiry response if any */
> + dev->services = get_eir_uuids(eir_data, eir_length, dev->services);
> + uuid_count = g_slist_length(dev->services);
> +
> + if (dev->services) {
> + uuids = strlist2array(dev->services);
> + g_slist_foreach(dev->services, (GFunc) g_free, NULL);
> + g_slist_free(dev->services);
> + dev->services = NULL;
> + }
What's the reason that the get_eir_uuids API is designed so that it can
handle a list which already contains elements before calling the
function? Since you free the list right after creating the uuids array
it seems like this shouldn't happen. Or am I missing something?
Btw, is there something that could be optimized here since it seems like
you're regenerating the uuids array before every signal even though the
set of service might not have changed since the previous one. Maybe you
should track this and only regenerate the array if there has been a
changed from the previous signal. What do you think?
Johan
next prev parent reply other threads:[~2010-11-18 12:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-17 15:59 [PATCH 1/3] Advertising data: extract local name Bruna Moreira
2010-11-17 15:59 ` [PATCH 2/3] Extract service UUIDs from advertising data Bruna Moreira
2010-11-18 12:43 ` Johan Hedberg [this message]
2010-11-18 14:03 ` Anderson Lizardo
2010-11-18 14:42 ` Johan Hedberg
2010-11-17 15:59 ` [PATCH 3/3] Emit "DeviceFound" signal for LE devices Bruna Moreira
2010-11-18 14:44 ` Johan Hedberg
2010-11-18 12:33 ` [PATCH 1/3] Advertising data: extract local name Johan Hedberg
2010-11-18 13:29 ` Anderson Lizardo
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=20101118124320.GA4918@jh-x301 \
--to=johan.hedberg@gmail.com \
--cc=bruna.moreira@openbossa.org \
--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