summaryrefslogtreecommitdiffstats
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
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>
-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_
// Set the device configuration
for (bus = busses; bus; bus = bus->next)
- if (bus->location == bus_n)
+ if (strtoul(bus->dirname, NULL, 10) == bus_n)
for (dev = bus->devices; dev != NULL; dev = dev->next)
- if (dev->devnum == dev_n) {
+ if (strtol(dev->filename, NULL, 10) == dev_n) {
phone->__device = dev;
phone->device = usb_open(phone->__device);
iphone_config_usb_device(phone);
@@ -210,7 +210,7 @@ iphone_error_t iphone_get_device(iphone_device_t * device)
for (dev = bus->devices; dev != NULL; dev = dev->next)
if (dev->descriptor.idVendor == 0x05ac
&& dev->descriptor.idProduct >= 0x1290 && dev->descriptor.idProduct <= 0x1293)
- return iphone_get_specific_device(bus->location, dev->devnum, device);
+ return iphone_get_specific_device(strtoul(bus->dirname, NULL, 10), strtol(dev->filename, NULL, 10), device);
return IPHONE_E_NO_DEVICE;
}