Search code examples
linuxuriipod

Weird URI string displayed on mounting iPod


I have written a small program to detect whenever a device is mounted on a desktop running Linux. I have used GIO for this. I am extracting the URI of the mounted resource and displaying it to the user. When I put in a CD I get a URI string which looks like file:///media/cdrom0/ which I can understand. But when I mount an iPod the URI I see is something like gphoto2://[usb:002,028]. What does this mean? I have observed that the second number (028) keeps increasing every time I take the device out and plug it back in. Can some one interpret this URI for me?

Update: As shodanex answered, the two numbers are the bus number and device number respectively. gphoto2:// indicates the protocol (PTP/MTP).


Solution

  • gphoto2://[usb:002,028]

    I guess 002 is the bus number, and 28 is the adress of the device on that bus. It maps to the second and fourth field of the lsusb util output. Here is an example on my system :

    Bus 001 Device 015: ID 05e3:0715 Genesys Logic, Inc. USB 2.0 microSD Reader
    

    I guess it would translate to :

    usb:001,015