Linux Hotplug: Connection-callback implementation for hidraw #647
No reviewers
Labels
No labels
3rdparty
Android
API
Author does not respond
bsd
bug
build system/CI
ci-virtual-device
CMake
Contributions Welcome
Core
dependencies
device-specific
documentation
don't_merge
duplicate
enhancement
Example
Haiku
hidraw
hotplug
info required
invalid
libusb
macOS
Misc
Not an issue
question
Release
Test
Test GUI
Windows
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-libusb/hidapi!647
Loading…
Reference in a new issue
No description provided.
Delete branch "connection-callback-udev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -883,0 +945,4 @@/* Disarm the udev monitor */udev_monitor_unref(hid_hotplug_context.mon);udev_unref(hid_hotplug_context.udev_ctx);}always a space after
if/for/while/etc.@ -883,0 +945,4 @@/* Disarm the udev monitor */udev_monitor_unref(hid_hotplug_context.mon);udev_unref(hid_hotplug_context.udev_ctx);}consistency
my comments are only about code-style for now
I really need to find time to review this (and others) thoroughly
Did some adjustents to the code-style (in fact, got my IDE set up to keep track of it).
Made a few changes to the list management code, as the old version had a severe logical error in device removal handling.
I have no idea how did this wasn't fixed in the commit despite this code having actually been run and tested. Will look at what other changes didn't get commited.
Not so sure how to re-run the github actions as there were build error previously.
I will test this under Linux later.
This seems to work fine under Ubuntu Linux 20.04.
Unplug and plug of a USB mouse receiver
Unplug and plug of USBasp programmer (USB Composite device)
Unplug and plug of Plantronics Headset (USB composite device)
More detailed output using sudo.
Test of latest commit under Ubuntu Linux 20.04
Unplug and plug of Logitech USB receiver
Plug and unplug of Plantronics Headset
Noticed a very minor issue with this PR - the code lacks a
pthread_joininhotlplug_cleanup. Might cause some weird behaviour in a very narrow case when all callbacks are deleted and then a new one is installed immediately and the background thread didn't have enough time to stop. Going to fix in a moment.Fixed the cleanup procedure. Doesn't affect how the events themselves work.
Last git commit is still working fine. Thanks.
Tested under Ubuntu Linux 20.04.
Unplug and plug of Platronics USB headset
Unplug and plug of a USB mouse receiver
Unplug and plug of another USB mouse receiver
Same deal as with #645 - getting it merged into a feature branch now.