Data Movement
The following list identifies HID API that an application can use to move data back and forth between the app and a selected device.
HidD_GetInputReport
HidD_SetFeature
HidD_SetOutputReport
ReadFile
WriteFile
我目前有两个方向:
-> 安装 wine 框架并尝试使用 Windows 应用程序(利用 HID Apis)
-> 第二次使用对应的Linux HID Apis(对我来说是暗区)
谢谢,
最佳答案
一个跨平台的 HID API 库是 HIDAPI(在底层,它使用 Windows 的 ReadFile/WriteFile 和 Linux 的 libusb)。我从未使用过它,所以我不能保证。
如果你只需要 SetReport 和 GetReport,那么在 Linux 中操作 hidraw 设备可能会更容易。我将此技术用于 ltunify 。您可以通过查询 sysfs ( example ) 来发现哪个 /dev/hidrawX 设备属于一个设备。