diff options
| author | 2010-05-13 15:10:40 -0400 | |
|---|---|---|
| committer | 2010-05-13 15:10:40 -0400 | |
| commit | a814b04770dc83774cd705d2fc8993f24e504a01 (patch) | |
| tree | 3354669aab557d16eea95373538152c311142ca4 /src/irecovery.c | |
| parent | 520c99d33e18009660f30bd38b31a2f1cd432fe6 (diff) | |
| download | libirecovery-a814b04770dc83774cd705d2fc8993f24e504a01.tar.gz libirecovery-a814b04770dc83774cd705d2fc8993f24e504a01.tar.bz2 | |
Implemented irecv_get_status() to return current iphone usb "state".
Implemented irecv_send_buffer() to upload a buffer to the device load address.
Implemented irecv_send_file() to read a file into memory and pass the buffer into irecv_send_buffer()
Diffstat (limited to 'src/irecovery.c')
| -rw-r--r-- | src/irecovery.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/irecovery.c b/src/irecovery.c index 51320a5..3091319 100644 --- a/src/irecovery.c +++ b/src/irecovery.c | |||
| @@ -22,7 +22,7 @@ | |||
| 22 | #include <libirecovery.h> | 22 | #include <libirecovery.h> |
| 23 | 23 | ||
| 24 | enum { | 24 | enum { |
| 25 | kResetDevice, kSendCommand | 25 | kResetDevice, kSendCommand, kSendFile |
| 26 | }; | 26 | }; |
| 27 | 27 | ||
| 28 | void print_usage() { | 28 | void print_usage() { |
| @@ -51,8 +51,13 @@ int main(int argc, char** argv) { | |||
| 51 | break; | 51 | break; |
| 52 | 52 | ||
| 53 | case 'c': | 53 | case 'c': |
| 54 | argument = optarg; | ||
| 55 | action = kSendCommand; | 54 | action = kSendCommand; |
| 55 | argument = optarg; | ||
| 56 | break; | ||
| 57 | |||
| 58 | case 'f': | ||
| 59 | action = kSendFile; | ||
| 60 | argument = optarg; | ||
| 56 | break; | 61 | break; |
| 57 | 62 | ||
| 58 | default: | 63 | default: |
| @@ -77,8 +82,12 @@ int main(int argc, char** argv) { | |||
| 77 | irecv_reset(device); | 82 | irecv_reset(device); |
| 78 | break; | 83 | break; |
| 79 | 84 | ||
| 85 | case kSendFile: | ||
| 86 | irecv_send_file(device, argument); | ||
| 87 | break; | ||
| 88 | |||
| 80 | case kSendCommand: | 89 | case kSendCommand: |
| 81 | irecv_command(device, argument); | 90 | irecv_send_command(device, argument); |
| 82 | break; | 91 | break; |
| 83 | 92 | ||
| 84 | default: | 93 | default: |
