Coder Social home page Coder Social logo

lshid's Introduction

lshid

PyPI version

Like lsusb, but for HID devices.

$ lshid
Device /dev/hidraw0: ID 08bb:2902 Burr-Brown from TI               USB Audio CODEC
Device /dev/hidraw5: ID 046d:405f Logitech Candy
Device /dev/hidraw4: ID 046d:4079 Logitech G Pro
Device /dev/hidraw3: ID 046d:c53a Logitech USB Receiver
Device /dev/hidraw2: ID 046d:c53a Logitech USB Receiver
Device /dev/hidraw1: ID 046d:c53a Logitech USB Receiver
Device /dev/hidraw13: ID 046d:c33c Logitech G513 Carbon Tactile
Device /dev/hidraw12: ID 046d:c33c Logitech G513 Carbon Tactile
$ lshid -v -s 4
Device /dev/hidraw4: ID 046d:4079 Logitech G Pro
Report Descriptor:
 Usage Page (Generic Desktop Controls)
 Usage (Keyboard)
 Collection (Application)
  Report ID (0x01)
  Report Count (8)
  Report Size (1)
  Logical Minimum (0)
  Logical Maximum (1)
  Usage Page (Keyboard/Keypad)
  Usage Minimum (224)
  Usage Maximum (231)
  Input (Data, Variable, Absolute, No Wrap, Linear, Preferred State, No Null position, Bit Field)
  Report Count (6)
  Report Size (8)
  Logical Minimum (0)
  Logical Maximum (255)
  Usage Page (Keyboard/Keypad)
  Usage Minimum (0)
  Usage Maximum (255)
  Input (Data, Array, Absolute)
  Report ID (0x0e)
  Usage Page (LED)
  Report Count (5)
  Report Size (1)
  Logical Minimum (0)
  Logical Maximum (1)
  Usage Minimum (1)
  Usage Maximum (5)
  Output (Data, Variable, Absolute, No Wrap, Linear, Preferred State, No Null position, Bit Field)
  Report Count (1)
  Report Size (3)
  Output (Constant, Array, Absolute)
 End Collection
 Usage Page (Generic Desktop Controls)
 Usage (Mouse)
 Collection (Application)
  Report ID (0x02)
  Usage (Pointer)
  Collection (Physical)
   Usage Page (Button)
   Usage Minimum (1)
   Usage Maximum (16)
   Logical Minimum (0)
   Logical Maximum (1)
   Report Count (16)
   Report Size (1)
   Input (Data, Variable, Absolute, No Wrap, Linear, Preferred State, No Null position, Bit Field)
   Usage Page (Generic Desktop Controls)
   Logical Minimum (32769)
   Logical Maximum (32767)
   Report Size (16)
   Report Count (2)
   Usage (X)
   Usage (Y)
   Input (Data, Variable, Relative, No Wrap, Linear, Preferred State, No Null position, Bit Field)
   Logical Minimum (129)
   Logical Maximum (127)
   Report Size (8)
   Report Count (1)
   Usage (Wheel)
   Input (Data, Variable, Relative, No Wrap, Linear, Preferred State, No Null position, Bit Field)
   Usage Page (Consumer)
   Usage (AC Pan)
   Report Count (1)
   Input (Data, Variable, Relative, No Wrap, Linear, Preferred State, No Null position, Bit Field)
  End Collection
 End Collection
 Usage Page (Vendor Page)
 Usage (0x0001)
 Collection (Application)
  Report ID (0x10)
  Report Size (8)
  Report Count (6)
  Logical Minimum (0)
  Logical Maximum (255)
  Usage (0x0001)
  Input (Data, Array, Absolute)
  Usage (0x0001)
  Output (Data, Array, Absolute)
 End Collection
 Usage Page (Vendor Page)
 Usage (0x0002)
 Collection (Application)
  Report ID (0x11)
  Report Size (8)
  Report Count (19)
  Logical Minimum (0)
  Logical Maximum (255)
  Usage (0x0002)
  Input (Data, Array, Absolute)
  Usage (0x0002)
  Output (Data, Array, Absolute)
 End Collection
 Usage Page (Vendor Page)
 Usage (0x0004)
 Collection (Application)
  Report ID (0x20)
  Report Size (8)
  Report Count (14)
  Logical Minimum (0)
  Logical Maximum (255)
  Usage (0x0041)
  Input (Data, Array, Absolute)
  Usage (0x0041)
  Output (Data, Array, Absolute)
  Report ID (0x21)
  Report Count (31)
  Logical Minimum (0)
  Logical Maximum (255)
  Usage (0x0042)
  Input (Data, Array, Absolute)
  Usage (0x0042)
  Output (Data, Array, Absolute)
 End Collection

lshid's People

Contributors

ffy00 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

lshid's Issues

Yubikey Touch U2F Security Key

looks like data parser has issues in case of unexpected response

hardware in question is - Yubikey Touch U2F Security Key

after installation on Ubuntu 20.04 LTS into venv space:

$ pip install lshid
Collecting lshid
  Downloading lshid-0.2.2-py3-none-any.whl (5.0 kB)
Collecting ioctl
  Downloading ioctl-0.2.2-py3-none-any.whl (4.4 kB)
Collecting hid-parser~=0.0.2
  Downloading hid_parser-0.0.3-py3-none-any.whl (22 kB)
Installing collected packages: ioctl, hid-parser, lshid
Successfully installed hid-parser-0.0.3 ioctl-0.2.2 lshid-0.2.2

running lshid gives

$ lshid
can't open '/dev/hidraw2': [Errno 13] Permission denied: '/dev/hidraw2'
can't open '/dev/hidraw1': [Errno 13] Permission denied: '/dev/hidraw1'
can't open '/dev/hidraw0': [Errno 13] Permission denied: '/dev/hidraw0'
Device /dev/hidraw3: ID 1050:0120 Yubico Security Key by Yubico

while running lsusb gives:

$ lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 06cb:00bd Synaptics, Inc. 
Bus 001 Device 003: ID 04f2:b67c Chicony Electronics Co., Ltd Integrated Camera
Bus 001 Device 019: ID 1050:0120 Yubico.com Yubikey Touch U2F Security Key
Bus 001 Device 016: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 005: ID 8087:0aaa Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

now if I run lsusb with sudo and -vvv keys on specific device (so I get maximum HW access and verbose details):

$ sudo lsusb -vvv -s 1:19

Bus 001 Device 019: ID 1050:0120 Yubico.com Yubikey Touch U2F Security Key
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x1050 Yubico.com
  idProduct          0x0120 Yubikey Touch U2F Security Key
  bcdDevice            5.27
  iManufacturer           1 Yubico
  iProduct                2 Security Key by Yubico
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0029
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower               30mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      34
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               2
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               2
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0000
  (Bus Powered)

while running lshid on specific devise, instead of same or more detailed output, it gives:

$ lshid -v -s 3
Device /dev/hidraw3: ID 1050:0120 Yubico Security Key by Yubico
Report Descriptor:
ERROR Expecting 64 usages but got 1

provided it sees it properly as ID, it's properly pointed HW device
is that parser mistake? should I uptick version of hid-parser?
or any other hint?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.