support multipe usage/usage-pairs on MacOS#65
support multipe usage/usage-pairs on MacOS#65fengj2006 wants to merge 2 commits intolibusb:masterfrom fengj2006:master
Conversation
Youw
left a comment
There was a problem hiding this comment.
I happen to have a device with multiple usage pages - will review it carefully a bit later
|
Fixes #116 |
Youw
left a comment
There was a problem hiding this comment.
looks good overall
would be great if you could add something like:
printf(" Usage: 0x%hx 0x%hx\n", cur_dev->usage, cur_dev->usage_page);to hidtest.c
| cur_dev->interface_number = -1; | ||
| } | ||
| if (!dev) { | ||
| continue; |
There was a problem hiding this comment.
| continue; | |
| continue; |
|
|
||
| /* move the pointer to the tail of returnd list */ | ||
| while (cur_dev->next != NULL) { | ||
| cur_dev = cur_dev->next; |
There was a problem hiding this comment.
| cur_dev = cur_dev->next; | |
| cur_dev = cur_dev->next; |
|
|
||
| IOHIDDeviceRef dev = device_array[i]; | ||
| #ifdef DEBUG | ||
| // CFShow(dev); |
| CFRelease(p); | ||
| } | ||
| #ifdef DEBUG | ||
| // CFShow(matching); |
| continue; | ||
| } | ||
| #ifdef DEBUG | ||
| // CFShow(dict); |
| CFArrayRef usage_pairs = get_usage_pairs(device); | ||
|
|
||
| #ifdef DEBUG | ||
| // CFShow(usage_pairs); |
| cur_dev->release_number = get_int_property(dev, CFSTR(kIOHIDVersionNumberKey)); | ||
|
|
||
| /* Interface Number (Unsupported on Mac)*/ | ||
| cur_dev->interface_number = -1; |
There was a problem hiding this comment.
it is supported now
please see: 00e6e45#diff-5cbb2d1918d13a205b0b45fa24166f42
update accordingly
| } | ||
|
|
||
| if (root == NULL) { | ||
| /* error when generating or parsing usage pairs */ |
There was a problem hiding this comment.
| /* error when generating or parsing usage pairs */ | |
| /* error when generating or parsing usage pairs, or device/driver doesn't report usage pairs (correctly) */ |
|
Hi, I'm not the original submitter of this PR, but I'd like to implement the requested changes. What is the cleanest way of doing this? (I've not had experience with PRs with updates and suggested changes) |
|
I don't think there is a way to submit your changes to this particular PR since you'd need to commit to author's PR, and you don't have write access to his copy of the repo. But you can:
Alternative - ask write permission to |
This change supports one device has multiple usage/usage-page pairs on MacOS, which is already supported on Windows.