summaryrefslogtreecommitdiffstats
path: root/src/iphone.c
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2009-04-13 23:11:39 +0200
committerGravatar Matt Colyer2009-04-19 15:06:46 -0700
commitded57a40188e0c07fac91719dd6bfd8ca44c423e (patch)
tree99100c76202aa3a4ae5768ff9843e52b89da47fa /src/iphone.c
parent5a72d346c12cee531e07fbad3c3481f1e53c9ace (diff)
downloadlibimobiledevice-ded57a40188e0c07fac91719dd6bfd8ca44c423e.tar.gz
libimobiledevice-ded57a40188e0c07fac91719dd6bfd8ca44c423e.tar.bz2
Make usb bus enumeration work reliably for iphone_get_specific_device
[#28 state:resolved] Signed-off-by: Matt Colyer <matt@colyer.name>
Diffstat (limited to 'src/iphone.c')
-rw-r--r--src/iphone.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/iphone.c b/src/iphone.c
index 5076b48..3c3034e 100644
--- a/src/iphone.c
+++ b/src/iphone.c
@@ -121,9 +121,9 @@ iphone_error_t iphone_get_specific_device(unsigned int bus_n, int dev_n, iphone_
121 121
122 // Set the device configuration 122 // Set the device configuration
123 for (bus = busses; bus; bus = bus->next) 123 for (bus = busses; bus; bus = bus->next)
124 if (bus->location == bus_n) 124 if (strtoul(bus->dirname, NULL, 10) == bus_n)
125 for (dev = bus->devices; dev != NULL; dev = dev->next) 125 for (dev = bus->devices; dev != NULL; dev = dev->next)
126 if (dev->devnum == dev_n) { 126 if (strtol(dev->filename, NULL, 10) == dev_n) {
127 phone->__device = dev; 127 phone->__device = dev;
128 phone->device = usb_open(phone->__device); 128 phone->device = usb_open(phone->__device);
129 iphone_config_usb_device(phone); 129 iphone_config_usb_device(phone);
@@ -210,7 +210,7 @@ iphone_error_t iphone_get_device(iphone_device_t * device)
210 for (dev = bus->devices; dev != NULL; dev = dev->next) 210 for (dev = bus->devices; dev != NULL; dev = dev->next)
211 if (dev->descriptor.idVendor == 0x05ac 211 if (dev->descriptor.idVendor == 0x05ac
212 && dev->descriptor.idProduct >= 0x1290 && dev->descriptor.idProduct <= 0x1293) 212 && dev->descriptor.idProduct >= 0x1290 && dev->descriptor.idProduct <= 0x1293)
213 return iphone_get_specific_device(bus->location, dev->devnum, device); 213 return iphone_get_specific_device(strtoul(bus->dirname, NULL, 10), strtol(dev->filename, NULL, 10), device);
214 214
215 return IPHONE_E_NO_DEVICE; 215 return IPHONE_E_NO_DEVICE;
216} 216}