summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/libimobiledevice/sbservices.h2
-rw-r--r--src/sbservices.c9
2 files changed, 9 insertions, 2 deletions
diff --git a/include/libimobiledevice/sbservices.h b/include/libimobiledevice/sbservices.h
index 4274278..616168e 100644
--- a/include/libimobiledevice/sbservices.h
+++ b/include/libimobiledevice/sbservices.h
@@ -48,7 +48,7 @@ typedef sbservices_client_private *sbservices_client_t; /**< The client handle.
48/* Interface */ 48/* Interface */
49sbservices_error_t sbservices_client_new(idevice_t device, uint16_t port, sbservices_client_t *client); 49sbservices_error_t sbservices_client_new(idevice_t device, uint16_t port, sbservices_client_t *client);
50sbservices_error_t sbservices_client_free(sbservices_client_t client); 50sbservices_error_t sbservices_client_free(sbservices_client_t client);
51sbservices_error_t sbservices_get_icon_state(sbservices_client_t client, plist_t *state); 51sbservices_error_t sbservices_get_icon_state(sbservices_client_t client, plist_t *state, const char *format_version);
52sbservices_error_t sbservices_set_icon_state(sbservices_client_t client, plist_t newstate); 52sbservices_error_t sbservices_set_icon_state(sbservices_client_t client, plist_t newstate);
53sbservices_error_t sbservices_get_icon_pngdata(sbservices_client_t client, const char *bundleId, char **pngdata, uint64_t *pngsize); 53sbservices_error_t sbservices_get_icon_pngdata(sbservices_client_t client, const char *bundleId, char **pngdata, uint64_t *pngsize);
54sbservices_error_t sbservices_get_home_screen_wallpaper_pngdata(sbservices_client_t client, char **pngdata, uint64_t *pngsize); 54sbservices_error_t sbservices_get_home_screen_wallpaper_pngdata(sbservices_client_t client, char **pngdata, uint64_t *pngsize);
diff --git a/src/sbservices.c b/src/sbservices.c
index e6342d1..3596cbd 100644
--- a/src/sbservices.c
+++ b/src/sbservices.c
@@ -140,11 +140,15 @@ sbservices_error_t sbservices_client_free(sbservices_client_t client)
140 * @param client The connected sbservices client to use. 140 * @param client The connected sbservices client to use.
141 * @param state Pointer that will point to a newly allocated plist containing 141 * @param state Pointer that will point to a newly allocated plist containing
142 * the current icon state. It is up to the caller to free the memory. 142 * the current icon state. It is up to the caller to free the memory.
143 * @param format_version A string to be passed as formatVersion along with
144 * the request, or NULL if no formatVersion should be passed. This is only
145 * supported since iOS 4.0 so for older firmware versions this must be set
146 * to NULL.
143 * 147 *
144 * @return SBSERVICES_E_SUCCESS on success, SBSERVICES_E_INVALID_ARG when 148 * @return SBSERVICES_E_SUCCESS on success, SBSERVICES_E_INVALID_ARG when
145 * client or state is invalid, or an SBSERVICES_E_* error code otherwise. 149 * client or state is invalid, or an SBSERVICES_E_* error code otherwise.
146 */ 150 */
147sbservices_error_t sbservices_get_icon_state(sbservices_client_t client, plist_t *state) 151sbservices_error_t sbservices_get_icon_state(sbservices_client_t client, plist_t *state, const char *format_version)
148{ 152{
149 if (!client || !client->parent || !state) 153 if (!client || !client->parent || !state)
150 return SBSERVICES_E_INVALID_ARG; 154 return SBSERVICES_E_INVALID_ARG;
@@ -153,6 +157,9 @@ sbservices_error_t sbservices_get_icon_state(sbservices_client_t client, plist_t
153 157
154 plist_t dict = plist_new_dict(); 158 plist_t dict = plist_new_dict();
155 plist_dict_insert_item(dict, "command", plist_new_string("getIconState")); 159 plist_dict_insert_item(dict, "command", plist_new_string("getIconState"));
160 if (format_version) {
161 plist_dict_insert_item(dict, "formatVersion", plist_new_string(format_version));
162 }
156 163
157 sbs_lock(client); 164 sbs_lock(client);
158 165