Skip to contentSkip to conversation

hog: Use HoG device name as uHID input device name

PATCH Superseded Petri Gynther 1 participant 1 message Jan 30, 2014 Bluetooth drivers

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 hog: Use HoG device name as uHID input device name

If HoG BLE device name is known, use it when creating uHID input device. Pass BLE device address to uHID as well.

---
 profiles/input/hog.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
profiles/input/hog.c +7 -1
index ded6303..7ad184a 100644
@@ -392,7 +392,13 @@ static void report_map_read_cb(guint8 status, const guint8 *pdu, guint16 plen,
 	/* create uHID device */
 	memset(&ev, 0, sizeof(ev));
 	ev.type = UHID_CREATE;
-	strcpy((char *) ev.u.create.name, "bluez-hog-device");
+	if (device_name_known(hogdev->device)) {
+		device_get_name(hogdev->device, (char *) ev.u.create.name,
+				sizeof(ev.u.create.name) - 1);
+	} else {
+		strcpy((char *) ev.u.create.name, "bluez-hog-device");
+	}
+	ba2str(device_get_address(hogdev->device), (char *) ev.u.create.phys);
 	ev.u.create.vendor = vendor;
 	ev.u.create.product = product;
 	ev.u.create.version = version;
Signature · 1 line
1.8.5.3