diff options
author | Martin Szulecki | 2009-07-25 02:40:25 +0200 |
---|---|---|
committer | Martin Szulecki | 2009-07-25 02:40:25 +0200 |
commit | f5e9d76ebd74999512ab73f44fabba86879b1c1f (patch) | |
tree | 9e01e1b8bda52c04c31c5334805a530403713e08 /dev/lckdclient.c | |
parent | d11abfb48218a37d9c66831ebec8b0a736d5385f (diff) | |
download | libimobiledevice-f5e9d76ebd74999512ab73f44fabba86879b1c1f.tar.gz libimobiledevice-f5e9d76ebd74999512ab73f44fabba86879b1c1f.tar.bz2 |
Update lockdown API and introduce new error codes
Diffstat (limited to 'dev/lckdclient.c')
-rw-r--r-- | dev/lckdclient.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/dev/lckdclient.c b/dev/lckdclient.c index 9518a6e..4dcb0b4 100644 --- a/dev/lckdclient.c +++ b/dev/lckdclient.c @@ -48,7 +48,7 @@ int main(int argc, char *argv[]) if (uuid) free(uuid); - if (IPHONE_E_SUCCESS != lockdownd_new_client(phone, &client)) { + if (LOCKDOWN_E_SUCCESS != lockdownd_client_new(phone, &client)) { iphone_free_device(phone); return -1; } @@ -76,7 +76,7 @@ int main(int argc, char *argv[]) if (!strcmp(*args, "get") && len >= 2) { plist_t value = NULL; - if (IPHONE_E_SUCCESS == lockdownd_get_value(client, len == 3 ? *(args + 1):NULL, len == 3 ? *(args + 2):*(args + 1), &value)) + if (LOCKDOWN_E_SUCCESS == lockdownd_get_value(client, len == 3 ? *(args + 1):NULL, len == 3 ? *(args + 2):*(args + 1), &value)) { char *xml = NULL; uint32_t length; @@ -93,8 +93,13 @@ int main(int argc, char *argv[]) if (!strcmp(*args, "start") && len == 2) { int port = 0; - lockdownd_start_service(client, *(args + 1), &port); - printf("%i\n", port); + if(LOCKDOWN_E_SUCCESS == lockdownd_start_service(client, *(args + 1), &port)) { + printf("started service %s on port %i\n", *(args + 1), port); + } + else + { + printf("failed to start service %s on device.\n", *(args + 1)); + } } } g_strfreev(args); @@ -103,7 +108,7 @@ int main(int argc, char *argv[]) cmd = NULL; } clear_history(); - lockdownd_free_client(client); + lockdownd_client_free(client); iphone_free_device(phone); return 0; |