diff options
Diffstat (limited to 'src/iphone.c')
| -rw-r--r-- | src/iphone.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/iphone.c b/src/iphone.c index 457d919..6eb56f7 100644 --- a/src/iphone.c +++ b/src/iphone.c | |||
| @@ -38,6 +38,8 @@ | |||
| 38 | static void iphone_config_usb_device(iphone_device_t phone) | 38 | static void iphone_config_usb_device(iphone_device_t phone) |
| 39 | { | 39 | { |
| 40 | int ret; | 40 | int ret; |
| 41 | int bytes; | ||
| 42 | unsigned char buf[512]; | ||
| 41 | 43 | ||
| 42 | log_debug_msg("setting configuration... "); | 44 | log_debug_msg("setting configuration... "); |
| 43 | ret = usb_set_configuration(phone->device, 3); | 45 | ret = usb_set_configuration(phone->device, 3); |
| @@ -70,6 +72,14 @@ static void iphone_config_usb_device(iphone_device_t phone) | |||
| 70 | } else { | 72 | } else { |
| 71 | log_debug_msg("done.\n"); | 73 | log_debug_msg("done.\n"); |
| 72 | } | 74 | } |
| 75 | |||
| 76 | do { | ||
| 77 | bytes = usb_bulk_read(phone->device, BULKIN, (void *) &buf, 512, 800); | ||
| 78 | if (bytes > 0) { | ||
| 79 | log_debug_msg("iphone_config_usb_device: initial read returned %d bytes of data.\n", bytes); | ||
| 80 | log_debug_buffer(buf, bytes); | ||
| 81 | } | ||
| 82 | } while (bytes > 0); | ||
| 73 | } | 83 | } |
| 74 | 84 | ||
| 75 | /** | 85 | /** |
| @@ -219,12 +229,14 @@ iphone_error_t iphone_free_device(iphone_device_t device) | |||
| 219 | int bytes; | 229 | int bytes; |
| 220 | unsigned char buf[512]; | 230 | unsigned char buf[512]; |
| 221 | 231 | ||
| 222 | // read final package | 232 | // read final package(s) |
| 223 | bytes = usb_bulk_read(device->device, BULKIN, (void *) &buf, 512, 1000); | 233 | do { |
| 224 | if (bytes > 0) { | 234 | bytes = usb_bulk_read(device->device, BULKIN, (void *) &buf, 512, 800); |
| 225 | log_debug_msg("iphone_free_device: final read returned\n"); | 235 | if (bytes > 0) { |
| 226 | log_debug_buffer(buf, bytes); | 236 | log_debug_msg("iphone_free_device: final read returned\n"); |
| 227 | } | 237 | log_debug_buffer(buf, bytes); |
| 238 | } | ||
| 239 | } while (bytes > 0); | ||
| 228 | 240 | ||
| 229 | if (device->buffer) { | 241 | if (device->buffer) { |
| 230 | free(device->buffer); | 242 | free(device->buffer); |
