-
Notifications
You must be signed in to change notification settings - Fork 474
usb hid gadget under Linux #694
New to embedded system and hardware level programming. Does this repo allow for a linux desktop to act as hid for a Windows machine? Or is it internal so it would a hid on the same machine this repo is running on? Sorry for my ignorance and thank you for any help.
All reactions
No. hidapi (as well as libusb) is for the host side.
For device side, you should look at linux gadget. Your Linux host may or may not support it.
https://www.kernel.org/doc/html/v6.11/driver-api/usb/gadget.html
https://docs.kernel.org/usb/gadget_hid.html
Examples from github:
https://github.com/vpelletier/python-functionfs/tree/master/examples/hid
https://github.com/xairy/raw-gadget/blob/master/examples/keyboard.c
Replies: 1 comment 1 reply
No. hidapi (as well as libusb) is for the host side.
For device side, you should look at linux gadget. Your Linux host may or may not support it.
https://www.kernel.org/doc/html/v6.11/driver-api/usb/gadget.html
https://docs.kernel.org/usb/gadget_hid.html
Examples from github:
https://github.com/vpelletier/python-functionfs/tree/master/examples/hid
https://github.com/xairy/raw-gadget/blob/master/examples/keyboard.c
All reactions
If you host does not support, not so sure if you can use the following or not (emulated HID device). I tend to think it may not work for your use case.
https://github.com/martinpitt/umockdev/tree/main/devices/hidraw