Linux bluetooth development
 help / color / mirror / Atom feed
From: Szymon Janc <szymon.janc@tieto.com>
To: Lukasz Rymanowski <lukasz.rymanowski@tieto.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 1/2] android: Fix type of discovery on start/stop discovery
Date: Sun, 09 Mar 2014 15:09:01 +0100	[thread overview]
Message-ID: <1414663.aca6WzpM4q@leonov> (raw)
In-Reply-To: <1394188110-16336-1-git-send-email-lukasz.rymanowski@tieto.com>

Hi Łukasz,

On Friday 07 of March 2014 11:28:29 Lukasz Rymanowski wrote:
> Discovering type was confused with adapter settings. With this patch it
> is fixed
> ---
>  android/bluetooth.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/android/bluetooth.c b/android/bluetooth.c
> index 1101b64..6d08a50 100644
> --- a/android/bluetooth.c
> +++ b/android/bluetooth.c
> @@ -2408,14 +2408,13 @@ static void get_adapter_properties(void)
>  static bool start_discovery(void)
>  {
>  	struct mgmt_cp_start_discovery cp;
> -	uint8_t type = 1 << BDADDR_BREDR;
> 
> -	if (adapter.current_settings & type)
> -		cp.type = type;
> +	if (adapter.current_settings & MGMT_SETTING_BREDR)
> +		cp.type = 1 << BDADDR_BREDR;
>  	else
>  		cp.type = 0;
> 
> -	DBG("type=0x%x", type);
> +	DBG("type=0x%x", cp.type);
> 
>  	if (mgmt_send(mgmt_if, MGMT_OP_START_DISCOVERY, adapter.index,
>  					sizeof(cp), &cp, NULL, NULL, NULL) > 0)
> @@ -2428,14 +2427,13 @@ static bool start_discovery(void)
>  static bool stop_discovery(void)
>  {
>  	struct mgmt_cp_stop_discovery cp;
> -	uint8_t type = 1 << BDADDR_BREDR;
> 
> -	if (adapter.current_settings & type)
> -		cp.type = type;
> +	if (adapter.current_settings & MGMT_SETTING_BREDR)
> +		cp.type = 1 << BDADDR_BREDR;
>  	else
>  		cp.type = 0;
> 
> -	DBG("type=0x%x", type);
> +	DBG("type=0x%x", cp.type);
> 
>  	if (mgmt_send(mgmt_if, MGMT_OP_STOP_DISCOVERY, adapter.index,
>  					sizeof(cp), &cp, NULL, NULL, NULL) > 0)

Both patches applied. Thanks.

-- 
BR
Szymon Janc

      parent reply	other threads:[~2014-03-09 14:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-07 10:28 [PATCH 1/2] android: Fix type of discovery on start/stop discovery Lukasz Rymanowski
2014-03-07 10:28 ` [PATCH 2/2] android: Support LE discovery if adapter supports LE Lukasz Rymanowski
2014-03-09 14:09 ` 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=1414663.aca6WzpM4q@leonov \
    --to=szymon.janc@tieto.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=lukasz.rymanowski@tieto.com \
    /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