From: Johan Hedberg <johan.hedberg@gmail.com>
To: Bruna Moreira <bruna.moreira@openbossa.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 1/3] Advertising data: extract local name
Date: Thu, 18 Nov 2010 14:33:10 +0200 [thread overview]
Message-ID: <20101118123310.GA4101@jh-x301> (raw)
In-Reply-To: <1290009593-13658-1-git-send-email-bruna.moreira@openbossa.org>
Hi Bruna,
On Wed, Nov 17, 2010, Bruna Moreira wrote:
> @@ -3007,6 +3007,7 @@ void adapter_update_device_from_info(struct btd_adapter *adapter,
> bdaddr_t bdaddr;
> gboolean new_dev;
> int8_t rssi;
> + uint8_t type;
>
> rssi = *(info->data + info->length);
> bdaddr = info->bdaddr;
> @@ -3023,6 +3024,14 @@ void adapter_update_device_from_info(struct btd_adapter *adapter,
>
> adapter->found_devices = g_slist_sort(adapter->found_devices,
> (GCompareFunc) dev_rssi_cmp);
> +
> + if (info->length) {
> + char *tmp_name = bt_extract_eir_name(info->data, &type);
> + if (tmp_name) {
> + g_free(dev->name);
> + dev->name = tmp_name;
> + }
> + }
Variables should be always declared in the smallest possible scope, so
your new type variable is in the wrong place (it should be declared
inside the if-statement. Since this was the only issue I found with this
patch I fixed it myself and pushed it upstream. Btw, is it really safe
to ignore the type here? What if it's EIR_NAME_SHORT? Wouldn't you then
want to perform full name discovery using e.g. the GAP GATT service
later?
Johan
next prev parent reply other threads:[~2010-11-18 12:33 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
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 ` Johan Hedberg [this message]
2010-11-18 13:29 ` [PATCH 1/3] Advertising data: extract local name 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=20101118123310.GA4101@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