From 9a404feafc3a738d5aad999491c6c0fd23b4da01 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Fri, 9 Jul 2010 23:35:13 +0200 Subject: Add more known status messages and report them --- src/restore.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/restore.c b/src/restore.c index 40b24d3..4b5d0fd 100644 --- a/src/restore.c +++ b/src/restore.c @@ -348,8 +348,27 @@ int restore_handle_progress_msg(restored_client_t client, plist_t msg) { } int restore_handle_status_msg(restored_client_t client, plist_t msg) { + uint64_t value = 0; info("Got status message\n"); debug_plist(msg); + + plist_t node = plist_dict_get_item(msg, "Status"); + plist_get_uint_val(node, &value); + + switch(value) { + case 0: + info("Status: Restore Finished\n"); + break; + case 6: + info("Status: Disk Failure\n"); + break; + case 14: + info("Status: Fail\n"); + break; + default: + info("Unknown status message.\n"); + } + return 0; } @@ -366,8 +385,7 @@ int restore_send_filesystem(idevice_t device, const char* filesystem) { } info("Connected to ASR\n"); - // we don't really need to do anything with this, - // we're just clearing the output buffer + /* receive Initiate command message */ if (asr_receive(asr, &data) < 0) { error("ERROR: Unable to receive data from ASR\n"); asr_close(asr); -- cgit v1.1-32-gdbae