Diff between 2f2ea9613515dc90b75d32f6955dbf9d18876fde and 8cdbd3b09f29da29374e2f83369df24228da0ad1

Changed Files

File Additions Deletions Status
profiles/input/hog.c +4 -0 modified

Full Patch

diff --git a/profiles/input/hog.c b/profiles/input/hog.c
index 83c017d..dfac689 100644
--- a/profiles/input/hog.c
+++ b/profiles/input/hog.c
@@ -186,6 +186,10 @@ static int hog_accept(struct btd_service *service)
 			return -EINVAL;
 	}
 
+	/* HOGP 1.0 Section 6.1 requires bonding */
+	if (!device_is_bonded(device, btd_device_get_bdaddr_type(device)))
+		return -ECONNREFUSED;
+
 	/* TODO: Replace GAttrib with bt_gatt_client */
 	bt_hog_attach(dev->hog, attrib);