diff options
| author | 2012-01-11 17:24:57 +0100 | |
|---|---|---|
| committer | 2012-01-11 17:24:57 +0100 | |
| commit | f6555734bf8a28ce9663d87320a1eff61710d7a4 (patch) | |
| tree | 67493130aee1ec194336f69521a4c08b5a9eb88a | |
| parent | e855f246b3d869a60375207fde1294bbe761fe23 (diff) | |
| download | libimobiledevice-f6555734bf8a28ce9663d87320a1eff61710d7a4.tar.gz libimobiledevice-f6555734bf8a28ce9663d87320a1eff61710d7a4.tar.bz2 | |
restored: allow passing options to restored_start_restore()
| -rw-r--r-- | include/libimobiledevice/restore.h | 2 | ||||
| -rw-r--r-- | src/restore.c | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/include/libimobiledevice/restore.h b/include/libimobiledevice/restore.h index 9c30b03..aa8233f 100644 --- a/include/libimobiledevice/restore.h +++ b/include/libimobiledevice/restore.h | |||
| @@ -59,7 +59,7 @@ restored_error_t restored_send(restored_client_t client, plist_t plist); | |||
| 59 | restored_error_t restored_receive(restored_client_t client, plist_t *plist); | 59 | restored_error_t restored_receive(restored_client_t client, plist_t *plist); |
| 60 | restored_error_t restored_goodbye(restored_client_t client); | 60 | restored_error_t restored_goodbye(restored_client_t client); |
| 61 | 61 | ||
| 62 | restored_error_t restored_start_restore(restored_client_t client); | 62 | restored_error_t restored_start_restore(restored_client_t client, plist_t options, uint64_t version); |
| 63 | restored_error_t restored_reboot(restored_client_t client); | 63 | restored_error_t restored_reboot(restored_client_t client); |
| 64 | 64 | ||
| 65 | /* Helper */ | 65 | /* Helper */ |
diff --git a/src/restore.c b/src/restore.c index fd23d85..10642da 100644 --- a/src/restore.c +++ b/src/restore.c | |||
| @@ -391,11 +391,13 @@ restored_error_t restored_goodbye(restored_client_t client) | |||
| 391 | * Requests to start a restore and retrieve it's port on success. | 391 | * Requests to start a restore and retrieve it's port on success. |
| 392 | * | 392 | * |
| 393 | * @param client The restored client | 393 | * @param client The restored client |
| 394 | * @param options PLIST_DICT with options for the restore process or NULL | ||
| 395 | * @param version the restore protocol version, see restored_query_type() | ||
| 394 | * | 396 | * |
| 395 | * @return RESTORE_E_SUCCESS on success, NP_E_INVALID_ARG if a parameter | 397 | * @return RESTORE_E_SUCCESS on success, NP_E_INVALID_ARG if a parameter |
| 396 | * is NULL, RESTORE_E_START_RESTORE_FAILED if the request fails | 398 | * is NULL, RESTORE_E_START_RESTORE_FAILED if the request fails |
| 397 | */ | 399 | */ |
| 398 | restored_error_t restored_start_restore(restored_client_t client) | 400 | restored_error_t restored_start_restore(restored_client_t client, plist_t options, uint64_t version) |
| 399 | { | 401 | { |
| 400 | if (!client) | 402 | if (!client) |
| 401 | return RESTORE_E_INVALID_ARG; | 403 | return RESTORE_E_INVALID_ARG; |
| @@ -406,7 +408,10 @@ restored_error_t restored_start_restore(restored_client_t client) | |||
| 406 | dict = plist_new_dict(); | 408 | dict = plist_new_dict(); |
| 407 | plist_dict_add_label(dict, client->label); | 409 | plist_dict_add_label(dict, client->label); |
| 408 | plist_dict_insert_item(dict,"Request", plist_new_string("StartRestore")); | 410 | plist_dict_insert_item(dict,"Request", plist_new_string("StartRestore")); |
| 409 | plist_dict_insert_item(dict,"RestoreProtocolVersion", plist_new_uint(2)); | 411 | if (options) { |
| 412 | plist_dict_insert_item(dict, "RestoreOptions", plist_copy(options)); | ||
| 413 | } | ||
| 414 | plist_dict_insert_item(dict,"RestoreProtocolVersion", plist_new_uint(version)); | ||
| 410 | 415 | ||
| 411 | /* send to device */ | 416 | /* send to device */ |
| 412 | ret = restored_send(client, dict); | 417 | ret = restored_send(client, dict); |
