* [PATCH BlueZ] audio: Reset hfp and hs handle before connection
@ 2012-05-02 10:11 Jaganath Kanakkassery
2012-05-02 10:43 ` Johan Hedberg
0 siblings, 1 reply; 3+ messages in thread
From: Jaganath Kanakkassery @ 2012-05-02 10:11 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Jaganath Kanakkassery
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 04b26a9..27367d7 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -1462,6 +1462,8 @@ static int headset_set_channel(struct headset *headset,
}
headset->rfcomm_ch = ch;
+ headset->hfp_handle = 0;
+ headset->hsp_handle = 0;
if (svc == HANDSFREE_SVCLASS_ID) {
headset->hfp_handle = record->handle;
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH BlueZ] audio: Reset hfp and hs handle before connection
2012-05-02 10:11 [PATCH BlueZ] audio: Reset hfp and hs handle before connection Jaganath Kanakkassery
@ 2012-05-02 10:43 ` Johan Hedberg
2012-05-02 10:56 ` Jaganath
0 siblings, 1 reply; 3+ messages in thread
From: Johan Hedberg @ 2012-05-02 10:43 UTC (permalink / raw)
To: Jaganath Kanakkassery; +Cc: linux-bluetooth
Hi Jaganath,
On Wed, May 02, 2012, Jaganath Kanakkassery wrote:
> 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 04b26a9..27367d7 100644
> --- a/audio/headset.c
> +++ b/audio/headset.c
> @@ -1462,6 +1462,8 @@ static int headset_set_channel(struct headset *headset,
> }
>
> headset->rfcomm_ch = ch;
> + headset->hfp_handle = 0;
> + headset->hsp_handle = 0;
>
> if (svc == HANDSFREE_SVCLASS_ID) {
> headset->hfp_handle = record->handle;
I'd instead prefer something like the following:
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);
}
Would that be ok?
Johan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH BlueZ] audio: Reset hfp and hs handle before connection
2012-05-02 10:43 ` Johan Hedberg
@ 2012-05-02 10:56 ` Jaganath
0 siblings, 0 replies; 3+ messages in thread
From: Jaganath @ 2012-05-02 10:56 UTC (permalink / raw)
To: Johan Hedberg; +Cc: linux-bluetooth
Hi Johan,
--------------------------------------------------
From: "Johan Hedberg" <johan.hedberg@gmail.com>
Sent: Wednesday, May 02, 2012 4:13 PM
To: "Jaganath Kanakkassery" <jaganath.k@samsung.com>
Cc: <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH BlueZ] audio: Reset hfp and hs handle before connection
> Hi Jaganath,
>
> On Wed, May 02, 2012, Jaganath Kanakkassery wrote:
>> 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 04b26a9..27367d7 100644
>> --- a/audio/headset.c
>> +++ b/audio/headset.c
>> @@ -1462,6 +1462,8 @@ static int headset_set_channel(struct headset
>> *headset,
>> }
>>
>> headset->rfcomm_ch = ch;
>> + headset->hfp_handle = 0;
>> + headset->hsp_handle = 0;
>>
>> if (svc == HANDSFREE_SVCLASS_ID) {
>> headset->hfp_handle = record->handle;
>
> I'd instead prefer something like the following:
>
> 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);
> }
>
> Would that be ok?
Yes that is Ok. I will raise the new patch.
Thanks,
Jaganath
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-05-02 10:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-02 10:11 [PATCH BlueZ] audio: Reset hfp and hs handle before connection Jaganath Kanakkassery
2012-05-02 10:43 ` Johan Hedberg
2012-05-02 10:56 ` Jaganath
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox