如何让我的设备被识别为 HID 设备?

如何让我的设备被识别为 HID 设备?

我正在尝试让 USB HID 设备在 Ubuntu 中工作,但似乎根本无法让它工作。它是一个 USB HID 设备,在 dmesg 中显示如下:

[ 2236.277518] usb 1-1: new full-speed USB device number 17 using xhci_hcd
[ 2236.429224] usb 1-1: New USB device found, idVendor=0b6a, idProduct=5346
[ 2236.429230] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2236.429234] usb 1-1: Product: Rejoyce 
[ 2236.429237] usb 1-1: Manufacturer: REHABTRONICS
[ 2236.429240] usb 1-1: SerialNumber: 0000
[ 2758.828284] usb 1-1: USB disconnect, device number 17
[ 2760.813658] usb 1-1: new full-speed USB device number 18 using xhci_hcd
[ 2760.966827] usb 1-1: New USB device found, idVendor=0b6a, idProduct=5346
[ 2760.966829] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2760.966830] usb 1-1: Product: Rejoyce 
[ 2760.966832] usb 1-1: Manufacturer: REHABTRONICS
[ 2760.966832] usb 1-1: SerialNumber: 0000

但 generic-hid 驱动程序未加载,并且下面没有显示任何新内容/dev/hidraw*

lsusb在设备上运行(显示在/dev/bus/usb/001/) 下给出:

Bus 001 Device 018: ID 0b6a:5346 Maxim Integrated Products 
Device Descriptor:
bLength                18
bDescriptorType         1
bcdUSB               2.00
bDeviceClass          255 Vendor Specific Class
bDeviceSubClass       255 Vendor Specific Subclass
bDeviceProtocol       255 Vendor Specific Protocol
bMaxPacketSize0        64
idVendor           0x0b6a Maxim Integrated Products
idProduct          0x5346 
bcdDevice            0.01
iManufacturer           1 REHABTRONICS
iProduct                2 Rejoyce 
iSerial                 3 0000
bNumConfigurations      1
Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           41
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
    (Bus Powered)
    MaxPower              450mA
    Interface Descriptor:
    bLength                 9
    bDescriptorType         4
    bInterfaceNumber        0
    bAlternateSetting       0
    bNumEndpoints           2
    bInterfaceClass         3 Human Interface Device
    bInterfaceSubClass      0 No Subclass
    bInterfaceProtocol      0 None
    iInterface              0 
        HID Device Descriptor:
        bLength                 9
        bDescriptorType        33
        bcdHID               1.10
        bCountryCode            0 Not supported
        bNumDescriptors         1
        bDescriptorType        34 Report
        wDescriptorLength      34
        Report Descriptor: (length is 34)
            Item(Global): Usage Page, data= [ 0xa0 0xff ] 65440
                            (null)
            Item(Local ): Usage, data= [ 0x01 ] 1
                            (null)
            Item(Main  ): Collection, data= [ 0x01 ] 1
                            Application
            Item(Local ): Usage, data= [ 0x02 ] 2
                            (null)
            Item(Global): Logical Minimum, data= [ 0x00 ] 0
            Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x20 ] 32
            Item(Main  ): Input, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Local ): Usage, data= [ 0x03 ] 3
                            (null)
            Item(Global): Logical Minimum, data= [ 0x00 ] 0
            Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x08 ] 8
            Item(Main  ): Output, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Main  ): End Collection, data=none
    Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
        Transfer Type            Interrupt
        Synch Type               None
        Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval              16
    Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            3
        Transfer Type            Interrupt
        Synch Type               None
        Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval              16
Device Status:     0x0000
(Bus Powered)

这又意味着 USB HID 设备。

udevadm info /dev/bus/usb/001/018给出:

P: /devices/pci0000:00/0000:00:14.0/usb1/1-1
N: bus/usb/001/018
E: BUSNUM=001
E: DEVNAME=/dev/bus/usb/001/018
E: DEVNUM=018
E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-1
E: DEVTYPE=usb_device
E: DRIVER=usb
E: ID_BUS=usb
E: ID_MODEL=Rejoyce
E: ID_MODEL_ENC=Rejoyce\x20
E: ID_MODEL_ID=5346
E: ID_REVISION=0001
E: ID_SERIAL=REHABTRONICS_Rejoyce_0000
E: ID_SERIAL_SHORT=0000
E: ID_USB_INTERFACES=:030000:
E: ID_VENDOR=REHABTRONICS
E: ID_VENDOR_ENC=REHABTRONICS
E: ID_VENDOR_FROM_DATABASE=Maxim Integrated Products
E: ID_VENDOR_ID=0b6a
E: MAJOR=189
E: MINOR=17
E: PRODUCT=b6a/5346/1
E: SUBSYSTEM=usb
E: TYPE=255/255/255
E: USEC_INITIALIZED=2760968874

/etc/udev/rules.d/99-hid.rules我确实使用内容(及其变体)创建了一个 udev 规则:

SUBSYSTEM=="usb", ATTRS{idVendor}=="0b6a", MODE="0666"
KERNEL=="hidraw*", ATTRS{busnum}=="001", ATTRS{idVendor}=="0b6a", MODE="0666"

但这似乎没有做任何事情(即使在重新加载之后udevadm control --reload-rules 重新启动)。

我完全不知道在这里要做什么,其他 HID 设备工作得很好(例如,拔出和插入我的键盘会在 dmesg 中给出以下内容:)

[ 3329.994265] usb 1-2: USB disconnect, device number 11
[ 3332.283514] usb 1-2: new full-speed USB device number 19 using xhci_hcd
[ 3332.432917] usb 1-2: New USB device found, idVendor=2516, idProduct=0047
[ 3332.432923] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 3332.432927] usb 1-2: Product: MasterKeys Pro L White
[ 3332.432931] usb 1-2: Manufacturer: Cooler Master Technology Inc.
[ 3332.434839] input: Cooler Master Technology Inc. MasterKeys Pro L White as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:2516:0047.0011/input/input30
[ 3332.491698] hid-generic 0003:2516:0047.0011: input,hidraw3: USB HID v1.11 Keyboard [Cooler Master Technology Inc. MasterKeys Pro L White] on usb-0000:00:14.0-2/input0
[ 3332.492863] hid-generic 0003:2516:0047.0012: hiddev1,hidraw4: USB HID v1.11 Device [Cooler Master Technology Inc. MasterKeys Pro L White] on usb-0000:00:14.0-2/input1
[ 3332.494695] input: Cooler Master Technology Inc. MasterKeys Pro L White as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.2/0003:2516:0047.0013/input/input31
[ 3332.555443] hid-generic 0003:2516:0047.0013: input,hidraw5: USB HID v1.11 Keyboard [Cooler Master Technology Inc. MasterKeys Pro L White] on usb-0000:00:14.0-2/input2

关于如何将此设备识别为 HID 设备有什么建议吗?

谢谢!

相关内容