linux - USB HID 设备仅报告第一个事件

标签 linux usb hid

我有一个 eDIO USB 多功能 Remote (红外接收器),附带 ASUS PSR 2000 网上冲浪 Remote 。

我正在尝试将远程 Controller 连接到我的 pi,以便它接收 Remote 发送的击键。

Controller 被检测为 HID 设备。以下是 lsusb -v 命令的详细信息

Bus 001 Device 007: ID 147a:e001 Formosa Industrial Computing, Inc.
Couldn't open device, some information will be missing
Device Descriptor:
bLength                18
bDescriptorType         1
bcdUSB               1.10
bDeviceClass            0 (Defined at Interface level)
bDeviceSubClass         0
bDeviceProtocol         0
bMaxPacketSize0         8
idVendor           0x147a Formosa Industrial Computing, Inc.
idProduct          0xe001
bcdDevice            1.22
iManufacturer           1
iProduct                2
iSerial                 0
bNumConfigurations      1
Configuration Descriptor:
bLength                 9
bDescriptorType         2
wTotalLength           34
bNumInterfaces          1
bConfigurationValue     1
iConfiguration          4
bmAttributes         0xa0
(Bus Powered)
Remote Wakeup
MaxPower              300mA
Interface Descriptor:
bLength                 9
bDescriptorType         4
bInterfaceNumber        0
bAlternateSetting       0
bNumEndpoints           1
bInterfaceClass         3 Human Interface Device
bInterfaceSubClass      1 Boot Interface Subclass
bInterfaceProtocol      2 Mouse
iInterface              0
HID Device Descriptor:
bLength                 9
bDescriptorType        33
bcdHID               1.10
bCountryCode            0 Not supported
bNumDescriptors         1
bDescriptorType        34 Report
wDescriptorLength      20
Report Descriptors:
 ** UNAVAILABLE **
 Endpoint Descriptor:
 bLength                 7
bDescriptorType         5
bEndpointAddress     0x81  EP 1 IN
bmAttributes            3
  Transfer Type            Interrupt
  Synch Type               None
  Usage Type               Data
wMaxPacketSize     0x0004  1x 4 bytes
bInterval              10

我还可以在 dev 文件夹中创建事件的设备

pi@raspberrypi /dev/input/by-id $ dir
usb-Cypress_Semiconductor_eDio_USB_Multi_Remote_Controlle-event-if00

与其关联的事件处理程序如下,从以下命令可见。

    pi@raspberrypi /proc/bus/input $ cat devices
    I: Bus=0003 Vendor=147a Product=e001 Version=0110
    N: Name="Cypress Semiconductor eDio USB Multi Remote Controlle"
    P: Phys=usb-bcm2708_usb-1.2/input0
    S: Sysfs=/devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2:1.0/input/input2
    U: Uniq=
    H: Handlers=event0
    B: PROP=0
    B: EV=1

问题是当我尝试从为设备创建的事件处理程序读取输出时。第一个击键已注册,但 CAT 命令不会显示后续击键。

   pi@raspberrypi /dev/input $ cat event0 | xxd
   0000000: e007 9450 9476 0900 0000 0000 0000 0000  ...P.v..........

请建议我该怎么做才能使设备正常工作。第一次击键后按任意键不会返回任何内容,除非重新插入设备。

请建议需要采取哪些措施来解决该问题。

最佳答案

根据您最终想要做什么,将 HID Remote 的按钮映射到击键可能就足够了,并且使用 QJoyPad 等工具相当容易实现。 .

看起来hard to build on a Raspberry Pi ,所以你可能想尝试 joy2key相反,它可以在存储库中找到:sudo apt-get install Joy2key

关于linux - USB HID 设备仅报告第一个事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13201035/

相关文章:

linux - 为什么 bash 文档建议引用通配符?

winapi - 在 Windows 上的 Qt 中检测 USB 通知

usb - 如何检测使用 USB HID API 推送的游戏 handle 触发器?

android - 无法使用 C 读取 USB HID RFID 读取器

linux - tar 备份错误

linux - 创建一个 .tar.bz2 文件 Linux

c++ - RC 在多线程/多处理上下文中代表什么?

U盘的扇区大小可以修改吗?

macos - 在 OSX 上查找与 CoreAudio 设备关联的 USB VID/PID

objective-c - 如何在 swift 中编写 HID 函数 Handle_DeviceMatchingCallback?