Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] core/service: Allow disconnected -> connected state change
@ 2016-06-10 13:21 Miroslav Koskar
  2016-06-13  9:11 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Miroslav Koskar @ 2016-06-10 13:21 UTC (permalink / raw)
  To: linux-bluetooth

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)


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-13  9:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-10 13:21 [PATCH] core/service: Allow disconnected -> connected state change Miroslav Koskar
2016-06-13  9:11 ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox