From b84eff92dfcb1feb1493ecb6fe48f9a7ff548934 Mon Sep 17 00:00:00 2001 From: Mariusz Skamra Date: Thu, 30 Apr 2015 13:26:18 +0200 Subject: [PATCH] android/gatt: Fix autoconnect This patch fixes autoconnect issue, however there is also race hazard in Android Gatt framework. If app uses autoconnect while connecting, direct flag is set to false. Then bt_gatt_add_autoconnect should be called to add this app's id to autoconnect_apps queue. --- android/gatt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/android/gatt.c b/android/gatt.c index 4da959fea..72a27ab78 100644 --- a/android/gatt.c +++ b/android/gatt.c @@ -1972,6 +1972,7 @@ static bool trigger_connection(struct app_connection *conn, bool direct) if (direct) return connect_le(conn->device) == 0; + bt_gatt_add_autoconnect(conn->app->id, &conn->device->bdaddr); return auto_connect_le(conn->device); case DEVICE_CONNECTED: notify_app_connect_status(conn, GATT_SUCCESS); -- 2.47.3