Closed. This question is off-topic. It is not currently accepting answers. Learn more
想改进这个问题吗?Update the question所以堆栈溢出的值小于aa>。
去年关门了。
我正在寻找与Microsoft本页中提到的类似的相应Linux HID API:
on-topic
基本功能对应于数据移动:
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应用程序(使用hidapi)
->其次是使用相应的linuxhidapi(对我来说是个黑暗的地方)
谢谢,

最佳答案

跨平台HID API库是HIDAPI(在引擎盖下,它使用Windows的ReadFile/WriteFile和Linux的libusb)。我从来没有用过,所以我不能担保。
如果您只需要SetReport和GetReport,那么在Linux中在hidraw设备上操作可能会更容易。我使用这种技术来ltunify。您可以通过查询sysfs(example)来发现哪个/dev/hidrawX设备属于某个设备。
一旦你有了一个设备(比如说,/dev/hidraw0),你就可以打开它进行读写,并使用POSIXread()write()函数。您可能遇到权限问题,但可以通过手动(setfacl -m u:$USER:rw /dev/hidraw0)或使用udev规则(如42-logitech-unify-permissions.rules)更改设备的权限来解决此问题。
由于您需要同时支持Windows和Linux平台,我认为您最好使用前面提到的HIDAPI库。

关于linux - 与Windows HID API相似的Linux HID APIS,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/22528522/

10-16 20:34