Replies: 1 comment
-
Try checking one of the known implementation for sample: https://github.com/libusb/hidapi/blob/7011fa98af2dde00c298105735e470de800288c7/libusb/hid.c#L1019 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What is the purpose of
libusb_handle_events_completed
if I just run a thread for handling events? Do I need special consideration if I have two threads submitting transfers?A little background:
I'm writing a device driver for a camera/SLAM tracker, and I want to handle interrupt transfers for streamed data on the SLAM endpoint and the video stream using libuvc. I'm using the same
libusb_ctx
for both features.I have a thread that submits transfers for the SLAM endpoint, which uses the callback to submit the next transfer. I'm also using libuvc's stream functionality to handle video. The libuvc docs state that I must handle the event if I share the context.
My current idea is to have a thread that calls
libusb_handle_events
indefinitely from program start to program end and let each thread handle events. Do you know if this is valid? If not, what do you think I should consider? Also, is it good practice to use the callback to submit the next transfer?This is my current implementation, but I haven't started implementing the video functionality.
Beta Was this translation helpful? Give feedback.
All reactions