Diff between 5d530ffca654e8f550d4071b6ca71b1e493fa8ee and 9f054de38fb32de0c842da1f4b3e7226fc311e02

Changed Files

File Additions Deletions Status
profiles/input/hog_device.c +6 -3 modified

Full Patch

diff --git a/profiles/input/hog_device.c b/profiles/input/hog_device.c
index b8a58bc..c7b5bcb 100644
--- a/profiles/input/hog_device.c
+++ b/profiles/input/hog_device.c
@@ -537,12 +537,15 @@ static void attio_connected_cb(GAttrib *attrib, gpointer user_data)
 
 	hogdev->attrib = g_attrib_ref(attrib);
 
-	gatt_discover_char(hogdev->attrib, prim->range.start, prim->range.end,
-					NULL, char_discovered_cb, hogdev);
-
 	hogdev->report_cb_id = g_attrib_register(hogdev->attrib,
 					ATT_OP_HANDLE_NOTIFY, report_value_cb,
 					hogdev, NULL);
+
+	if (hogdev->reports == NULL) {
+		gatt_discover_char(hogdev->attrib, prim->range.start,
+						prim->range.end, NULL,
+						char_discovered_cb, hogdev);
+	}
 }
 
 static void attio_disconnected_cb(gpointer user_data)