Print error message if no HID device is connected when using hidapi

This commit is contained in:
MCUdude 2022-10-20 12:27:59 +02:00
parent 14446950df
commit 867d83c215
1 changed files with 4 additions and 2 deletions

View File

@ -93,8 +93,10 @@ static int usbhid_open(const char *port, union pinfo pinfo, union filedescriptor
*/ */
struct hid_device_info *list, *walk; struct hid_device_info *list, *walk;
list = hid_enumerate(pinfo.usbinfo.vid, pinfo.usbinfo.pid); list = hid_enumerate(pinfo.usbinfo.vid, pinfo.usbinfo.pid);
if (list == NULL) if (list == NULL) {
pmsg_error("No USB HID devices found\n");
return -1; return -1;
}
walk = list; walk = list;
while (walk) while (walk)