Linux bluetooth development
 help / color / mirror / Atom feed
From: "Frédéric Dalleau" <frederic.dalleau@linux.intel.com>
To: linux-bluetooth@vger.kernel.org
Cc: "Frédéric Dalleau" <frederic.dalleau@linux.intel.com>
Subject: [PATCH v2 7/9] Fix invalid state at SCO disconnect in gateway
Date: Mon, 22 Aug 2011 17:30:45 +0200	[thread overview]
Message-ID: <1314027047-5476-8-git-send-email-frederic.dalleau@linux.intel.com> (raw)
In-Reply-To: <1314027047-5476-1-git-send-email-frederic.dalleau@linux.intel.com>

If SCO disconnects after RFCOMM, do not change state to connected.
---
 audio/gateway.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/audio/gateway.c b/audio/gateway.c
index c3c4019..d41bbc3 100644
--- a/audio/gateway.c
+++ b/audio/gateway.c
@@ -191,7 +191,9 @@ static gboolean sco_io_cb(GIOChannel *chan, GIOCondition cond,
 	g_io_channel_shutdown(gw->sco, TRUE, NULL);
 	g_io_channel_unref(gw->sco);
 	gw->sco = NULL;
-	change_state(dev, GATEWAY_STATE_CONNECTED);
+
+	if (gw->rfcomm)
+		change_state(dev, GATEWAY_STATE_CONNECTED);
 
 	return FALSE;
 }
-- 
1.7.1


  parent reply	other threads:[~2011-08-22 15:30 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-22 15:30 [PATCH v2 0/9] Add support for HandsfreeGateway to Media Frédéric Dalleau
2011-08-22 15:30 ` [PATCH v2 1/9] Fix double free in error case in endpoint_reply Frédéric Dalleau
2011-08-24 10:48   ` Luiz Augusto von Dentz
2011-08-22 15:30 ` [PATCH v2 2/9] Add state change callback to HandsfreeGateway Frédéric Dalleau
2011-08-24 10:51   ` Luiz Augusto von Dentz
2011-08-22 15:30 ` [PATCH v2 3/9] Use state change callback from media interface Frédéric Dalleau
2011-08-24 10:53   ` Luiz Augusto von Dentz
2011-08-22 15:30 ` [PATCH v2 4/9] Update g_strcmp0 to strcasecmp Frédéric Dalleau
2011-08-24 10:53   ` Luiz Augusto von Dentz
2011-08-22 15:30 ` [PATCH v2 5/9] Fix RFCOMM disconnect on suspend request Frédéric Dalleau
2011-08-24 10:54   ` Luiz Augusto von Dentz
2011-08-22 15:30 ` [PATCH v2 6/9] Set state to "connecting" when AG connects Frédéric Dalleau
2011-08-24 10:54   ` Luiz Augusto von Dentz
2011-08-22 15:30 ` Frédéric Dalleau [this message]
2011-08-24 10:57   ` [PATCH v2 7/9] Fix invalid state at SCO disconnect in gateway Luiz Augusto von Dentz
2011-08-22 15:30 ` [PATCH v2 8/9] Introduce gateway locking mechanism Frédéric Dalleau
2011-08-24 10:55   ` Luiz Augusto von Dentz
2011-08-22 15:30 ` [PATCH v2 9/9] Implement media_transport for HFP_HS_UUID Frédéric Dalleau
2011-08-24 10:59   ` Luiz Augusto von Dentz
2011-08-24 11:24 ` [PATCH v2 0/9] Add support for HandsfreeGateway to Media Johan Hedberg
2011-08-24 12:06   ` Dalleau, Frederic

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=1314027047-5476-8-git-send-email-frederic.dalleau@linux.intel.com \
    --to=frederic.dalleau@linux.intel.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