summaryrefslogtreecommitdiffstats
path: root/include/libimobiledevice/restore.h
diff options
context:
space:
mode:
authorGravatar Aaron Burghardt2014-03-27 10:07:09 -0400
committerGravatar Aaron Burghardt2014-03-27 21:40:43 -0400
commit2342dc5b4ef148b993fbe3816f3facdef8365546 (patch)
tree69f812d91b2fc07db0fad5dcba6c80d2f8b6849e /include/libimobiledevice/restore.h
parentee82e861a8c942b5013accd7589cf898d1f97167 (diff)
downloadlibimobiledevice-2342dc5b4ef148b993fbe3816f3facdef8365546.tar.gz
libimobiledevice-2342dc5b4ef148b993fbe3816f3facdef8365546.tar.bz2
Moved Doxygen comments from source files to public headers.
Conflicts: include/libimobiledevice/afc.h
Diffstat (limited to 'include/libimobiledevice/restore.h')
-rw-r--r--include/libimobiledevice/restore.h110
1 files changed, 110 insertions, 0 deletions
diff --git a/include/libimobiledevice/restore.h b/include/libimobiledevice/restore.h
index 584adb4..f4e8822 100644
--- a/include/libimobiledevice/restore.h
+++ b/include/libimobiledevice/restore.h
@@ -51,20 +51,130 @@ typedef struct restored_client_private restored_client_private;
51typedef restored_client_private *restored_client_t; /**< The client handle. */ 51typedef restored_client_private *restored_client_t; /**< The client handle. */
52 52
53/* Interface */ 53/* Interface */
54
55/**
56 * Creates a new restored client for the device.
57 *
58 * @param device The device to create a restored client for
59 * @param client The pointer to the location of the new restored_client
60 * @param label The label to use for communication. Usually the program name.
61 *
62 * @return RESTORE_E_SUCCESS on success, NP_E_INVALID_ARG when client is NULL
63 */
54restored_error_t restored_client_new(idevice_t device, restored_client_t *client, const char *label); 64restored_error_t restored_client_new(idevice_t device, restored_client_t *client, const char *label);
65
66/**
67 * Closes the restored client session if one is running and frees up the
68 * restored_client struct.
69 *
70 * @param client The restore client
71 *
72 * @return RESTORE_E_SUCCESS on success, NP_E_INVALID_ARG when client is NULL
73 */
55restored_error_t restored_client_free(restored_client_t client); 74restored_error_t restored_client_free(restored_client_t client);
56 75
76
77/**
78 * Query the type of the service daemon. Depending on whether the device is
79 * queried in normal mode or restore mode, different types will be returned.
80 *
81 * @param client The restored client
82 * @param type The type returned by the service daemon. Pass NULL to ignore.
83 * @param version The restore protocol version. Pass NULL to ignore.
84 *
85 * @return RESTORE_E_SUCCESS on success, NP_E_INVALID_ARG when client is NULL
86 */
57restored_error_t restored_query_type(restored_client_t client, char **type, uint64_t *version); 87restored_error_t restored_query_type(restored_client_t client, char **type, uint64_t *version);
88
89/**
90 * Queries a value from the device specified by a key.
91 *
92 * @param client An initialized restored client.
93 * @param key The key name to request
94 * @param value A plist node representing the result value node
95 *
96 * @return RESTORE_E_SUCCESS on success, NP_E_INVALID_ARG when client is NULL, RESTORE_E_PLIST_ERROR if value for key can't be found
97 */
58restored_error_t restored_query_value(restored_client_t client, const char *key, plist_t *value); 98restored_error_t restored_query_value(restored_client_t client, const char *key, plist_t *value);
99
100/**
101 * Retrieves a value from information plist specified by a key.
102 *
103 * @param client An initialized restored client.
104 * @param key The key name to request or NULL to query for all keys
105 * @param value A plist node representing the result value node
106 *
107 * @return RESTORE_E_SUCCESS on success, NP_E_INVALID_ARG when client is NULL, RESTORE_E_PLIST_ERROR if value for key can't be found
108 */
59restored_error_t restored_get_value(restored_client_t client, const char *key, plist_t *value) ; 109restored_error_t restored_get_value(restored_client_t client, const char *key, plist_t *value) ;
110
111/**
112 * Sends a plist to restored.
113 *
114 * @note This function is low-level and should only be used if you need to send
115 * a new type of message.
116 *
117 * @param client The restored client
118 * @param plist The plist to send
119 *
120 * @return RESTORE_E_SUCCESS on success, NP_E_INVALID_ARG when client or
121 * plist is NULL
122 */
60restored_error_t restored_send(restored_client_t client, plist_t plist); 123restored_error_t restored_send(restored_client_t client, plist_t plist);
124
125/**
126 * Receives a plist from restored.
127 *
128 * @param client The restored client
129 * @param plist The plist to store the received data
130 *
131 * @return RESTORE_E_SUCCESS on success, NP_E_INVALID_ARG when client or
132 * plist is NULL
133 */
61restored_error_t restored_receive(restored_client_t client, plist_t *plist); 134restored_error_t restored_receive(restored_client_t client, plist_t *plist);
135
136/**
137 * Sends the Goodbye request to restored signaling the end of communication.
138 *
139 * @param client The restore client
140 *
141 * @return RESTORE_E_SUCCESS on success, NP_E_INVALID_ARG when client is NULL,
142 * RESTORE_E_PLIST_ERROR if the device did not acknowledge the request
143 */
62restored_error_t restored_goodbye(restored_client_t client); 144restored_error_t restored_goodbye(restored_client_t client);
63 145
146
147/**
148 * Requests to start a restore and retrieve it's port on success.
149 *
150 * @param client The restored client
151 * @param options PLIST_DICT with options for the restore process or NULL
152 * @param version the restore protocol version, see restored_query_type()
153 *
154 * @return RESTORE_E_SUCCESS on success, NP_E_INVALID_ARG if a parameter
155 * is NULL, RESTORE_E_START_RESTORE_FAILED if the request fails
156 */
64restored_error_t restored_start_restore(restored_client_t client, plist_t options, uint64_t version); 157restored_error_t restored_start_restore(restored_client_t client, plist_t options, uint64_t version);
158
159/**
160 * Requests device to reboot.
161 *
162 * @param client The restored client
163 *
164 * @return RESTORE_E_SUCCESS on success, NP_E_INVALID_ARG if a parameter
165 * is NULL
166 */
65restored_error_t restored_reboot(restored_client_t client); 167restored_error_t restored_reboot(restored_client_t client);
66 168
67/* Helper */ 169/* Helper */
170
171/**
172 * Sets the label to send for requests to restored.
173 *
174 * @param client The restore client
175 * @param label The label to set or NULL to disable sending a label
176 *
177 */
68void restored_client_set_label(restored_client_t client, const char *label); 178void restored_client_set_label(restored_client_t client, const char *label);
69 179
70#ifdef __cplusplus 180#ifdef __cplusplus