linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miroslav Koskar <mk@mkoskar.com>
To: linux-bluetooth <linux-bluetooth@vger.kernel.org>
Subject: [PATCH] core/service: Allow disconnected -> connected state change
Date: Fri, 10 Jun 2016 15:21:39 +0200	[thread overview]
Message-ID: <20160610132139.GA2514@mkoskar.com> (raw)

By ignoring case where service->state == BTD_SERVICE_STATE_DISCONNECTED
in btd_service_connecting_complete(), state_callbacks don't get
executed. Such case occurs when e.g., phone using a2dp-source profile
connects to the bluez. Because no state_callbacks are executed
(including one added by policy plugin) no reconnection is attempted
after connection timeout, although if situation is reversed (bluez
connects to the phone) reconnection works.
---
 src/service.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/service.c b/src/service.c
index f7912f5..0da14ab 100644
--- a/src/service.c
+++ b/src/service.c
@@ -353,7 +353,8 @@ bool btd_service_remove_state_cb(unsigned int id)
 
 void btd_service_connecting_complete(struct btd_service *service, int err)
 {
-	if (service->state != BTD_SERVICE_STATE_CONNECTING)
+	if (service->state != BTD_SERVICE_STATE_DISCONNECTED &&
+			service->state != BTD_SERVICE_STATE_CONNECTING)
 		return;
 
 	if (err == 0)


             reply	other threads:[~2016-06-10 13:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-10 13:21 Miroslav Koskar [this message]
2016-06-13  9:11 ` [PATCH] core/service: Allow disconnected -> connected state change 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=20160610132139.GA2514@mkoskar.com \
    --to=mk@mkoskar.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).