From 6b56b98fc32cb74df7d9b030dfedf941ff77ed0f Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 21 Nov 2020 09:26:11 -0800 Subject: [PATCH] Fixed is_BLE() return value --- src/hidapi/linux/hid.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/hidapi/linux/hid.c b/src/hidapi/linux/hid.c index 6a943348b..03828ff36 100644 --- a/src/hidapi/linux/hid.c +++ b/src/hidapi/linux/hid.c @@ -298,13 +298,13 @@ static int is_BLE(hid_device *dev) "hid", NULL); if (hid_dev) { - unsigned short dev_vid; - unsigned short dev_pid; - int bus_type; + unsigned short dev_vid = 0; + unsigned short dev_pid = 0; + int bus_type = 0; char *serial_number_utf8 = NULL; char *product_name_utf8 = NULL; - ret = parse_uevent_info( + parse_uevent_info( udev_device_get_sysattr_value(hid_dev, "uevent"), &bus_type, &dev_vid, @@ -845,6 +845,7 @@ int HID_API_EXPORT hid_get_feature_report(hid_device *dev, unsigned char *data, int res; /* It looks like HIDIOCGFEATURE() on Bluetooth LE devices doesn't return the report number */ + printf("HIDIOCGFEATURE\n"); if (dev->needs_ble_hack) { data[1] = data[0]; ++data;