linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jaganath Kanakkassery <jaganath.k@samsung.com>
To: linux-bluetooth@vger.kernel.org
Cc: Jaganath Kanakkassery <jaganath.k@samsung.com>
Subject: [PATCH BlueZ v1] audio: Reset hfp and hs handle before connection
Date: Wed, 02 May 2012 17:06:30 +0530	[thread overview]
Message-ID: <1335958590-9249-1-git-send-email-jaganath.k@samsung.com> (raw)

When bluez initiates headset connection  hfp and hs handle is saved
each time when initiating connection. So at some point if hf service
is removed in remote headset then bluez connects to hs service. But
because of previously stored hfp handle bluez thinks that connection
made to hs service is hfp connection and waits for at commands.
Eventually bluez connection state will be incorrectly set.
---
 audio/headset.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/audio/headset.c b/audio/headset.c
index f15951d..fb10c36 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -1464,9 +1464,11 @@ static int headset_set_channel(struct headset *headset,
 
 	if (svc == HANDSFREE_SVCLASS_ID) {
 		headset->hfp_handle = record->handle;
+		headset->hsp_handle = 0;
 		DBG("Discovered Handsfree service on channel %d", ch);
 	} else {
 		headset->hsp_handle = record->handle;
+		headset->hfp_handle = 0;
 		DBG("Discovered Headset service on channel %d", ch);
 	}
 
-- 
1.7.1


             reply	other threads:[~2012-05-02 11:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-02 11:36 Jaganath Kanakkassery [this message]
2012-05-02 11:41 ` [PATCH BlueZ v1] audio: Reset hfp and hs handle before connection Johan Hedberg

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=1335958590-9249-1-git-send-email-jaganath.k@samsung.com \
    --to=jaganath.k@samsung.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;
as well as URLs for NNTP newsgroup(s).