summaryrefslogtreecommitdiffstats
path: root/libirecovery.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2012-07-04 21:13:51 +0200
committerGravatar Nikias Bassen2012-07-04 21:13:51 +0200
commit737506dd7462036bd5edd7cf69c4f1fa100afebb (patch)
tree6b3ff1a1e3f4b47fd0d70a6c75e5a65a440ebdc7 /libirecovery.c
parentf2aeb3b87a43ee00c8c512fa132ea79ff02be3e8 (diff)
downloadlibirecovery-737506dd7462036bd5edd7cf69c4f1fa100afebb.tar.gz
libirecovery-737506dd7462036bd5edd7cf69c4f1fa100afebb.tar.bz2
irecv_send_buffer: transfer init and notify finish for DFU mode
Diffstat (limited to 'libirecovery.c')
-rw-r--r--libirecovery.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libirecovery.c b/libirecovery.c
index aa676a0..b83a8d2 100644
--- a/libirecovery.c
+++ b/libirecovery.c
@@ -923,7 +923,12 @@ irecv_error_t irecv_send_buffer(irecv_client_t client, unsigned char* buffer, un
if (recovery_mode) {
error = irecv_control_transfer(client, 0x41, 0, 0, 0, NULL, 0, USB_TIMEOUT);
} else {
- error = irecv_control_transfer(client, 0x21, 4, 0, 0, NULL, 0, USB_TIMEOUT);
+ char dump[4];
+ if (irecv_control_transfer(client, 0xa1, 5, 0, 0, dump, 1, USB_TIMEOUT) == 1) {
+ error = IRECV_E_SUCCESS;
+ } else {
+ error = IRECV_E_USB_UPLOAD;
+ }
}
if (error != IRECV_E_SUCCESS) {
return error;
@@ -1010,9 +1015,9 @@ irecv_error_t irecv_send_buffer(irecv_client_t client, unsigned char* buffer, un
}
if (dfuNotifyFinished && !recovery_mode) {
- irecv_control_transfer(client, 0x21, 1, 0, 0, (unsigned char*) buffer, 0, USB_TIMEOUT);
+ irecv_control_transfer(client, 0x21, 1, packets, 0, (unsigned char*) buffer, 0, USB_TIMEOUT);
- for (i = 0; i < 3; i++) {
+ for (i = 0; i < 2; i++) {
error = irecv_get_status(client, &status);
if (error != IRECV_E_SUCCESS) {
return error;