fix: fix get hid device interface number is always 0 on macos 13.3 #530

Closed
pengxianheng-nreal wants to merge 1 commit from mac13.3 into master
pengxianheng-nreal commented 2023-04-13 01:00:56 -05:00 (Migrated from github.com)

fix get hid device interface number is always 0 on macos 13.3

fix get hid device interface number is always 0 on macos 13.3
Youw (Migrated from github.com) reviewed 2023-04-13 05:00:48 -05:00
@ -552,6 +552,36 @@ static struct hid_device_info *create_device_info_with_usage(IOHIDDeviceRef dev,
cur_dev->interface_number = -1;
}
if (cur_dev->interface_number == -1 || cur_dev->interface_number == 0) {
Youw (Migrated from github.com) commented 2023-04-13 05:00:48 -05:00

cur_dev->interface_number == 0 is a valid interface number
it doesn't look right to consider it for a fallback

`cur_dev->interface_number == 0` is a valid interface number it doesn't look right to consider it for a fallback
Youw (Migrated from github.com) reviewed 2023-04-13 05:01:11 -05:00
@ -555,0 +563,4 @@
if (res == KERN_SUCCESS)
temp_dev_path = strdup(temp_dev_path_str);
else
temp_dev_path = strdup("");
Youw (Migrated from github.com) commented 2023-04-13 05:01:11 -05:00

temp_dev_path never released - that's a resourse leak

`temp_dev_path` never released - that's a resourse leak
Youw (Migrated from github.com) reviewed 2023-04-13 05:02:15 -05:00
@ -555,0 +567,4 @@
}
if (temp_dev_path) {
const char* match_prefix_string = "Interface@";
Youw (Migrated from github.com) commented 2023-04-13 05:02:15 -05:00

no documentation guarantees that the interface number is going to be a part of the Path

no documentation guarantees that the interface number is going to be a part of the Path
Youw (Migrated from github.com) reviewed 2023-04-13 05:02:53 -05:00
Youw (Migrated from github.com) left a comment

even if it is functional - this is a workaround
I'd want to search for a better solution

even if it is functional - this is a workaround I'd want to search for a better solution
pengxianheng-nreal (Migrated from github.com) reviewed 2023-04-13 05:07:58 -05:00
@ -552,6 +552,36 @@ static struct hid_device_info *create_device_info_with_usage(IOHIDDeviceRef dev,
cur_dev->interface_number = -1;
}
if (cur_dev->interface_number == -1 || cur_dev->interface_number == 0) {
pengxianheng-nreal (Migrated from github.com) commented 2023-04-13 05:07:58 -05:00

I cause this problem: my device interface number is not 0. but the old code return 0 on macos 13.3. on macos13.2,the old code works fine(not 0) . so 0 may not be valid!

I cause this problem: my device interface number is not 0. but the old code return 0 on macos 13.3. on macos13.2,the old code works fine(not 0) . so 0 may not be valid!
Youw (Migrated from github.com) reviewed 2023-04-13 05:17:22 -05:00
@ -552,6 +552,36 @@ static struct hid_device_info *create_device_info_with_usage(IOHIDDeviceRef dev,
cur_dev->interface_number = -1;
}
if (cur_dev->interface_number == -1 || cur_dev->interface_number == 0) {
Youw (Migrated from github.com) commented 2023-04-13 05:17:21 -05:00

maybe it is not vaid in your case, but generally the 0 is a valid interface number
maybe we need to change the get_int_property(dev, CFSTR(kUSBInterfaceNumber)); part to return -1 in case of failure

maybe it is not vaid in your case, but generally the `0` is a valid interface number maybe we need to change the `get_int_property(dev, CFSTR(kUSBInterfaceNumber));` part to return `-1` in case of failure
pengxianheng-nreal (Migrated from github.com) reviewed 2023-04-13 06:15:03 -05:00
@ -555,0 +563,4 @@
if (res == KERN_SUCCESS)
temp_dev_path = strdup(temp_dev_path_str);
else
temp_dev_path = strdup("");
pengxianheng-nreal (Migrated from github.com) commented 2023-04-13 06:15:03 -05:00

OK,My mistake

OK,My mistake
pengxianheng-nreal (Migrated from github.com) reviewed 2023-04-13 06:29:51 -05:00
@ -555,0 +567,4 @@
}
if (temp_dev_path) {
const char* match_prefix_string = "Interface@";
pengxianheng-nreal (Migrated from github.com) commented 2023-04-13 06:29:50 -05:00

https://github.com/libusb/hidapi/discussions/527. The author of this discussion is my workmate. Now we have no other good solution to solve this problem except this one.

https://github.com/libusb/hidapi/discussions/527. The author of this discussion is my workmate. Now we have no other good solution to solve this problem except this one.
Youw (Migrated from github.com) reviewed 2023-04-13 06:38:30 -05:00
@ -555,0 +567,4 @@
}
if (temp_dev_path) {
const char* match_prefix_string = "Interface@";
Youw (Migrated from github.com) commented 2023-04-13 06:38:30 -05:00

we have no other good solution

let me investigate this
there is always a solution to find a corresponding USB/device interface having the Location ID - that one is guaranteed to match

> we have no other good solution let me investigate this there is always a solution to find a corresponding USB/device interface ~~having the Location ID - that one is guaranteed to match~~
mcuee commented 2023-04-15 01:31:55 -05:00 (Migrated from github.com)

even if it is functional - this is a workaround I'd want to search for a better solution

I agree with this one.

> even if it is functional - this is a workaround I'd want to search for a better solution I agree with this one.
imaami (Migrated from github.com) reviewed 2023-04-19 04:27:07 -05:00
imaami (Migrated from github.com) left a comment

Left a few comments and some draft code in them.

Left a few comments and some draft code in them.
@ -552,6 +552,36 @@ static struct hid_device_info *create_device_info_with_usage(IOHIDDeviceRef dev,
cur_dev->interface_number = -1;
}
if (cur_dev->interface_number == -1 || cur_dev->interface_number == 0) {
imaami (Migrated from github.com) commented 2023-04-19 02:49:39 -05:00

The indentation of the entire block is wrong. The commit indents with 4 spaces while the rest of the file indents with tabs.

The indentation of the entire block is wrong. The commit indents with 4 spaces while the rest of the file indents with tabs.
imaami (Migrated from github.com) commented 2023-04-19 03:43:05 -05:00

Everything in the taken branch is actually dependent on iokit_dev != MACH_PORT_NULL so it should be evaluated in the outermost conditional. Currently if iokit_dev is null the code enters the branch just to look at a char pointer that is guaranteed to be NULL anyway. So why not:

	if (iokit_dev != MACH_PORT_NULL &&
	    (cur_dev->interface_number == -1 || cur_dev->interface_number == 0)) {
Everything in the taken branch is actually dependent on `iokit_dev != MACH_PORT_NULL` so it should be evaluated in the outermost conditional. Currently if `iokit_dev` is null the code enters the branch just to look at a char pointer that is guaranteed to be `NULL` anyway. So why not: ``` if (iokit_dev != MACH_PORT_NULL && (cur_dev->interface_number == -1 || cur_dev->interface_number == 0)) { ```
@ -555,0 +556,4 @@
int old_interface_number = cur_dev->interface_number;
//try to Fallback to older interface number find rules
io_string_t temp_dev_path_str;
char* temp_dev_path = NULL;
imaami (Migrated from github.com) commented 2023-04-19 03:51:53 -05:00

The char *temp_dev_path variable is not needed. Allocating a new string with strdup(temp_dev_path_str) is unnecessary, and strdup("") doubly so. io_string_t temp_dev_path_str alone is sufficient as it's an alias of char[512] and can be passed to strstr().

With this in mind the only conditional you need to evaluate is res == KERN_SUCCESS, and the program flow remains identical.

	if (iokit_dev != MACH_PORT_NULL &&
	    (cur_dev->interface_number == -1 || cur_dev->interface_number == 0)) {
		io_string_t temp_dev_path_str;
		temp_dev_path_str[0] = '\0';

		/* Fill in the path (IOService plane) */
		res = IORegistryEntryGetPath(iokit_dev, kIOServicePlane, temp_dev_path_str);
		if (res == KERN_SUCCESS) {
			char *interface_component = strstr(temp_dev_path_str,  // ...

The `char *temp_dev_path` variable is not needed. Allocating a new string with `strdup(temp_dev_path_str)` is unnecessary, and `strdup("")` doubly so. `io_string_t temp_dev_path_str` alone is sufficient as it's an alias of `char[512]` and can be passed to `strstr()`. With this in mind the only conditional you need to evaluate is `res == KERN_SUCCESS`, and the program flow remains identical. ``` if (iokit_dev != MACH_PORT_NULL && (cur_dev->interface_number == -1 || cur_dev->interface_number == 0)) { io_string_t temp_dev_path_str; temp_dev_path_str[0] = '\0'; /* Fill in the path (IOService plane) */ res = IORegistryEntryGetPath(iokit_dev, kIOServicePlane, temp_dev_path_str); if (res == KERN_SUCCESS) { char *interface_component = strstr(temp_dev_path_str, // ... ```
@ -555,0 +567,4 @@
}
if (temp_dev_path) {
const char* match_prefix_string = "Interface@";
imaami (Migrated from github.com) commented 2023-04-19 04:01:55 -05:00

A string literal would do just fine here.

A string literal would do just fine here.
@ -555,0 +568,4 @@
if (temp_dev_path) {
const char* match_prefix_string = "Interface@";
char* interface_component = strstr(temp_dev_path, match_prefix_string);
imaami (Migrated from github.com) commented 2023-04-19 04:05:05 -05:00
			char *interface_component = strstr(temp_dev_path_str, "Interface@");
``` char *interface_component = strstr(temp_dev_path_str, "Interface@"); ```
@ -555,0 +570,4 @@
const char* match_prefix_string = "Interface@";
char* interface_component = strstr(temp_dev_path, match_prefix_string);
if (interface_component) {
char* decimal_str = interface_component + strlen(match_prefix_string);
imaami (Migrated from github.com) commented 2023-04-19 04:20:13 -05:00

A string literal instead of a const char * would avoid potentially compiling in a runtime call to strlen(), as sizeof("...") - 1 is equal to strlen("...") but is guaranteed to be evaluated compile-time. Doing strlen(s) on a const char *s = "..." might get optimized away with some compiler flags, but it definitely won't always be.

Of course a string literal would have to be typed out twice, once for strstr() and then a second time for sizeof(). If you can stomach it you can define a temporary macro or two.

Because at this point I think I've written enough comment spam I'll just post an alternative to the whole code block, with a couple of additional minor tweaks in addition to the ones I've mentioned. Haven't compiled, no guarantees that it actually works. It just might.

	if (iokit_dev != MACH_PORT_NULL &&
	    (cur_dev->interface_number == -1 || cur_dev->interface_number == 0)) {
		io_string_t temp_dev_path_str;
		temp_dev_path_str[0] = '\0';

		/* Fill in the path (IOService plane) */
		res = IORegistryEntryGetPath(iokit_dev, kIOServicePlane, temp_dev_path_str);
		if (res == KERN_SUCCESS) {
			#define match_prefix_str "Interface@"
			#define match_prefix_len (sizeof(match_prefix_str) - 1)

			char *interface_component = strstr(temp_dev_path_str, match_prefix_str);
			if (interface_component) {
				char *decimal_str = interface_component + match_prefix_len;
				if (decimal_str[0]) {
					char *endptr = decimal_str;
					int interface_number = strtol(decimal_str, &endptr, 10);
					if (endptr != decimal_str) {
						/* Parsing succeeded, update the interface number. */
						cur_dev->interface_number = interface_number;
					}
				}
			}

			#undef match_prefix_len
			#undef match_prefix_str
		}
	}

A string literal instead of a `const char *` would avoid potentially compiling in a runtime call to `strlen()`, as `sizeof("...") - 1` is equal to `strlen("...")` but is guaranteed to be evaluated compile-time. Doing `strlen(s)` on a `const char *s = "..."` _might_ get optimized away with some compiler flags, but it definitely won't always be. Of course a string literal would have to be typed out twice, once for `strstr()` and then a second time for `sizeof()`. If you can stomach it you can define a temporary macro or two. Because at this point I think I've written enough comment spam I'll just post an alternative to the whole code block, with a couple of additional minor tweaks in addition to the ones I've mentioned. Haven't compiled, no guarantees that it actually works. It just might. ``` if (iokit_dev != MACH_PORT_NULL && (cur_dev->interface_number == -1 || cur_dev->interface_number == 0)) { io_string_t temp_dev_path_str; temp_dev_path_str[0] = '\0'; /* Fill in the path (IOService plane) */ res = IORegistryEntryGetPath(iokit_dev, kIOServicePlane, temp_dev_path_str); if (res == KERN_SUCCESS) { #define match_prefix_str "Interface@" #define match_prefix_len (sizeof(match_prefix_str) - 1) char *interface_component = strstr(temp_dev_path_str, match_prefix_str); if (interface_component) { char *decimal_str = interface_component + match_prefix_len; if (decimal_str[0]) { char *endptr = decimal_str; int interface_number = strtol(decimal_str, &endptr, 10); if (endptr != decimal_str) { /* Parsing succeeded, update the interface number. */ cur_dev->interface_number = interface_number; } } } #undef match_prefix_len #undef match_prefix_str } } ```
DanBurkhardt commented 2023-04-26 09:32:17 -05:00 (Migrated from github.com)

Just chiming in here that without a fix like this, this lib is totally broken on macOS 13.3^. The changes in this PR fixed the issue for me, and I suspect many others will have the same experience.

Just chiming in here that without a fix like this, this lib is totally broken on macOS 13.3^. The changes in this PR fixed the issue for me, and I suspect many others will have the same experience.
mcuee commented 2023-04-26 18:11:42 -05:00 (Migrated from github.com)

Just chiming in here that without a fix like this, this lib is totally broken on macOS 13.3^. The changes in this PR fixed the issue for me, and I suspect many others will have the same experience.

You may want to file a feedback to Apple as well using the link here: https://developer.apple.com/bug-reporting/. The more people send the feedbacks to Apple, it may get their attention faster and they may fix the issue faster.
Reference: https://github.com/libusb/hidapi/issues/531#issuecomment-1510034397

> Just chiming in here that without a fix like this, this lib is totally broken on macOS 13.3^. The changes in this PR fixed the issue for me, and I suspect many others will have the same experience. You may want to file a feedback to Apple as well using the link here: https://developer.apple.com/bug-reporting/. The more people send the feedbacks to Apple, it may get their attention faster and they may fix the issue faster. Reference: https://github.com/libusb/hidapi/issues/531#issuecomment-1510034397
imaami commented 2023-04-29 10:00:53 -05:00 (Migrated from github.com)

Since nothing has so far happened I forked this PR branch, rebased it onto current master, and added an improvement commit (for the most part the same one I pasted in the discussions here). I don't have access to a mac I could test it on, so if anyone wants to have a go please do:

https://github.com/imaami/hidapi/tree/mac13.3

Please notice this is still fundamentally the same fix, I have done nothing original except clean and simplify the implementation a little.

Since nothing has so far happened I forked this PR branch, rebased it onto current master, and added an improvement commit (for the most part the same one I pasted in the discussions here). I don't have access to a mac I could test it on, so if anyone wants to have a go please do: https://github.com/imaami/hidapi/tree/mac13.3 Please notice this is still fundamentally the same fix, I have done nothing original except clean and simplify the implementation a little.
Youw commented 2023-04-29 14:35:57 -05:00 (Migrated from github.com)

Thanks @imaami
Anyway, I'm still looking into a better solution.
Got my hands to upgrade my own mac pro to latest macOS (so I could reproduce it at least) and will look at it closer soon.

Thanks @imaami Anyway, I'm still looking into a better solution. Got my hands to upgrade my own mac pro to latest macOS (so I could reproduce it at least) and will look at it closer soon.
Youw commented 2023-04-29 15:49:19 -05:00 (Migrated from github.com)

As for the improvement, we will start with #534

As for the improvement, we will start with #534
mcuee commented 2023-04-29 21:23:28 -05:00 (Migrated from github.com)

@imaami

Yes your mod is working but as @Youw mentioned that this PR is not the right fix to go with.

mcuee@mcuees-Mac-mini hidapi_pr530_mod % ./hidtest/hidtest 
hidapi test/example tool. Compiled with hidapi version 0.14.0, runtime version 0.14.0.
Compile-time version matches runtime version of hidapi.

...
...
Device Found
  type: 046d 1000
  path: DevSrvsID:4294970699
  serial_number: 
  Manufacturer: Logitech
  Product:      LogiVirtualHIDDevice
  Release:      1
  Interface:    2
  Usage (page): 0x2 (0x1)
  Bus type: 0

  Report Descriptor: (69 bytes)
0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x85, 0x02, 0x09, 0x01, 
0xa1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x10, 0x15, 0x00, 
0x25, 0x01, 0x95, 0x10, 0x75, 0x01, 0x81, 0x02, 0x05, 0x01, 
0x16, 0x01, 0xf8, 0x26, 0xff, 0x07, 0x75, 0x0c, 0x95, 0x02, 
0x09, 0x30, 0x09, 0x31, 0x81, 0x06, 0x15, 0x81, 0x25, 0x7f, 
0x75, 0x08, 0x95, 0x01, 0x09, 0x38, 0x81, 0x06, 0x05, 0x0c, 
0x0a, 0x38, 0x02, 0x95, 0x01, 0x81, 0x06, 0xc0, 0xc0, 
Device Found
  type: 046d 1000
  path: DevSrvsID:4294970699
  serial_number: 
  Manufacturer: Logitech
  Product:      LogiVirtualHIDDevice
  Release:      1
  Interface:    2
  Usage (page): 0x1 (0x1)
  Bus type: 0

  Report Descriptor: (69 bytes)
0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x85, 0x02, 0x09, 0x01, 
0xa1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x10, 0x15, 0x00, 
0x25, 0x01, 0x95, 0x10, 0x75, 0x01, 0x81, 0x02, 0x05, 0x01, 
0x16, 0x01, 0xf8, 0x26, 0xff, 0x07, 0x75, 0x0c, 0x95, 0x02, 
0x09, 0x30, 0x09, 0x31, 0x81, 0x06, 0x15, 0x81, 0x25, 0x7f, 
0x75, 0x08, 0x95, 0x01, 0x09, 0x38, 0x81, 0x06, 0x05, 0x0c, 
0x0a, 0x38, 0x02, 0x95, 0x01, 0x81, 0x06, 0xc0, 0xc0, 
Device Found
  type: 046d c52b
  path: DevSrvsID:4294970675
  serial_number: 
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x1 (0xff00)
  Bus type: 1

  Report Descriptor: (98 bytes)
0x06, 0x00, 0xff, 0x09, 0x01, 0xa1, 0x01, 0x85, 0x10, 0x75, 
0x08, 0x95, 0x06, 0x15, 0x00, 0x26, 0xff, 0x00, 0x09, 0x01, 
0x81, 0x00, 0x09, 0x01, 0x91, 0x00, 0xc0, 0x06, 0x00, 0xff, 
0x09, 0x02, 0xa1, 0x01, 0x85, 0x11, 0x75, 0x08, 0x95, 0x13, 
0x15, 0x00, 0x26, 0xff, 0x00, 0x09, 0x02, 0x81, 0x00, 0x09, 
0x02, 0x91, 0x00, 0xc0, 0x06, 0x00, 0xff, 0x09, 0x04, 0xa1, 
0x01, 0x85, 0x20, 0x75, 0x08, 0x95, 0x0e, 0x15, 0x00, 0x26, 
0xff, 0x00, 0x09, 0x41, 0x81, 0x00, 0x09, 0x41, 0x91, 0x00, 
0x85, 0x21, 0x95, 0x1f, 0x15, 0x00, 0x26, 0xff, 0x00, 0x09, 
0x42, 0x81, 0x00, 0x09, 0x42, 0x91, 0x00, 0xc0, 
Device Found
  type: 046d c52b
  path: DevSrvsID:4294970675
  serial_number: 
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x2 (0xff00)
  Bus type: 1

  Report Descriptor: (98 bytes)
0x06, 0x00, 0xff, 0x09, 0x01, 0xa1, 0x01, 0x85, 0x10, 0x75, 
0x08, 0x95, 0x06, 0x15, 0x00, 0x26, 0xff, 0x00, 0x09, 0x01, 
0x81, 0x00, 0x09, 0x01, 0x91, 0x00, 0xc0, 0x06, 0x00, 0xff, 
0x09, 0x02, 0xa1, 0x01, 0x85, 0x11, 0x75, 0x08, 0x95, 0x13, 
0x15, 0x00, 0x26, 0xff, 0x00, 0x09, 0x02, 0x81, 0x00, 0x09, 
0x02, 0x91, 0x00, 0xc0, 0x06, 0x00, 0xff, 0x09, 0x04, 0xa1, 
0x01, 0x85, 0x20, 0x75, 0x08, 0x95, 0x0e, 0x15, 0x00, 0x26, 
0xff, 0x00, 0x09, 0x41, 0x81, 0x00, 0x09, 0x41, 0x91, 0x00, 
0x85, 0x21, 0x95, 0x1f, 0x15, 0x00, 0x26, 0xff, 0x00, 0x09, 
0x42, 0x81, 0x00, 0x09, 0x42, 0x91, 0x00, 0xc0, 
Device Found
  type: 046d c52b
  path: DevSrvsID:4294970675
  serial_number: 
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x4 (0xff00)
  Bus type: 1

  Report Descriptor: (98 bytes)
0x06, 0x00, 0xff, 0x09, 0x01, 0xa1, 0x01, 0x85, 0x10, 0x75, 
0x08, 0x95, 0x06, 0x15, 0x00, 0x26, 0xff, 0x00, 0x09, 0x01, 
0x81, 0x00, 0x09, 0x01, 0x91, 0x00, 0xc0, 0x06, 0x00, 0xff, 
0x09, 0x02, 0xa1, 0x01, 0x85, 0x11, 0x75, 0x08, 0x95, 0x13, 
0x15, 0x00, 0x26, 0xff, 0x00, 0x09, 0x02, 0x81, 0x00, 0x09, 
0x02, 0x91, 0x00, 0xc0, 0x06, 0x00, 0xff, 0x09, 0x04, 0xa1, 
0x01, 0x85, 0x20, 0x75, 0x08, 0x95, 0x0e, 0x15, 0x00, 0x26, 
0xff, 0x00, 0x09, 0x41, 0x81, 0x00, 0x09, 0x41, 0x91, 0x00, 
0x85, 0x21, 0x95, 0x1f, 0x15, 0x00, 0x26, 0xff, 0x00, 0x09, 
0x42, 0x81, 0x00, 0x09, 0x42, 0x91, 0x00, 0xc0, 
Device Found
  type: 046d c52b
  path: DevSrvsID:4294970673
  serial_number: 
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    1
  Usage (page): 0x2 (0x1)
  Bus type: 1

  Report Descriptor: (148 bytes)
0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x85, 0x02, 0x09, 0x01, 
0xa1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x10, 0x15, 0x00, 
0x25, 0x01, 0x95, 0x10, 0x75, 0x01, 0x81, 0x02, 0x05, 0x01, 
0x16, 0x01, 0xf8, 0x26, 0xff, 0x07, 0x75, 0x0c, 0x95, 0x02, 
0x09, 0x30, 0x09, 0x31, 0x81, 0x06, 0x15, 0x81, 0x25, 0x7f, 
0x75, 0x08, 0x95, 0x01, 0x09, 0x38, 0x81, 0x06, 0x05, 0x0c, 
0x0a, 0x38, 0x02, 0x95, 0x01, 0x81, 0x06, 0xc0, 0xc0, 0x05, 
0x0c, 0x09, 0x01, 0xa1, 0x01, 0x85, 0x03, 0x75, 0x10, 0x95, 
0x02, 0x15, 0x01, 0x26, 0xff, 0x02, 0x19, 0x01, 0x2a, 0xff, 
0x02, 0x81, 0x00, 0xc0, 0x05, 0x01, 0x09, 0x80, 0xa1, 0x01, 
0x85, 0x04, 0x75, 0x02, 0x95, 0x01, 0x15, 0x01, 0x25, 0x03, 
0x09, 0x82, 0x09, 0x81, 0x09, 0x83, 0x81, 0x60, 0x75, 0x06, 
0x81, 0x03, 0xc0, 0x06, 0xbc, 0xff, 0x09, 0x88, 0xa1, 0x01, 
0x85, 0x08, 0x19, 0x01, 0x29, 0xff, 0x15, 0x01, 0x26, 0xff, 
0x00, 0x75, 0x08, 0x95, 0x01, 0x81, 0x00, 0xc0, 
Device Found
  type: 046d c52b
  path: DevSrvsID:4294970673
  serial_number: 
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    1
  Usage (page): 0x1 (0x1)
  Bus type: 1

  Report Descriptor: (148 bytes)
0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x85, 0x02, 0x09, 0x01, 
0xa1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x10, 0x15, 0x00, 
0x25, 0x01, 0x95, 0x10, 0x75, 0x01, 0x81, 0x02, 0x05, 0x01, 
0x16, 0x01, 0xf8, 0x26, 0xff, 0x07, 0x75, 0x0c, 0x95, 0x02, 
0x09, 0x30, 0x09, 0x31, 0x81, 0x06, 0x15, 0x81, 0x25, 0x7f, 
0x75, 0x08, 0x95, 0x01, 0x09, 0x38, 0x81, 0x06, 0x05, 0x0c, 
0x0a, 0x38, 0x02, 0x95, 0x01, 0x81, 0x06, 0xc0, 0xc0, 0x05, 
0x0c, 0x09, 0x01, 0xa1, 0x01, 0x85, 0x03, 0x75, 0x10, 0x95, 
0x02, 0x15, 0x01, 0x26, 0xff, 0x02, 0x19, 0x01, 0x2a, 0xff, 
0x02, 0x81, 0x00, 0xc0, 0x05, 0x01, 0x09, 0x80, 0xa1, 0x01, 
0x85, 0x04, 0x75, 0x02, 0x95, 0x01, 0x15, 0x01, 0x25, 0x03, 
0x09, 0x82, 0x09, 0x81, 0x09, 0x83, 0x81, 0x60, 0x75, 0x06, 
0x81, 0x03, 0xc0, 0x06, 0xbc, 0xff, 0x09, 0x88, 0xa1, 0x01, 
0x85, 0x08, 0x19, 0x01, 0x29, 0xff, 0x15, 0x01, 0x26, 0xff, 
0x00, 0x75, 0x08, 0x95, 0x01, 0x81, 0x00, 0xc0, 
Device Found
  type: 046d c52b
  path: DevSrvsID:4294970673
  serial_number: 
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    1
  Usage (page): 0x1 (0xc)
  Bus type: 1

  Report Descriptor: (148 bytes)
0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x85, 0x02, 0x09, 0x01, 
0xa1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x10, 0x15, 0x00, 
0x25, 0x01, 0x95, 0x10, 0x75, 0x01, 0x81, 0x02, 0x05, 0x01, 
0x16, 0x01, 0xf8, 0x26, 0xff, 0x07, 0x75, 0x0c, 0x95, 0x02, 
0x09, 0x30, 0x09, 0x31, 0x81, 0x06, 0x15, 0x81, 0x25, 0x7f, 
0x75, 0x08, 0x95, 0x01, 0x09, 0x38, 0x81, 0x06, 0x05, 0x0c, 
0x0a, 0x38, 0x02, 0x95, 0x01, 0x81, 0x06, 0xc0, 0xc0, 0x05, 
0x0c, 0x09, 0x01, 0xa1, 0x01, 0x85, 0x03, 0x75, 0x10, 0x95, 
0x02, 0x15, 0x01, 0x26, 0xff, 0x02, 0x19, 0x01, 0x2a, 0xff, 
0x02, 0x81, 0x00, 0xc0, 0x05, 0x01, 0x09, 0x80, 0xa1, 0x01, 
0x85, 0x04, 0x75, 0x02, 0x95, 0x01, 0x15, 0x01, 0x25, 0x03, 
0x09, 0x82, 0x09, 0x81, 0x09, 0x83, 0x81, 0x60, 0x75, 0x06, 
0x81, 0x03, 0xc0, 0x06, 0xbc, 0xff, 0x09, 0x88, 0xa1, 0x01, 
0x85, 0x08, 0x19, 0x01, 0x29, 0xff, 0x15, 0x01, 0x26, 0xff, 
0x00, 0x75, 0x08, 0x95, 0x01, 0x81, 0x00, 0xc0, 
Device Found
  type: 046d c52b
  path: DevSrvsID:4294970673
  serial_number: 
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    1
  Usage (page): 0x80 (0x1)
  Bus type: 1

  Report Descriptor: (148 bytes)
0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x85, 0x02, 0x09, 0x01, 
0xa1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x10, 0x15, 0x00, 
0x25, 0x01, 0x95, 0x10, 0x75, 0x01, 0x81, 0x02, 0x05, 0x01, 
0x16, 0x01, 0xf8, 0x26, 0xff, 0x07, 0x75, 0x0c, 0x95, 0x02, 
0x09, 0x30, 0x09, 0x31, 0x81, 0x06, 0x15, 0x81, 0x25, 0x7f, 
0x75, 0x08, 0x95, 0x01, 0x09, 0x38, 0x81, 0x06, 0x05, 0x0c, 
0x0a, 0x38, 0x02, 0x95, 0x01, 0x81, 0x06, 0xc0, 0xc0, 0x05, 
0x0c, 0x09, 0x01, 0xa1, 0x01, 0x85, 0x03, 0x75, 0x10, 0x95, 
0x02, 0x15, 0x01, 0x26, 0xff, 0x02, 0x19, 0x01, 0x2a, 0xff, 
0x02, 0x81, 0x00, 0xc0, 0x05, 0x01, 0x09, 0x80, 0xa1, 0x01, 
0x85, 0x04, 0x75, 0x02, 0x95, 0x01, 0x15, 0x01, 0x25, 0x03, 
0x09, 0x82, 0x09, 0x81, 0x09, 0x83, 0x81, 0x60, 0x75, 0x06, 
0x81, 0x03, 0xc0, 0x06, 0xbc, 0xff, 0x09, 0x88, 0xa1, 0x01, 
0x85, 0x08, 0x19, 0x01, 0x29, 0xff, 0x15, 0x01, 0x26, 0xff, 
0x00, 0x75, 0x08, 0x95, 0x01, 0x81, 0x00, 0xc0, 
Device Found
  type: 046d c52b
  path: DevSrvsID:4294970673
  serial_number: 
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    1
  Usage (page): 0x88 (0xffbc)
  Bus type: 1

  Report Descriptor: (148 bytes)
0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x85, 0x02, 0x09, 0x01, 
0xa1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x10, 0x15, 0x00, 
0x25, 0x01, 0x95, 0x10, 0x75, 0x01, 0x81, 0x02, 0x05, 0x01, 
0x16, 0x01, 0xf8, 0x26, 0xff, 0x07, 0x75, 0x0c, 0x95, 0x02, 
0x09, 0x30, 0x09, 0x31, 0x81, 0x06, 0x15, 0x81, 0x25, 0x7f, 
0x75, 0x08, 0x95, 0x01, 0x09, 0x38, 0x81, 0x06, 0x05, 0x0c, 
0x0a, 0x38, 0x02, 0x95, 0x01, 0x81, 0x06, 0xc0, 0xc0, 0x05, 
0x0c, 0x09, 0x01, 0xa1, 0x01, 0x85, 0x03, 0x75, 0x10, 0x95, 
0x02, 0x15, 0x01, 0x26, 0xff, 0x02, 0x19, 0x01, 0x2a, 0xff, 
0x02, 0x81, 0x00, 0xc0, 0x05, 0x01, 0x09, 0x80, 0xa1, 0x01, 
0x85, 0x04, 0x75, 0x02, 0x95, 0x01, 0x15, 0x01, 0x25, 0x03, 
0x09, 0x82, 0x09, 0x81, 0x09, 0x83, 0x81, 0x60, 0x75, 0x06, 
0x81, 0x03, 0xc0, 0x06, 0xbc, 0xff, 0x09, 0x88, 0xa1, 0x01, 
0x85, 0x08, 0x19, 0x01, 0x29, 0xff, 0x15, 0x01, 0x26, 0xff, 
0x00, 0x75, 0x08, 0x95, 0x01, 0x81, 0x00, 0xc0, 
unable to open device

@imaami Yes your mod is working but as @Youw mentioned that this PR is not the right fix to go with. ``` mcuee@mcuees-Mac-mini hidapi_pr530_mod % ./hidtest/hidtest hidapi test/example tool. Compiled with hidapi version 0.14.0, runtime version 0.14.0. Compile-time version matches runtime version of hidapi. ... ... Device Found type: 046d 1000 path: DevSrvsID:4294970699 serial_number: Manufacturer: Logitech Product: LogiVirtualHIDDevice Release: 1 Interface: 2 Usage (page): 0x2 (0x1) Bus type: 0 Report Descriptor: (69 bytes) 0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x85, 0x02, 0x09, 0x01, 0xa1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x10, 0x15, 0x00, 0x25, 0x01, 0x95, 0x10, 0x75, 0x01, 0x81, 0x02, 0x05, 0x01, 0x16, 0x01, 0xf8, 0x26, 0xff, 0x07, 0x75, 0x0c, 0x95, 0x02, 0x09, 0x30, 0x09, 0x31, 0x81, 0x06, 0x15, 0x81, 0x25, 0x7f, 0x75, 0x08, 0x95, 0x01, 0x09, 0x38, 0x81, 0x06, 0x05, 0x0c, 0x0a, 0x38, 0x02, 0x95, 0x01, 0x81, 0x06, 0xc0, 0xc0, Device Found type: 046d 1000 path: DevSrvsID:4294970699 serial_number: Manufacturer: Logitech Product: LogiVirtualHIDDevice Release: 1 Interface: 2 Usage (page): 0x1 (0x1) Bus type: 0 Report Descriptor: (69 bytes) 0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x85, 0x02, 0x09, 0x01, 0xa1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x10, 0x15, 0x00, 0x25, 0x01, 0x95, 0x10, 0x75, 0x01, 0x81, 0x02, 0x05, 0x01, 0x16, 0x01, 0xf8, 0x26, 0xff, 0x07, 0x75, 0x0c, 0x95, 0x02, 0x09, 0x30, 0x09, 0x31, 0x81, 0x06, 0x15, 0x81, 0x25, 0x7f, 0x75, 0x08, 0x95, 0x01, 0x09, 0x38, 0x81, 0x06, 0x05, 0x0c, 0x0a, 0x38, 0x02, 0x95, 0x01, 0x81, 0x06, 0xc0, 0xc0, Device Found type: 046d c52b path: DevSrvsID:4294970675 serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x1 (0xff00) Bus type: 1 Report Descriptor: (98 bytes) 0x06, 0x00, 0xff, 0x09, 0x01, 0xa1, 0x01, 0x85, 0x10, 0x75, 0x08, 0x95, 0x06, 0x15, 0x00, 0x26, 0xff, 0x00, 0x09, 0x01, 0x81, 0x00, 0x09, 0x01, 0x91, 0x00, 0xc0, 0x06, 0x00, 0xff, 0x09, 0x02, 0xa1, 0x01, 0x85, 0x11, 0x75, 0x08, 0x95, 0x13, 0x15, 0x00, 0x26, 0xff, 0x00, 0x09, 0x02, 0x81, 0x00, 0x09, 0x02, 0x91, 0x00, 0xc0, 0x06, 0x00, 0xff, 0x09, 0x04, 0xa1, 0x01, 0x85, 0x20, 0x75, 0x08, 0x95, 0x0e, 0x15, 0x00, 0x26, 0xff, 0x00, 0x09, 0x41, 0x81, 0x00, 0x09, 0x41, 0x91, 0x00, 0x85, 0x21, 0x95, 0x1f, 0x15, 0x00, 0x26, 0xff, 0x00, 0x09, 0x42, 0x81, 0x00, 0x09, 0x42, 0x91, 0x00, 0xc0, Device Found type: 046d c52b path: DevSrvsID:4294970675 serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x2 (0xff00) Bus type: 1 Report Descriptor: (98 bytes) 0x06, 0x00, 0xff, 0x09, 0x01, 0xa1, 0x01, 0x85, 0x10, 0x75, 0x08, 0x95, 0x06, 0x15, 0x00, 0x26, 0xff, 0x00, 0x09, 0x01, 0x81, 0x00, 0x09, 0x01, 0x91, 0x00, 0xc0, 0x06, 0x00, 0xff, 0x09, 0x02, 0xa1, 0x01, 0x85, 0x11, 0x75, 0x08, 0x95, 0x13, 0x15, 0x00, 0x26, 0xff, 0x00, 0x09, 0x02, 0x81, 0x00, 0x09, 0x02, 0x91, 0x00, 0xc0, 0x06, 0x00, 0xff, 0x09, 0x04, 0xa1, 0x01, 0x85, 0x20, 0x75, 0x08, 0x95, 0x0e, 0x15, 0x00, 0x26, 0xff, 0x00, 0x09, 0x41, 0x81, 0x00, 0x09, 0x41, 0x91, 0x00, 0x85, 0x21, 0x95, 0x1f, 0x15, 0x00, 0x26, 0xff, 0x00, 0x09, 0x42, 0x81, 0x00, 0x09, 0x42, 0x91, 0x00, 0xc0, Device Found type: 046d c52b path: DevSrvsID:4294970675 serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x4 (0xff00) Bus type: 1 Report Descriptor: (98 bytes) 0x06, 0x00, 0xff, 0x09, 0x01, 0xa1, 0x01, 0x85, 0x10, 0x75, 0x08, 0x95, 0x06, 0x15, 0x00, 0x26, 0xff, 0x00, 0x09, 0x01, 0x81, 0x00, 0x09, 0x01, 0x91, 0x00, 0xc0, 0x06, 0x00, 0xff, 0x09, 0x02, 0xa1, 0x01, 0x85, 0x11, 0x75, 0x08, 0x95, 0x13, 0x15, 0x00, 0x26, 0xff, 0x00, 0x09, 0x02, 0x81, 0x00, 0x09, 0x02, 0x91, 0x00, 0xc0, 0x06, 0x00, 0xff, 0x09, 0x04, 0xa1, 0x01, 0x85, 0x20, 0x75, 0x08, 0x95, 0x0e, 0x15, 0x00, 0x26, 0xff, 0x00, 0x09, 0x41, 0x81, 0x00, 0x09, 0x41, 0x91, 0x00, 0x85, 0x21, 0x95, 0x1f, 0x15, 0x00, 0x26, 0xff, 0x00, 0x09, 0x42, 0x81, 0x00, 0x09, 0x42, 0x91, 0x00, 0xc0, Device Found type: 046d c52b path: DevSrvsID:4294970673 serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 1 Usage (page): 0x2 (0x1) Bus type: 1 Report Descriptor: (148 bytes) 0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x85, 0x02, 0x09, 0x01, 0xa1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x10, 0x15, 0x00, 0x25, 0x01, 0x95, 0x10, 0x75, 0x01, 0x81, 0x02, 0x05, 0x01, 0x16, 0x01, 0xf8, 0x26, 0xff, 0x07, 0x75, 0x0c, 0x95, 0x02, 0x09, 0x30, 0x09, 0x31, 0x81, 0x06, 0x15, 0x81, 0x25, 0x7f, 0x75, 0x08, 0x95, 0x01, 0x09, 0x38, 0x81, 0x06, 0x05, 0x0c, 0x0a, 0x38, 0x02, 0x95, 0x01, 0x81, 0x06, 0xc0, 0xc0, 0x05, 0x0c, 0x09, 0x01, 0xa1, 0x01, 0x85, 0x03, 0x75, 0x10, 0x95, 0x02, 0x15, 0x01, 0x26, 0xff, 0x02, 0x19, 0x01, 0x2a, 0xff, 0x02, 0x81, 0x00, 0xc0, 0x05, 0x01, 0x09, 0x80, 0xa1, 0x01, 0x85, 0x04, 0x75, 0x02, 0x95, 0x01, 0x15, 0x01, 0x25, 0x03, 0x09, 0x82, 0x09, 0x81, 0x09, 0x83, 0x81, 0x60, 0x75, 0x06, 0x81, 0x03, 0xc0, 0x06, 0xbc, 0xff, 0x09, 0x88, 0xa1, 0x01, 0x85, 0x08, 0x19, 0x01, 0x29, 0xff, 0x15, 0x01, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x01, 0x81, 0x00, 0xc0, Device Found type: 046d c52b path: DevSrvsID:4294970673 serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 1 Usage (page): 0x1 (0x1) Bus type: 1 Report Descriptor: (148 bytes) 0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x85, 0x02, 0x09, 0x01, 0xa1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x10, 0x15, 0x00, 0x25, 0x01, 0x95, 0x10, 0x75, 0x01, 0x81, 0x02, 0x05, 0x01, 0x16, 0x01, 0xf8, 0x26, 0xff, 0x07, 0x75, 0x0c, 0x95, 0x02, 0x09, 0x30, 0x09, 0x31, 0x81, 0x06, 0x15, 0x81, 0x25, 0x7f, 0x75, 0x08, 0x95, 0x01, 0x09, 0x38, 0x81, 0x06, 0x05, 0x0c, 0x0a, 0x38, 0x02, 0x95, 0x01, 0x81, 0x06, 0xc0, 0xc0, 0x05, 0x0c, 0x09, 0x01, 0xa1, 0x01, 0x85, 0x03, 0x75, 0x10, 0x95, 0x02, 0x15, 0x01, 0x26, 0xff, 0x02, 0x19, 0x01, 0x2a, 0xff, 0x02, 0x81, 0x00, 0xc0, 0x05, 0x01, 0x09, 0x80, 0xa1, 0x01, 0x85, 0x04, 0x75, 0x02, 0x95, 0x01, 0x15, 0x01, 0x25, 0x03, 0x09, 0x82, 0x09, 0x81, 0x09, 0x83, 0x81, 0x60, 0x75, 0x06, 0x81, 0x03, 0xc0, 0x06, 0xbc, 0xff, 0x09, 0x88, 0xa1, 0x01, 0x85, 0x08, 0x19, 0x01, 0x29, 0xff, 0x15, 0x01, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x01, 0x81, 0x00, 0xc0, Device Found type: 046d c52b path: DevSrvsID:4294970673 serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 1 Usage (page): 0x1 (0xc) Bus type: 1 Report Descriptor: (148 bytes) 0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x85, 0x02, 0x09, 0x01, 0xa1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x10, 0x15, 0x00, 0x25, 0x01, 0x95, 0x10, 0x75, 0x01, 0x81, 0x02, 0x05, 0x01, 0x16, 0x01, 0xf8, 0x26, 0xff, 0x07, 0x75, 0x0c, 0x95, 0x02, 0x09, 0x30, 0x09, 0x31, 0x81, 0x06, 0x15, 0x81, 0x25, 0x7f, 0x75, 0x08, 0x95, 0x01, 0x09, 0x38, 0x81, 0x06, 0x05, 0x0c, 0x0a, 0x38, 0x02, 0x95, 0x01, 0x81, 0x06, 0xc0, 0xc0, 0x05, 0x0c, 0x09, 0x01, 0xa1, 0x01, 0x85, 0x03, 0x75, 0x10, 0x95, 0x02, 0x15, 0x01, 0x26, 0xff, 0x02, 0x19, 0x01, 0x2a, 0xff, 0x02, 0x81, 0x00, 0xc0, 0x05, 0x01, 0x09, 0x80, 0xa1, 0x01, 0x85, 0x04, 0x75, 0x02, 0x95, 0x01, 0x15, 0x01, 0x25, 0x03, 0x09, 0x82, 0x09, 0x81, 0x09, 0x83, 0x81, 0x60, 0x75, 0x06, 0x81, 0x03, 0xc0, 0x06, 0xbc, 0xff, 0x09, 0x88, 0xa1, 0x01, 0x85, 0x08, 0x19, 0x01, 0x29, 0xff, 0x15, 0x01, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x01, 0x81, 0x00, 0xc0, Device Found type: 046d c52b path: DevSrvsID:4294970673 serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 1 Usage (page): 0x80 (0x1) Bus type: 1 Report Descriptor: (148 bytes) 0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x85, 0x02, 0x09, 0x01, 0xa1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x10, 0x15, 0x00, 0x25, 0x01, 0x95, 0x10, 0x75, 0x01, 0x81, 0x02, 0x05, 0x01, 0x16, 0x01, 0xf8, 0x26, 0xff, 0x07, 0x75, 0x0c, 0x95, 0x02, 0x09, 0x30, 0x09, 0x31, 0x81, 0x06, 0x15, 0x81, 0x25, 0x7f, 0x75, 0x08, 0x95, 0x01, 0x09, 0x38, 0x81, 0x06, 0x05, 0x0c, 0x0a, 0x38, 0x02, 0x95, 0x01, 0x81, 0x06, 0xc0, 0xc0, 0x05, 0x0c, 0x09, 0x01, 0xa1, 0x01, 0x85, 0x03, 0x75, 0x10, 0x95, 0x02, 0x15, 0x01, 0x26, 0xff, 0x02, 0x19, 0x01, 0x2a, 0xff, 0x02, 0x81, 0x00, 0xc0, 0x05, 0x01, 0x09, 0x80, 0xa1, 0x01, 0x85, 0x04, 0x75, 0x02, 0x95, 0x01, 0x15, 0x01, 0x25, 0x03, 0x09, 0x82, 0x09, 0x81, 0x09, 0x83, 0x81, 0x60, 0x75, 0x06, 0x81, 0x03, 0xc0, 0x06, 0xbc, 0xff, 0x09, 0x88, 0xa1, 0x01, 0x85, 0x08, 0x19, 0x01, 0x29, 0xff, 0x15, 0x01, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x01, 0x81, 0x00, 0xc0, Device Found type: 046d c52b path: DevSrvsID:4294970673 serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 1 Usage (page): 0x88 (0xffbc) Bus type: 1 Report Descriptor: (148 bytes) 0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x85, 0x02, 0x09, 0x01, 0xa1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x10, 0x15, 0x00, 0x25, 0x01, 0x95, 0x10, 0x75, 0x01, 0x81, 0x02, 0x05, 0x01, 0x16, 0x01, 0xf8, 0x26, 0xff, 0x07, 0x75, 0x0c, 0x95, 0x02, 0x09, 0x30, 0x09, 0x31, 0x81, 0x06, 0x15, 0x81, 0x25, 0x7f, 0x75, 0x08, 0x95, 0x01, 0x09, 0x38, 0x81, 0x06, 0x05, 0x0c, 0x0a, 0x38, 0x02, 0x95, 0x01, 0x81, 0x06, 0xc0, 0xc0, 0x05, 0x0c, 0x09, 0x01, 0xa1, 0x01, 0x85, 0x03, 0x75, 0x10, 0x95, 0x02, 0x15, 0x01, 0x26, 0xff, 0x02, 0x19, 0x01, 0x2a, 0xff, 0x02, 0x81, 0x00, 0xc0, 0x05, 0x01, 0x09, 0x80, 0xa1, 0x01, 0x85, 0x04, 0x75, 0x02, 0x95, 0x01, 0x15, 0x01, 0x25, 0x03, 0x09, 0x82, 0x09, 0x81, 0x09, 0x83, 0x81, 0x60, 0x75, 0x06, 0x81, 0x03, 0xc0, 0x06, 0xbc, 0xff, 0x09, 0x88, 0xa1, 0x01, 0x85, 0x08, 0x19, 0x01, 0x29, 0xff, 0x15, 0x01, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x01, 0x81, 0x00, 0xc0, unable to open device ```
Youw commented 2023-04-30 08:59:17 -05:00 (Migrated from github.com)

Closing in favor of #534.

Closing in favor of #534.
pengxianheng-nreal (Migrated from github.com) reviewed 2023-05-24 21:14:20 -05:00
@ -552,6 +552,36 @@ static struct hid_device_info *create_device_info_with_usage(IOHIDDeviceRef dev,
cur_dev->interface_number = -1;
}
if (cur_dev->interface_number == -1 || cur_dev->interface_number == 0) {
pengxianheng-nreal (Migrated from github.com) commented 2023-05-24 21:14:20 -05:00

Actually, the width of tabs on different system is different , but the width of spaces is the same. so use spaces can croass-platform ,show consistency

Actually, the width of tabs on different system is different , but the width of spaces is the same. so use spaces can croass-platform ,show consistency
pengxianheng-nreal (Migrated from github.com) reviewed 2023-05-24 22:40:34 -05:00
@ -555,0 +570,4 @@
const char* match_prefix_string = "Interface@";
char* interface_component = strstr(temp_dev_path, match_prefix_string);
if (interface_component) {
char* decimal_str = interface_component + strlen(match_prefix_string);
pengxianheng-nreal (Migrated from github.com) commented 2023-05-24 22:40:34 -05:00

thanks for suggestion

thanks for suggestion
imaami (Migrated from github.com) reviewed 2023-05-25 00:12:25 -05:00
@ -552,6 +552,36 @@ static struct hid_device_info *create_device_info_with_usage(IOHIDDeviceRef dev,
cur_dev->interface_number = -1;
}
if (cur_dev->interface_number == -1 || cur_dev->interface_number == 0) {
imaami (Migrated from github.com) commented 2023-05-25 00:12:25 -05:00

The point is that the commit is not consistent with its own surroundings. Arguments for or against tab indentation are completely irrelevant in the context of one commit that adds code to an existing file.

Attached screenshot shows what this looks like.

Screenshot_20230525-074350~2

The point is that the commit is not consistent with its own surroundings. Arguments for or against tab indentation are completely irrelevant in the context of one commit that adds code to an existing file. Attached screenshot shows what this looks like. ![Screenshot_20230525-074350~2](https://github.com/libusb/hidapi/assets/3589345/ffce55ea-9d09-418e-858e-4725d35aa523)
pengxianheng-nreal (Migrated from github.com) reviewed 2023-05-25 10:33:47 -05:00
@ -552,6 +552,36 @@ static struct hid_device_info *create_device_info_with_usage(IOHIDDeviceRef dev,
cur_dev->interface_number = -1;
}
if (cur_dev->interface_number == -1 || cur_dev->interface_number == 0) {
pengxianheng-nreal (Migrated from github.com) commented 2023-05-25 10:33:47 -05:00

if you explain like this ,I got it.

if you explain like this ,I got it.

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-libusb/hidapi!530
No description provided.