usb hid gadget under Linux #694
Answered
by
mcuee
mckinley94c
asked this question in
Q&A
|
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. |
Answered by
mcuee
Sep 17, 2024
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. Examples from github: |
1 reply
Answer selected by
mcuee
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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