If there are no handles in a defined service, it is not useful to try to discover anything in it, just go to the next service. --- src/shared/gatt-client.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c index d0fc054..bfb9427 100644 --- a/src/shared/gatt-client.c +++ b/src/shared/gatt-client.c @@ -525,6 +525,9 @@ next: if (!gatt_db_attribute_get_service_handles(attr, &start, &end)) goto failed; + if (start == end) + goto next; + if (bt_gatt_discover_included_services(client->att, start, end, discover_incl_cb, discovery_op_ref(op), @@ -675,6 +678,9 @@ next: if (!gatt_db_attribute_get_service_handles(attr, &start, &end)) goto failed; + if (start == end) + goto next; + /* Move on to the next service */ op->cur_svc = attr; if (bt_gatt_discover_characteristics(client->att, start, end, @@ -776,6 +782,9 @@ next: if (!gatt_db_attribute_get_service_handles(attr, &start, &end)) goto failed; + if (start == end) + goto next; + /* Move on to the next service */ op->cur_svc = attr; if (bt_gatt_discover_characteristics(client->att, start, end, -- 2.2.0.rc0.207.ga3a616c -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html