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
923 if (recovery_mode) { 923 if (recovery_mode) {
924 error = irecv_control_transfer(client, 0x41, 0, 0, 0, NULL, 0, USB_TIMEOUT); 924 error = irecv_control_transfer(client, 0x41, 0, 0, 0, NULL, 0, USB_TIMEOUT);
925 } else { 925 } else {
926 error = irecv_control_transfer(client, 0x21, 4, 0, 0, NULL, 0, USB_TIMEOUT); 926 char dump[4];
927 if (irecv_control_transfer(client, 0xa1, 5, 0, 0, dump, 1, USB_TIMEOUT) == 1) {
928 error = IRECV_E_SUCCESS;
929 } else {
930 error = IRECV_E_USB_UPLOAD;
931 }
927 } 932 }
928 if (error != IRECV_E_SUCCESS) { 933 if (error != IRECV_E_SUCCESS) {
929 return error; 934 return error;
@@ -1010,9 +1015,9 @@ irecv_error_t irecv_send_buffer(irecv_client_t client, unsigned char* buffer, un
1010 } 1015 }
1011 1016
1012 if (dfuNotifyFinished && !recovery_mode) { 1017 if (dfuNotifyFinished && !recovery_mode) {
1013 irecv_control_transfer(client, 0x21, 1, 0, 0, (unsigned char*) buffer, 0, USB_TIMEOUT); 1018 irecv_control_transfer(client, 0x21, 1, packets, 0, (unsigned char*) buffer, 0, USB_TIMEOUT);
1014 1019
1015 for (i = 0; i < 3; i++) { 1020 for (i = 0; i < 2; i++) {
1016 error = irecv_get_status(client, &status); 1021 error = irecv_get_status(client, &status);
1017 if (error != IRECV_E_SUCCESS) { 1022 if (error != IRECV_E_SUCCESS) {
1018 return error; 1023 return error;