diff options
| author | 2009-09-12 19:44:51 +0200 | |
|---|---|---|
| committer | 2009-09-12 19:44:51 +0200 | |
| commit | e617375c3424ef341a172d05c58cfc4335049c44 (patch) | |
| tree | 7b47c6f2b6f2ffc9c96caf0abcad4bd0fe185d99 /tools/iphone_id.c | |
| parent | 1f6282ffddec7012df82fa929dfe72cfc74b063a (diff) | |
| download | libimobiledevice-e617375c3424ef341a172d05c58cfc4335049c44.tar.gz libimobiledevice-e617375c3424ef341a172d05c58cfc4335049c44.tar.bz2 | |
Update tools to use new API
Diffstat (limited to 'tools/iphone_id.c')
| -rw-r--r-- | tools/iphone_id.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/tools/iphone_id.c b/tools/iphone_id.c index ab36e7c..c9ae2db 100644 --- a/tools/iphone_id.c +++ b/tools/iphone_id.c | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | #include <stdlib.h> | 3 | #include <stdlib.h> |
| 4 | #include <libiphone/libiphone.h> | 4 | #include <libiphone/libiphone.h> |
| 5 | #include <libiphone/lockdown.h> | 5 | #include <libiphone/lockdown.h> |
| 6 | #include <usbmuxd.h> | ||
| 7 | 6 | ||
| 8 | #define MODE_NONE 0 | 7 | #define MODE_NONE 0 |
| 9 | #define MODE_SHOW_ID 1 | 8 | #define MODE_SHOW_ID 1 |
| @@ -18,7 +17,7 @@ static void print_usage(int argc, char **argv) | |||
| 18 | printf("Prints device name or a list of attached iPhone/iPod Touch devices.\n\n"); | 17 | printf("Prints device name or a list of attached iPhone/iPod Touch devices.\n\n"); |
| 19 | printf(" The UUID is a 40-digit hexadecimal number of the device\n"); | 18 | printf(" The UUID is a 40-digit hexadecimal number of the device\n"); |
| 20 | printf(" for which the name should be retrieved.\n\n"); | 19 | printf(" for which the name should be retrieved.\n\n"); |
| 21 | printf(" -l, --list\t\tlist all attached devices\n"); | 20 | printf(" -l, --list\t\tlist UUID of all attached devices\n"); |
| 22 | printf(" -d, --debug\t\tenable communication debugging\n"); | 21 | printf(" -d, --debug\t\tenable communication debugging\n"); |
| 23 | printf(" -h, --help\t\tprints usage information\n"); | 22 | printf(" -h, --help\t\tprints usage information\n"); |
| 24 | printf("\n"); | 23 | printf("\n"); |
| @@ -28,7 +27,7 @@ int main(int argc, char **argv) | |||
| 28 | { | 27 | { |
| 29 | iphone_device_t phone = NULL; | 28 | iphone_device_t phone = NULL; |
| 30 | lockdownd_client_t client = NULL; | 29 | lockdownd_client_t client = NULL; |
| 31 | usbmuxd_device_info_t *dev_list; | 30 | char **dev_list = NULL; |
| 32 | char *devname = NULL; | 31 | char *devname = NULL; |
| 33 | int ret = 0; | 32 | int ret = 0; |
| 34 | int i; | 33 | int i; |
| @@ -96,14 +95,14 @@ int main(int argc, char **argv) | |||
| 96 | return ret; | 95 | return ret; |
| 97 | case MODE_LIST_DEVICES: | 96 | case MODE_LIST_DEVICES: |
| 98 | default: | 97 | default: |
| 99 | if (usbmuxd_get_device_list(&dev_list) < 0) { | 98 | if (iphone_get_device_list(&dev_list, &i) < 0) { |
| 100 | fprintf(stderr, "ERROR: usbmuxd is not running!\n"); | 99 | fprintf(stderr, "ERROR: Unable to retrieve device list!\n"); |
| 101 | return -1; | 100 | return -1; |
| 102 | } | 101 | } |
| 103 | for (i = 0; dev_list[i].handle > 0; i++) { | 102 | for (i = 0; dev_list[i] != NULL; i++) { |
| 104 | printf("handle=%d product_id=%04x uuid=%s\n", dev_list[i].handle, dev_list[i].product_id, dev_list[i].uuid); | 103 | printf("%s\n", dev_list[i]); |
| 105 | } | 104 | } |
| 106 | usbmuxd_free_device_list(dev_list); | 105 | iphone_free_device_list(dev_list); |
| 107 | return 0; | 106 | return 0; |
| 108 | } | 107 | } |
| 109 | } | 108 | } |
