All of lore.kernel.org
 help / color / mirror / Atom feed
From: Szymon Janc <szymon.janc@tieto.com>
To: Andrei Emeltchenko <Andrei.Emeltchenko.news@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] android/handsfree: Return default device for zero bdaddr
Date: Thu, 06 Nov 2014 11:41:10 +0100	[thread overview]
Message-ID: <4917512.kiFJOhNPJF@uw000953> (raw)
In-Reply-To: <1415262430-12425-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>

Hi Andrei,

On Thursday 06 of November 2014 10:27:10 Andrei Emeltchenko wrote:
> From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> 
> For the old Android API use find_default_device() function.
> ---
>  android/handsfree.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/android/handsfree.c b/android/handsfree.c
> index 4d8dff4..98d1f56 100644
> --- a/android/handsfree.c
> +++ b/android/handsfree.c
> @@ -290,6 +290,11 @@ static bool match_by_bdaddr(const void *data, const void *match_data)
>  
>  static struct hf_device *find_device(const bdaddr_t *bdaddr)
>  {
> +	uint8_t zero_addr[6] = { 0 };
> +
> +	if (!memcmp(bdaddr, zero_addr, sizeof(zero_addr)))
> +		return find_default_device();
> +
>  	return queue_find(devices, match_by_bdaddr, bdaddr);
>  }

Please use bacmp and BDADDR_ANY here.

-- 
Best regards, 
Szymon Janc

  reply	other threads:[~2014-11-06 10:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-06  8:27 [PATCH] android/handsfree: Return default device for zero bdaddr Andrei Emeltchenko
2014-11-06 10:41 ` Szymon Janc [this message]
2014-11-06 12:45   ` [PATCHv2] " Andrei Emeltchenko
2014-11-06 12:57     ` Szymon Janc

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=4917512.kiFJOhNPJF@uw000953 \
    --to=szymon.janc@tieto.com \
    --cc=Andrei.Emeltchenko.news@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.