summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2010-07-16 18:14:32 +0200
committerGravatar Martin Szulecki2010-07-16 18:14:32 +0200
commit90560fc1ff9298f2a32e11d6b35a50542d2a2080 (patch)
tree45a0b48272077a798aafaf89c8661f7241d070c7 /src
parente89c9418e7072d5a1491055c8f78748bf82de49c (diff)
downloadlibirecovery-90560fc1ff9298f2a32e11d6b35a50542d2a2080.tar.gz
libirecovery-90560fc1ff9298f2a32e11d6b35a50542d2a2080.tar.bz2
Set verbose flag before opening a connection and fix some debug messages
Diffstat (limited to 'src')
-rw-r--r--src/irecovery.c4
-rw-r--r--src/libirecovery.c7
2 files changed, 6 insertions, 5 deletions
diff --git a/src/irecovery.c b/src/irecovery.c
index 0e981cd..415c20e 100644
--- a/src/irecovery.c
+++ b/src/irecovery.c
@@ -276,6 +276,8 @@ int main(int argc, char** argv) {
}
}
+ if (verbose) irecv_set_debug_level(verbose);
+
irecv_client_t client = NULL;
for (i = 0; i <= 5; i++) {
debug("Attempting to connect... \n");
@@ -290,8 +292,6 @@ int main(int argc, char** argv) {
}
}
- if (verbose) irecv_set_debug_level(verbose);
-
switch (action) {
case kResetDevice:
irecv_reset(client);
diff --git a/src/libirecovery.c b/src/libirecovery.c
index dd5c734..b44cea5 100644
--- a/src/libirecovery.c
+++ b/src/libirecovery.c
@@ -60,6 +60,8 @@ irecv_error_t irecv_open(irecv_client_t* pclient) {
usb_descriptor.idProduct == kRecoveryMode4 ||
usb_descriptor.idProduct == kDfuMode) {
+ debug("opening device %04x:%04x...\n", usb_descriptor.idVendor, usb_descriptor.idProduct);
+
libusb_open(usb_device, &usb_handle);
if (usb_handle == NULL) {
libusb_free_device_list(usb_device_list, 1);
@@ -105,7 +107,7 @@ irecv_error_t irecv_set_configuration(irecv_client_t client, int configuration)
return IRECV_E_NO_DEVICE;
}
- debug("Setting to configuration %d", configuration);
+ debug("Setting to configuration %d\n", configuration);
int current = 0;
libusb_get_configuration(client->handle, &current);
@@ -128,7 +130,7 @@ irecv_error_t irecv_set_interface(irecv_client_t client, int interface, int alt_
return IRECV_E_SUCCESS;
}
- debug("Setting to interface %d:%d", interface, alt_interface);
+ debug("Setting to interface %d:%d\n", interface, alt_interface);
if (libusb_claim_interface(client->handle, interface) < 0) {
return IRECV_E_USB_INTERFACE;
}
@@ -330,7 +332,6 @@ irecv_error_t irecv_get_status(irecv_client_t client, unsigned int* status) {
return IRECV_E_USB_STATUS;
}
- debug("status: %d\n", (unsigned int) buffer[4]);
*status = (unsigned int) buffer[4];
return IRECV_E_SUCCESS;
}