From 89dab07b096ec5c46d18d44bb803b21014ce415e Mon Sep 17 00:00:00 2001 From: Lukasz Rymanowski Date: Wed, 30 Apr 2014 11:13:42 +0200 Subject: [PATCH] android/gatt: Assume that each server wants to wait for connection Make sure that application gets all server related callbacks from incoming connection we need to keep it on listen_app list. --- android/gatt.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/android/gatt.c b/android/gatt.c index a31d01a2c..e2f11d385 100644 --- a/android/gatt.c +++ b/android/gatt.c @@ -575,6 +575,13 @@ static int register_app(const uint8_t *uuid, gatt_app_type_t app_type) return 0; } + if ((app->type == APP_SERVER) && + !queue_push_tail(listen_apps, INT_TO_PTR(app->id))) { + error("gatt: Cannot push server on the list"); + destroy_gatt_app(app); + return 0; + } + return app->id; } -- 2.47.3