From: Szymon Janc <szymon.janc@tieto.com>
To: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 1/2] android/bluetooth: Set default adapter name on first start
Date: Thu, 09 Jan 2014 10:32:09 +0100 [thread overview]
Message-ID: <4498976.L1NxG8XoI7@uw000953> (raw)
In-Reply-To: <1389256760-10832-1-git-send-email-szymon.janc@tieto.com>
On Thursday 09 of January 2014 09:39:19 Szymon Janc wrote:
> On first start always set name to default name. Adapter name is
> updated on start only if current name is different.
> ---
> android/bluetooth.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/android/bluetooth.c b/android/bluetooth.c
> index 9da988b..6aad9b5 100644
> --- a/android/bluetooth.c
> +++ b/android/bluetooth.c
> @@ -50,6 +50,8 @@
> #include "utils.h"
> #include "bluetooth.h"
>
> +#define DEFAULT_ADAPTER_NAME "BlueZ for Android"
> +
> #define DUT_MODE_FILE "/sys/kernel/debug/bluetooth/hci%u/dut_mode"
>
> #define DEVICE_ID_SOURCE 0x0002 /* USB */
> @@ -1734,15 +1736,17 @@ static void read_info_complete(uint8_t status, uint16_t length,
>
> if (!bacmp(&adapter.bdaddr, BDADDR_ANY)) {
> bacpy(&adapter.bdaddr, &rp->bdaddr);
> - adapter.name = g_strdup((const char *) rp->name);
> + adapter.name = g_strdup(DEFAULT_ADAPTER_NAME);
> store_adapter_config();
> - set_adapter_name(rp->name, strlen((char *)rp->name));
> } else if (bacmp(&adapter.bdaddr, &rp->bdaddr)) {
> error("Bluetooth address mismatch");
> err = -ENODEV;
> goto failed;
> }
>
> + if (g_strcmp0(adapter.name, (const char *) rp->name))
> + set_adapter_name((uint8_t *)adapter.name, strlen(adapter.name));
> +
> /* Store adapter information */
> adapter.dev_class = rp->dev_class[0] | (rp->dev_class[1] << 8) |
> (rp->dev_class[2] << 16);
>
Both patches are now pushed upstream.
--
Best regards,
Szymon Janc
prev parent reply other threads:[~2014-01-09 9:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-09 8:39 [PATCH 1/2] android/bluetooth: Set default adapter name on first start Szymon Janc
2014-01-09 8:39 ` [PATCH 2/2] android/bluetooth: Set major and minor class od device Szymon Janc
2014-01-09 9:32 ` Szymon Janc [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=4498976.L1NxG8XoI7@uw000953 \
--to=szymon.janc@tieto.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