Re: Automounting GVFS systems when devices are added?



On Tue, 2008-10-14 at 12:25 +0200, Alexander Larsson wrote:
> On Mon, 2008-10-13 at 14:47 -0700, Patrick Walton wrote:
> > Oh, and it doesn't support multiple iPhones or iPods at the moment, 
> > because the underlying libiphone doesn't support them. However, I agree 
> > that the URI should be in a form that allows us to support multiple 
> > devices in the future. 
> 
> I don't actually see why this is a problem. If you use one process per
> mount couldn't you just target each libiphone instance to the right
> iphone.

What Patrick meant was that the libiphone library doesn't support
handling a specific device. The code just looks for the first one on the
list, eg.:
        // Set the device configuration
        for (bus = busses; bus; bus = bus->next) {
                for (dev = bus->devices; dev; dev = dev->next) {
                        if (dev->descriptor.idVendor == 0x05ac &&
                                (dev->descriptor.idProduct == 0x1290 ||
                                 dev->descriptor.idProduct == 0x1291 || dev->descriptor.idProduct == 0x1292 || dev->descriptor.idProduct == 0x1293)
                                ) {
                                phone->__device = dev;
                                phone->device = usb_open(phone->__device);
                                usb_set_configuration(phone->device, 3); 
                                usb_claim_interface(phone->device, 1); 
                                break;
                        }
                }
                if (phone->__device && phone->device)
                        break;
        }

Fixing this code to handle one specific device is trivial though.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]