diff options
| author | 2009-09-12 19:44:51 +0200 | |
|---|---|---|
| committer | 2009-09-12 19:44:51 +0200 | |
| commit | e617375c3424ef341a172d05c58cfc4335049c44 (patch) | |
| tree | 7b47c6f2b6f2ffc9c96caf0abcad4bd0fe185d99 | |
| parent | 1f6282ffddec7012df82fa929dfe72cfc74b063a (diff) | |
| download | libimobiledevice-e617375c3424ef341a172d05c58cfc4335049c44.tar.gz libimobiledevice-e617375c3424ef341a172d05c58cfc4335049c44.tar.bz2 | |
Update tools to use new API
| -rw-r--r-- | dev/afccheck.c | 2 | ||||
| -rw-r--r-- | dev/iphoneclient.c | 4 | ||||
| -rw-r--r-- | dev/iphoneenterrecovery.c | 2 | ||||
| -rw-r--r-- | dev/lckdclient.c | 2 | ||||
| -rw-r--r-- | dev/msyncclient.c | 2 | ||||
| -rw-r--r-- | tools/iphone_id.c | 15 | ||||
| -rw-r--r-- | tools/iphonesyslog.c | 1 |
7 files changed, 13 insertions, 15 deletions
diff --git a/dev/afccheck.c b/dev/afccheck.c index b3fa102..88935a0 100644 --- a/dev/afccheck.c +++ b/dev/afccheck.c | |||
| @@ -104,7 +104,7 @@ int main(int argc, char *argv[]) | |||
| 104 | iphone_set_debug_mask(DBGMASK_NONE); | 104 | iphone_set_debug_mask(DBGMASK_NONE); |
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | if (IPHONE_E_SUCCESS != iphone_get_device(&phone)) { | 107 | if (IPHONE_E_SUCCESS != iphone_device_new(&phone, NULL)) { |
| 108 | printf("No iPhone found, is it plugged in?\n"); | 108 | printf("No iPhone found, is it plugged in?\n"); |
| 109 | return 1; | 109 | return 1; |
| 110 | } | 110 | } |
diff --git a/dev/iphoneclient.c b/dev/iphoneclient.c index bb5dfdd..d62d23f 100644 --- a/dev/iphoneclient.c +++ b/dev/iphoneclient.c | |||
| @@ -20,9 +20,9 @@ | |||
| 20 | */ | 20 | */ |
| 21 | 21 | ||
| 22 | #include <stdio.h> | 22 | #include <stdio.h> |
| 23 | #include <stdlib.h> | ||
| 23 | #include <string.h> | 24 | #include <string.h> |
| 24 | #include <errno.h> | 25 | #include <errno.h> |
| 25 | #include <usb.h> | ||
| 26 | #include <glib.h> | 26 | #include <glib.h> |
| 27 | 27 | ||
| 28 | #include <libiphone/libiphone.h> | 28 | #include <libiphone/libiphone.h> |
| @@ -75,7 +75,7 @@ int main(int argc, char *argv[]) | |||
| 75 | iphone_set_debug_mask(DBGMASK_NONE); | 75 | iphone_set_debug_mask(DBGMASK_NONE); |
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | if (IPHONE_E_SUCCESS != iphone_get_device(&phone)) { | 78 | if (IPHONE_E_SUCCESS != iphone_device_new(&phone, NULL)) { |
| 79 | printf("No iPhone found, is it plugged in?\n"); | 79 | printf("No iPhone found, is it plugged in?\n"); |
| 80 | return -1; | 80 | return -1; |
| 81 | } | 81 | } |
diff --git a/dev/iphoneenterrecovery.c b/dev/iphoneenterrecovery.c index 2f7891c..1d4d332 100644 --- a/dev/iphoneenterrecovery.c +++ b/dev/iphoneenterrecovery.c | |||
| @@ -68,7 +68,7 @@ int main(int argc, char *argv[]) | |||
| 68 | } | 68 | } |
| 69 | strcpy(uuid, argv[i]); | 69 | strcpy(uuid, argv[i]); |
| 70 | 70 | ||
| 71 | ret = iphone_get_device_by_uuid(&phone, uuid); | 71 | ret = iphone_device_new(&phone, uuid); |
| 72 | if (ret != IPHONE_E_SUCCESS) { | 72 | if (ret != IPHONE_E_SUCCESS) { |
| 73 | printf("No device found with uuid %s, is it plugged in?\n", uuid); | 73 | printf("No device found with uuid %s, is it plugged in?\n", uuid); |
| 74 | return -1; | 74 | return -1; |
diff --git a/dev/lckdclient.c b/dev/lckdclient.c index b880253..d866435 100644 --- a/dev/lckdclient.c +++ b/dev/lckdclient.c | |||
| @@ -36,7 +36,7 @@ int main(int argc, char *argv[]) | |||
| 36 | 36 | ||
| 37 | iphone_set_debug_level(1); | 37 | iphone_set_debug_level(1); |
| 38 | 38 | ||
| 39 | if (IPHONE_E_SUCCESS != iphone_get_device(&phone)) { | 39 | if (IPHONE_E_SUCCESS != iphone_device_new(&phone, NULL)) { |
| 40 | printf("No iPhone found, is it plugged in?\n"); | 40 | printf("No iPhone found, is it plugged in?\n"); |
| 41 | return -1; | 41 | return -1; |
| 42 | } | 42 | } |
diff --git a/dev/msyncclient.c b/dev/msyncclient.c index 5fffe7a..4b27eb7 100644 --- a/dev/msyncclient.c +++ b/dev/msyncclient.c | |||
| @@ -136,7 +136,7 @@ int main(int argc, char *argv[]) | |||
| 136 | if (argc > 1 && !strcasecmp(argv[1], "--debug")) | 136 | if (argc > 1 && !strcasecmp(argv[1], "--debug")) |
| 137 | iphone_set_debug_mask(DBGMASK_MOBILESYNC); | 137 | iphone_set_debug_mask(DBGMASK_MOBILESYNC); |
| 138 | 138 | ||
| 139 | if (IPHONE_E_SUCCESS != iphone_get_device(&phone)) { | 139 | if (IPHONE_E_SUCCESS != iphone_device_new(&phone, NULL)) { |
| 140 | printf("No iPhone found, is it plugged in?\n"); | 140 | printf("No iPhone found, is it plugged in?\n"); |
| 141 | return -1; | 141 | return -1; |
| 142 | } | 142 | } |
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 | } |
diff --git a/tools/iphonesyslog.c b/tools/iphonesyslog.c index 10b3fb6..8fa3b04 100644 --- a/tools/iphonesyslog.c +++ b/tools/iphonesyslog.c | |||
| @@ -51,7 +51,6 @@ int main(int argc, char *argv[]) | |||
| 51 | char uuid[41]; | 51 | char uuid[41]; |
| 52 | int port = 0; | 52 | int port = 0; |
| 53 | uuid[0] = 0; | 53 | uuid[0] = 0; |
| 54 | uint32_t handle = 0; | ||
| 55 | 54 | ||
| 56 | signal(SIGINT, clean_exit); | 55 | signal(SIGINT, clean_exit); |
| 57 | signal(SIGQUIT, clean_exit); | 56 | signal(SIGQUIT, clean_exit); |
