From 8438cd5c0da459a2daf6a7899a7fbe0c1bafba22 Mon Sep 17 00:00:00 2001 From: Olivier Martin Date: Sun, 7 Jul 2019 12:46:15 +0200 Subject: [PATCH] dbus: Check if the Services are really resolved --- dbus/gattlib.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dbus/gattlib.c b/dbus/gattlib.c index e5cb162..91d704f 100644 --- a/dbus/gattlib.c +++ b/dbus/gattlib.c @@ -288,11 +288,13 @@ gboolean on_handle_device_property_change( } } } else if (strcmp(key, "ServicesResolved") == 0) { - // Stop the timeout for connection - g_source_remove(conn_context->connection_timeout); + if (g_variant_get_boolean(value)) { + // Stop the timeout for connection + g_source_remove(conn_context->connection_timeout); - // Tell we are now connected - g_main_loop_quit(conn_context->connection_loop); + // Tell we are now connected + g_main_loop_quit(conn_context->connection_loop); + } } } }