Skip to content

Instantly share code, notes, and snippets.

@patte
Last active November 6, 2022 02:02
Show Gist options
  • Save patte/34f0d73f30aa0d2f78d67c594f464259 to your computer and use it in GitHub Desktop.
Save patte/34f0d73f30aa0d2f78d67c594f464259 to your computer and use it in GitHub Desktop.
Logitech G502 X (HID, hidraw)

Logitech G502 X

https://www.logitechg.com/en-us/products/gaming-mice/g502-x-wired-lightforce.910-006136.html g502x

/sys/class/hidraw/hidraw2/device/uevent

DRIVER=hid-generic
HID_ID=0003:0000046D:0000C099
HID_NAME=Logitech G502 X
HID_PHYS=usb-0000:05:00.3-2/input1
HID_UNIQ=REDACTED
MODALIAS=hid:b0003g0001v0000046Dp0000C099

/sys/class/hidraw/hidraw2/device/report_descriptor | base64

BQEJBqEBhQEFBxngKecVACUBdQGVCIECgQOVBnUIFQAm/wAZACr/AIEAwAUMCQGhAYUDdRCVAhUB
JowCGQEqjAKBAMAFAQmAoQGFBHUClQEVASUDCYIJgQmDgWB1BoEDwAYA/wkBoQGFEHUIlQYVACb/
AAkBgQAJAZEAwAYA/wkCoQGFEXUIlRMVACb/AAkCgQAJApEAwA==

| base64 --decode | hidrd-convert -o spec

Usage Page (Desktop),                   ; Generic desktop controls (01h)
Usage (Keyboard),                       ; Keyboard (06h, application collection)
Collection (Application),
    Report ID (1),
    Usage Page (Keyboard),              ; Keyboard/keypad (07h)
    Usage Minimum (KB Leftcontrol),     ; Keyboard left control (E0h, dynamic value)
    Usage Maximum (KB Right GUI),       ; Keyboard right GUI (E7h, dynamic value)
    Logical Minimum (0),
    Logical Maximum (1),
    Report Size (1),
    Report Count (8),
    Input (Variable),
    Input (Constant, Variable),
    Report Count (6),
    Report Size (8),
    Logical Minimum (0),
    Logical Maximum (255),
    Usage Minimum (None),               ; No event (00h, selector)
    Usage Maximum (FFh),
    Input,
End Collection,
Usage Page (Consumer),                  ; Consumer (0Ch)
Usage (Consumer Control),               ; Consumer control (01h, application collection)
Collection (Application),
    Report ID (3),
    Report Size (16),
    Report Count (2),
    Logical Minimum (1),
    Logical Maximum (652),
    Usage Minimum (Consumer Control),   ; Consumer control (01h, application collection)
    Usage Maximum (AC Send),            ; AC send (028Ch, selector)
    Input,
End Collection,
Usage Page (Desktop),                   ; Generic desktop controls (01h)
Usage (Sys Control),                    ; System control (80h, application collection)
Collection (Application),
    Report ID (4),
    Report Size (2),
    Report Count (1),
    Logical Minimum (1),
    Logical Maximum (3),
    Usage (Sys Sleep),                  ; System sleep (82h, one-shot control)
    Usage (Sys Power Down),             ; System power down (81h, one-shot control)
    Usage (Sys Wake Up),                ; System wake up (83h, one-shot control)
    Input (No Preferred, Null State),
    Report Size (6),
    Input (Constant, Variable),
End Collection,
Usage Page (FF00h),                     ; FF00h, vendor-defined
Usage (01h),
Collection (Application),
    Report ID (16),
    Report Size (8),
    Report Count (6),
    Logical Minimum (0),
    Logical Maximum (255),
    Usage (01h),
    Input,
    Usage (01h),
    Output,
End Collection,
Usage Page (FF00h),                     ; FF00h, vendor-defined
Usage (02h),
Collection (Application),
    Report ID (17),
    Report Size (8),
    Report Count (19),
    Logical Minimum (0),
    Logical Maximum (255),
    Usage (02h),
    Input,
    Usage (02h),
    Output,
End Collection

lsusb

Bus 003 Device 003: ID 046d:c099 Logitech, Inc. G502 X

lsusb -vv -d 046d:c099

Bus 003 Device 003: ID 046d:c099 Logitech, Inc. G502 X
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x046d Logitech, Inc.
  idProduct          0xc099 
  bcdDevice           60.00
  iManufacturer           1 Logitech
  iProduct                2 G502 X
  iSerial                 3 REDACTED
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x003b
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          4 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              100mA
    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.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      83
         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     0x000d  1x 13 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     151
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0014  1x 20 bytes
        bInterval               1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment