linux-bluetooth.vger.kernel.org archive mirror
 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 7/7] android/handsfree-client: Handle disconnect command
Date: Fri, 07 Nov 2014 20:56:14 +0100	[thread overview]
Message-ID: <1800542.EtE6XzkJ2e@leonov> (raw)
In-Reply-To: <1415186531-23288-8-git-send-email-lukasz.rymanowski@tieto.com>

Hi Łukasz,

On Wednesday 05 of November 2014 12:22:11 Lukasz Rymanowski wrote:
> ---
>  android/handsfree-client.c | 27 +++++++++++++++++++++++++--
>  1 file changed, 25 insertions(+), 2 deletions(-)
> 
> diff --git a/android/handsfree-client.c b/android/handsfree-client.c
> index d90cef0..751a9f1 100644
> --- a/android/handsfree-client.c
> +++ b/android/handsfree-client.c
> @@ -195,9 +195,32 @@ static struct device *get_device(const bdaddr_t *addr)
> 
>  static void handle_disconnect(const void *buf, uint16_t len)
>  {
> -	DBG("Not Implemented");
> +	const struct hal_cmd_hf_client_disconnect *cmd = buf;
> +	struct device *dev;
> +	uint32_t status;
> +	bdaddr_t bdaddr;
> +	char addr[18];
> +
> +	DBG("");
> +
> +	android2bdaddr(&cmd->bdaddr, &bdaddr);
> +
> +	ba2str(&bdaddr, addr);
> +	DBG("Disconnect %s", addr);
> +
> +	dev = get_device(&bdaddr);
> +	if (!dev) {
> +		status = HAL_STATUS_FAILED;
> +		goto done;
> +	}
> +
> +	status = hfp_hf_disconnect(dev->hf) ? HAL_STATUS_SUCCESS :
> +							HAL_STATUS_FAILED;

Shouldn't 'connecting' and 'disconnecting' state be handled here?

> +
> +done:
> +
>  	ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HANDSFREE_CLIENT,
> -			HAL_OP_HF_CLIENT_DISCONNECT, HAL_STATUS_UNSUPPORTED);
> +			HAL_OP_HF_CLIENT_DISCONNECT, status);
>  }
> 
>  static void handle_connect_audio(const void *buf, uint16_t len)

-- 
BR
Szymon Janc

      reply	other threads:[~2014-11-07 19:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-05 11:22 [PATCH 0/7] android/handsfree-client: First set of HFP HF Lukasz Rymanowski
2014-11-05 11:22 ` [PATCH 1/7] android/handsfree-client: Typo fix in define name Lukasz Rymanowski
2014-11-05 11:22 ` [PATCH 2/7] android/handsfree-client: Add service record Lukasz Rymanowski
2014-11-05 11:22 ` [PATCH 3/7] android/handsfree-client: Add devices queue Lukasz Rymanowski
2014-11-05 11:22 ` [PATCH 4/7] android/handsfree-client: Add incoming connection handling Lukasz Rymanowski
2014-11-07 19:00   ` Szymon Janc
2014-11-08 20:59     ` Lukasz Rymanowski
2014-11-08 23:05       ` Lukasz Rymanowski
2014-11-05 11:22 ` [PATCH 5/7] android/handsfree-client: Add SLC creation procedure Lukasz Rymanowski
2014-11-07 19:36   ` Szymon Janc
2014-11-05 11:22 ` [PATCH 6/7] android/handsfree-client: Add support for outgoing connection Lukasz Rymanowski
2014-11-07 19:50   ` Szymon Janc
2014-11-05 11:22 ` [PATCH 7/7] android/handsfree-client: Handle disconnect command Lukasz Rymanowski
2014-11-07 19:56   ` 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=1800542.EtE6XzkJ2e@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;
as well as URLs for NNTP newsgroup(s).