diff options
Diffstat (limited to 'iphone.c')
| -rw-r--r-- | iphone.c | 16 |
1 files changed, 12 insertions, 4 deletions
| @@ -114,7 +114,7 @@ static int clients = 0; | |||
| 114 | 114 | ||
| 115 | /** | 115 | /** |
| 116 | */ | 116 | */ |
| 117 | int toto_debug = 0; | 117 | int toto_debug = 1; |
| 118 | void log_debug_msg(const char *format, ...) | 118 | void log_debug_msg(const char *format, ...) |
| 119 | { | 119 | { |
| 120 | #ifndef STRIP_DEBUG_CODE | 120 | #ifndef STRIP_DEBUG_CODE |
| @@ -124,7 +124,7 @@ void log_debug_msg(const char *format, ...) | |||
| 124 | va_start(args, format); | 124 | va_start(args, format); |
| 125 | 125 | ||
| 126 | if (toto_debug) | 126 | if (toto_debug) |
| 127 | fprintf(stderr, format, args); | 127 | vfprintf(stderr, format, args); |
| 128 | 128 | ||
| 129 | va_end(args); | 129 | va_end(args); |
| 130 | 130 | ||
| @@ -215,6 +215,12 @@ static iphone_error_t iphone_config_usb_device(iphone_device_t phone) | |||
| 215 | int bytes; | 215 | int bytes; |
| 216 | char buf[512]; | 216 | char buf[512]; |
| 217 | 217 | ||
| 218 | log_debug_msg("checking configuration...\n"); | ||
| 219 | if (phone->__device->config->bConfigurationValue != 3) { | ||
| 220 | log_debug_msg("WARNING: usb device configuration is not 3 as expected!\n"); | ||
| 221 | } | ||
| 222 | |||
| 223 | #if 0 | ||
| 218 | log_debug_msg("setting configuration...\n"); | 224 | log_debug_msg("setting configuration...\n"); |
| 219 | ret = usb_set_configuration(phone->device, 3); | 225 | ret = usb_set_configuration(phone->device, 3); |
| 220 | if (ret != 0) { | 226 | if (ret != 0) { |
| @@ -242,6 +248,7 @@ static iphone_error_t iphone_config_usb_device(iphone_device_t phone) | |||
| 242 | } else { | 248 | } else { |
| 243 | log_debug_msg("done.\n"); | 249 | log_debug_msg("done.\n"); |
| 244 | } | 250 | } |
| 251 | #endif | ||
| 245 | 252 | ||
| 246 | log_debug_msg("claiming interface... "); | 253 | log_debug_msg("claiming interface... "); |
| 247 | ret = usb_claim_interface(phone->device, 1); | 254 | ret = usb_claim_interface(phone->device, 1); |
| @@ -307,8 +314,9 @@ iphone_error_t iphone_get_specific_device(int bus_n, int dev_n, iphone_device_t | |||
| 307 | if (dev->devnum == dev_n) { | 314 | if (dev->devnum == dev_n) { |
| 308 | phone->__device = dev; | 315 | phone->__device = dev; |
| 309 | phone->device = usb_open(phone->__device); | 316 | phone->device = usb_open(phone->__device); |
| 310 | iphone_config_usb_device(phone); | 317 | if (iphone_config_usb_device(phone) == IPHONE_E_SUCCESS) { |
| 311 | goto found; | 318 | goto found; |
| 319 | } | ||
| 312 | } | 320 | } |
| 313 | 321 | ||
| 314 | iphone_free_device(phone); | 322 | iphone_free_device(phone); |
