comando do sistema e pesquisa específica e mostra que

0

lsusb -v fornece uma resposta detalhada de dispositivos usb.

Exemplo:

Bus 003 Device 003: ID 413c:2003 Dell Computer Corp. Keyboard
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x413c Dell Computer Corp.
  idProduct          0x2003 Keyboard
  bcdDevice            3.06
  iManufacturer           1 
  iProduct                2 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           34
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower               70mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      1 Keyboard
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      65
         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     0x0008  1x 8 bytes
        bInterval              24

Agora, quero ver apenas a seção bInterfaceProtocol of Interface Descriptor para Bus 003 Device 003 device only ou quero listar esse bInterfaceProtocol content de todos os dispositivos usb.Pode alguém me informar algum formato específico para isso?

    
por ninja.stop 21.11.2014 / 10:07

1 resposta

0

Você não pode fazer isso usando lsusb apenas. Você pode:

  1. Use as opções -s ou -d para fazer lsusb mostra a saída apenas para dispositivos específicos:

    -s [[bus]:][devnum]
          Show only devices in specified bus and/or devnum.  Both ID's are
          given in decimal and may be omitted.
    
    -d [vendor]:[product]
          Show  only  devices  with  the  specified vendor and product ID.
          Both ID's are given in hexadecimal.
    
  2. E use grep para filtrar os campos.

Por exemplo:

$ lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 003 Device 004: ID 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 003 Device 002: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
$ lsusb -s 003:003
Bus 003 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
$ lsusb -s 003:003 -v | grep bInterfaceProtocol
  bInterfaceProtocol      0 Full speed (or root) hub
# lsusb -v | grep -e bInterfaceProtocol -e Bus
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
      bInterfaceProtocol      0 Full speed (or root) hub
Bus 003 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
      bInterfaceProtocol      0 Full speed (or root) hub
Bus 003 Device 004: ID 0e0f:0003 VMware, Inc. Virtual Mouse
      bInterfaceProtocol      2 Mouse
Bus 003 Device 002: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
      bInterfaceProtocol      0 Full speed (or root) hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
      bInterfaceProtocol      0 Full speed (or root) hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
      bInterfaceProtocol      0 Full speed (or root) hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
      bInterfaceProtocol      0 Full speed (or root) hub
    
por muru 21.11.2014 / 10:30