From e617375c3424ef341a172d05c58cfc4335049c44 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Sat, 12 Sep 2009 19:44:51 +0200 Subject: Update tools to use new API --- dev/afccheck.c | 2 +- dev/iphoneclient.c | 4 ++-- dev/iphoneenterrecovery.c | 2 +- dev/lckdclient.c | 2 +- dev/msyncclient.c | 2 +- tools/iphone_id.c | 15 +++++++-------- 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[]) iphone_set_debug_mask(DBGMASK_NONE); } - if (IPHONE_E_SUCCESS != iphone_get_device(&phone)) { + if (IPHONE_E_SUCCESS != iphone_device_new(&phone, NULL)) { printf("No iPhone found, is it plugged in?\n"); return 1; } 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 @@ */ #include +#include #include #include -#include #include #include @@ -75,7 +75,7 @@ int main(int argc, char *argv[]) iphone_set_debug_mask(DBGMASK_NONE); } - if (IPHONE_E_SUCCESS != iphone_get_device(&phone)) { + if (IPHONE_E_SUCCESS != iphone_device_new(&phone, NULL)) { printf("No iPhone found, is it plugged in?\n"); return -1; } 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[]) } strcpy(uuid, argv[i]); - ret = iphone_get_device_by_uuid(&phone, uuid); + ret = iphone_device_new(&phone, uuid); if (ret != IPHONE_E_SUCCESS) { printf("No device found with uuid %s, is it plugged in?\n", uuid); 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[]) iphone_set_debug_level(1); - if (IPHONE_E_SUCCESS != iphone_get_device(&phone)) { + if (IPHONE_E_SUCCESS != iphone_device_new(&phone, NULL)) { printf("No iPhone found, is it plugged in?\n"); return -1; } 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[]) if (argc > 1 && !strcasecmp(argv[1], "--debug")) iphone_set_debug_mask(DBGMASK_MOBILESYNC); - if (IPHONE_E_SUCCESS != iphone_get_device(&phone)) { + if (IPHONE_E_SUCCESS != iphone_device_new(&phone, NULL)) { printf("No iPhone found, is it plugged in?\n"); return -1; } 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 @@ #include #include #include -#include #define MODE_NONE 0 #define MODE_SHOW_ID 1 @@ -18,7 +17,7 @@ static void print_usage(int argc, char **argv) printf("Prints device name or a list of attached iPhone/iPod Touch devices.\n\n"); printf(" The UUID is a 40-digit hexadecimal number of the device\n"); printf(" for which the name should be retrieved.\n\n"); - printf(" -l, --list\t\tlist all attached devices\n"); + printf(" -l, --list\t\tlist UUID of all attached devices\n"); printf(" -d, --debug\t\tenable communication debugging\n"); printf(" -h, --help\t\tprints usage information\n"); printf("\n"); @@ -28,7 +27,7 @@ int main(int argc, char **argv) { iphone_device_t phone = NULL; lockdownd_client_t client = NULL; - usbmuxd_device_info_t *dev_list; + char **dev_list = NULL; char *devname = NULL; int ret = 0; int i; @@ -96,14 +95,14 @@ int main(int argc, char **argv) return ret; case MODE_LIST_DEVICES: default: - if (usbmuxd_get_device_list(&dev_list) < 0) { - fprintf(stderr, "ERROR: usbmuxd is not running!\n"); + if (iphone_get_device_list(&dev_list, &i) < 0) { + fprintf(stderr, "ERROR: Unable to retrieve device list!\n"); return -1; } - for (i = 0; dev_list[i].handle > 0; i++) { - printf("handle=%d product_id=%04x uuid=%s\n", dev_list[i].handle, dev_list[i].product_id, dev_list[i].uuid); + for (i = 0; dev_list[i] != NULL; i++) { + printf("%s\n", dev_list[i]); } - usbmuxd_free_device_list(dev_list); + iphone_free_device_list(dev_list); return 0; } } 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[]) char uuid[41]; int port = 0; uuid[0] = 0; - uint32_t handle = 0; signal(SIGINT, clean_exit); signal(SIGQUIT, clean_exit); -- cgit v1.1-32-gdbae