Skip to contentSkip to conversation

core/service: Fix failing to connect external profile

PATCH In review Luiz Augusto von Dentz 2 participants 3 messages Oct 30, 2015 – Nov 2, 2015 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 core/service: Fix failing to connect external profile

From: Luiz Augusto von Dentz <[email protected]>

When initiating a connection to a external profile btd_service_connect will be called which will change the service state to BTD_SERVICE_STATE_CONNECTING but then once the connection completes service_accept is called but since it now checks the state it would return -EALREADY to prevent driver accept to be called more than once.

---
 src/service.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/service.c +1 -1
index 2ed72fb..7da922c 100644
@@ -191,7 +191,7 @@ int service_accept(struct btd_service *service)
 		break;
 	case BTD_SERVICE_STATE_CONNECTING:
 	case BTD_SERVICE_STATE_CONNECTED:
-		return -EALREADY;
+		return 0;
 	case BTD_SERVICE_STATE_DISCONNECTING:
 		return -EBUSY;
 	}
Signature · 1 line
2.4.3
#1 lore raw

Luiz,

Quoted 18 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

When initiating a connection to a external profile btd_service_connect
will be called which will change the service state to BTD_SERVICE_STATE_CONNECTING but then once the connection completes service_accept is called but since it now checks the state it would return -EALREADY to prevent driver accept to be called more than once.

---
 src/service.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/service.c +0 -0
index 2ed72fb..7da922c 100644

src/service.c int service_accept(struct btd_service *service) · line 197

Quoted 8 lines
src/service.c +1 -1
@@ -191,7 +191,7 @@ int service_accept(struct btd_service *service)
 		break;
 	case BTD_SERVICE_STATE_CONNECTING:
 	case BTD_SERVICE_STATE_CONNECTED:
-		return -EALREADY;
+		return 0;
 	case BTD_SERVICE_STATE_DISCONNECTING:
 		return -EBUSY;
 	}

This patch solves my hfp headset connect problem.

Thanks,

Steve

author maintainer Applied
#2 lore raw

Hi,

Quoted 32 lines · Steve Brown

Luiz,

Quoted 18 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

When initiating a connection to a external profile btd_service_connect
will be called which will change the service state to BTD_SERVICE_STATE_CONNECTING but then once the connection completes service_accept is called but since it now checks the state it would return -EALREADY to prevent driver accept to be called more than once.

---
 src/service.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/service.c +0 -0
index 2ed72fb..7da922c 100644

src/service.c int service_accept(struct btd_service *service) · line 197

Quoted 8 lines
src/service.c +1 -1
@@ -191,7 +191,7 @@ int service_accept(struct btd_service *service)
              break;
      case BTD_SERVICE_STATE_CONNECTING:
      case BTD_SERVICE_STATE_CONNECTED:
-             return -EALREADY;
+             return 0;
      case BTD_SERVICE_STATE_DISCONNECTING:
              return -EBUSY;
      }

This patch solves my hfp headset connect problem.

Quoted 3 lines

Thanks,

Steve

Applied.

Signature · 1 line
Luiz Augusto von Dentz