From 155158a2ed418f7d3d700cd5d6145443c37f9c7e Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Apr 2021 15:34:18 -0700 Subject: [PATCH] input/hog-lib: avoid scanning characteristics too early We need to have active connection to fully discover a HOG instance, and in the chain bt_hog_new()-> gatt_db_foreach_service()-> foreach_hog_service()-> hog_attach_instance() we have not set up hog->attrib yet. So let's skip calling foreach_hog_chrc() from hog_attach_instance(), especially since we will be calling bt_hog_attach() pretty much immediately after bt_hog_new(), and we will be discovering characteristics there anyway. Signed-off-by: Anuj Jain Signed-off-by: Ayush Garg --- profiles/input/hog-lib.c | 1 - 1 file changed, 1 deletion(-) diff --git a/profiles/input/hog-lib.c b/profiles/input/hog-lib.c index 0f83135..ecd15ad 100755 --- a/profiles/input/hog-lib.c +++ b/profiles/input/hog-lib.c @@ -1458,7 +1458,6 @@ static void hog_attach_instance(struct bt_hog *hog, if (!hog->attr) { hog->attr = attr; - gatt_db_service_foreach_char(hog->attr, foreach_hog_chrc, hog); return; } -- 2.7.4