From 3479664a284b7205a265587cfb30f582d95aa3b9 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 29 Jul 2015 10:38:31 +0300 Subject: [PATCH] shared/gatt-client: Fix error when no service could be found In case the remote device has no services available ready callback would be called with success set to false but in fact it has succeeded it just did not find anything. --- src/shared/gatt-client.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c index 24aef187e..903afa760 100644 --- a/src/shared/gatt-client.c +++ b/src/shared/gatt-client.c @@ -971,6 +971,11 @@ static void discover_primary_cb(bool success, uint8_t att_ecode, util_debug(client->debug_callback, client->debug_data, "Primary service discovery failed." " ATT ECODE: 0x%02x", att_ecode); + /* Reset error in case of not found */ + if (BT_ATT_ERROR_ATTRIBUTE_NOT_FOUND) { + success = true; + att_ecode = 0; + } goto secondary; } -- 2.47.3