hanwen / go-mtpfs

Mount MTP devices over FUSE
Other
680 stars 85 forks source link

Support for non-hierarchical storage #126

Closed bezineb5 closed 6 years ago

bezineb5 commented 6 years ago

Mounts non-hierarchical storage.

Seems to be working well, I tested on a panono camera.

googlebot commented 6 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


bezineb5 commented 6 years ago

I signed it!

googlebot commented 6 years ago

CLAs look good, thanks!

hanwen commented 6 years ago

can you tell me what type the device says it is?

I want to know what FilesystemType is in

https://github.com/hanwen/go-mtpfs/blob/eeb4cce46870f2b57043fca50ea5bc680e72ec8a/mtp/types.go#L119

bezineb5 commented 6 years ago

I inspected the USB device - here are the results. I hope it answers your question:

ben@raspberrypi3:~ $ lsusb -D /dev/bus/usb/001/026
Device: ID 2bda:2000  
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x2bda 
  idProduct          0x2000 
  bcdDevice            3.12
  iManufacturer           1 Panono
  iProduct                2 Panono-GTFR4T
  iSerial                 3 GTFR4T
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           39
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          4 FunctionFS
    bmAttributes         0xc0
      Self Powered
    MaxPower                2mA
    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 MTP
      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              10
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:     0x0001
  Self Powered
hanwen commented 6 years ago

lsusb won't tell. You have to send it a GetStorageInfo MTP request.

The easiest is to add a println to the code snippet I mentioned above.

bezineb5 commented 6 years ago

Then the answer is "3". I hope this helps!

bezineb5 commented 6 years ago

In the light of your remark, I'm going to update my PR to handle the DCF case properly.