diff options
| author | 2024-01-04 15:59:54 +0100 | |
|---|---|---|
| committer | 2024-01-04 15:59:54 +0100 | |
| commit | 29592eb6cae8b25b214aa1e3cfb6ef4a6d555d43 (patch) | |
| tree | 43fb398f74498ef24b31b549743d225d284bf009 /tools | |
| parent | 15fdc6ae46884208ef060dc84e32daa15e20ded8 (diff) | |
| download | libirecovery-29592eb6cae8b25b214aa1e3cfb6ef4a6d555d43.tar.gz libirecovery-29592eb6cae8b25b214aa1e3cfb6ef4a6d555d43.tar.bz2 | |
Initialize KIS device in device callback
Also, print the detailed mode in irecovery -q and -m output.
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/irecovery.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/tools/irecovery.c b/tools/irecovery.c index 34e80bf..5546ac2 100644 --- a/tools/irecovery.c +++ b/tools/irecovery.c | |||
| @@ -179,7 +179,14 @@ static void print_device_info(irecv_client_t client) | |||
| 179 | 179 | ||
| 180 | ret = irecv_get_mode(client, &mode); | 180 | ret = irecv_get_mode(client, &mode); |
| 181 | if (ret == IRECV_E_SUCCESS) { | 181 | if (ret == IRECV_E_SUCCESS) { |
| 182 | printf("MODE: %s\n", mode_to_str(mode)); | 182 | switch (devinfo->pid) { |
| 183 | case 0x1881: | ||
| 184 | printf("MODE: DFU via Debug USB (KIS)\n"); | ||
| 185 | break; | ||
| 186 | default: | ||
| 187 | printf("MODE: %s\n", mode_to_str(mode)); | ||
| 188 | break; | ||
| 189 | } | ||
| 183 | } | 190 | } |
| 184 | 191 | ||
| 185 | irecv_devices_get_device_by_client(client, &device); | 192 | irecv_devices_get_device_by_client(client, &device); |
| @@ -630,11 +637,16 @@ int main(int argc, char* argv[]) | |||
| 630 | } | 637 | } |
| 631 | break; | 638 | break; |
| 632 | 639 | ||
| 633 | case kShowMode: | 640 | case kShowMode: { |
| 641 | const struct irecv_device_info *devinfo = irecv_get_device_info(client); | ||
| 634 | irecv_get_mode(client, &mode); | 642 | irecv_get_mode(client, &mode); |
| 635 | printf("%s Mode\n", mode_to_str(mode)); | 643 | printf("%s Mode", mode_to_str(mode)); |
| 644 | if (devinfo->pid == 0x1881) { | ||
| 645 | printf(" via Debug USB (KIS)"); | ||
| 646 | } | ||
| 647 | printf("\n"); | ||
| 636 | break; | 648 | break; |
| 637 | 649 | } | |
| 638 | case kRebootToNormalMode: | 650 | case kRebootToNormalMode: |
| 639 | error = irecv_setenv(client, "auto-boot", "true"); | 651 | error = irecv_setenv(client, "auto-boot", "true"); |
| 640 | if (error != IRECV_E_SUCCESS) { | 652 | if (error != IRECV_E_SUCCESS) { |
