xairy / raw-gadget

USB Raw Gadget — a low-level interface for the Linux USB Gadget subsystem
333 stars 35 forks source link

Timeout for EVENT_FETCH #13

Closed dheatovwil closed 3 years ago

dheatovwil commented 3 years ago

I have a thread for ep0_loop and another for ep_int_in_loop, apparently I can't write when EVENT_FETCH is blocking, is there a way to timeout the fetch, so I can write something in between?

EDIT: I figure I could implement a timeout manually, but I'm stuck at cancelling the ioctl call ="(

xairy commented 3 years ago

I'm not sure I understand. Writing to a non-zero endpoint should be possible while endpoint 0 is blocked on USB_RAW_IOCTL_EVENT_FETCH, see tests/gadget.c as an example. What exactly are you trying to do?

dheatovwil commented 3 years ago

Thank you for the fast reply and your reaffirmation! I was trying to send a control transfer, just realized I got all the endpoints messed up. After I changed it to write to ep0 for control packet it seems to be working ! Thanks once again =D