Ícone do site Daniel Sobrinho

Pegando informações da porta USB

Com o comando lsusb você verá o caminho para o dispositivo:

~$ lsusb

Bus 00x Device 00y: ID ……………….

Acrescentando os atributos ao comando você terá informações detalhadas:

~$ lsusb -v -s 00x:00y

Bus 001 Device 005: ID 22b8:2e83 Motorola PCS 
 Device Descriptor:
   bLength                18
   bDescriptorType         1
   bcdUSB               2.00
   bDeviceClass            0 (Defined at Interface level)
   bDeviceSubClass         0 
   bDeviceProtocol         0 
   bMaxPacketSize0        64
   idVendor           0x22b8 Motorola PCS
   idProduct          0x2e83 
   bcdDevice           ff.ff
   iManufacturer           1 motorola
   iProduct                2 MotoG3
   iSerial                 3 0016903665
   bNumConfigurations      1
   Configuration Descriptor:
     bLength                 9
     bDescriptorType         2
     wTotalLength           39
     bNumInterfaces          1
     bConfigurationValue     1
     iConfiguration          0 
     bmAttributes         0x80
       (Bus Powered)
     MaxPower              500mA
     Interface Descriptor:
       bLength                 9
       bDescriptorType         4
       bInterfaceNumber        0
       bAlternateSetting       0
       bNumEndpoints           3
       bInterfaceClass         6 Imaging
       bInterfaceSubClass      1 Still Image Capture
       bInterfaceProtocol      1 Picture Transfer Protocol (PIMA 15470)
       iInterface              5 PTP
       Endpoint Descriptor:
         bLength                 7
         bDescriptorType         5
         bEndpointAddress     0x81  EP 1 IN
         bmAttributes            2
           Transfer Type            Bulk
           Synch Type               None
           Usage Type               Data
         wMaxPacketSize     0x0200  1x 512 bytes
         bInterval               0
       Endpoint Descriptor:
         bLength                 7
         bDescriptorType         5
         bEndpointAddress     0x01  EP 1 OUT
         bmAttributes            2
           Transfer Type            Bulk
           Synch Type               None
           Usage Type               Data
         wMaxPacketSize     0x0200  1x 512 bytes
         bInterval               0
       Endpoint Descriptor:
         bLength                 7
         bDescriptorType         5
         bEndpointAddress     0x82  EP 2 IN
         bmAttributes            3
           Transfer Type            Interrupt
           Synch Type               None
           Usage Type               Data
         wMaxPacketSize     0x001c  1x 28 bytes
         bInterval               6
 Device Qualifier (for other device speed):
   bLength                10
   bDescriptorType         6
   bcdUSB               2.00
   bDeviceClass            0 (Defined at Interface level)
   bDeviceSubClass         0 
   bDeviceProtocol         0 
   bMaxPacketSize0        64
   bNumConfigurations      1
 Device Status:     0x0000
   (Bus Powered)

Verá por exemplo a corrente (amperagem/energia) máxima na porta, lembrando que a voltagem é 5 volts por padrão. Informação relevante para validar se a porta suporta um dispositivo.