diff options
| author | 2010-07-12 11:30:12 +0200 | |
|---|---|---|
| committer | 2010-07-12 11:30:12 +0200 | |
| commit | aa25d87ae9b166919cf2ac273e673ac35333accc (patch) | |
| tree | 574afd73fef339d91d71bd12d51cb9bd3d1b5d88 /src | |
| parent | 31ec3f32bb828a5851f920c51c8e8e6b8f1f682b (diff) | |
| download | libimobiledevice-aa25d87ae9b166919cf2ac273e673ac35333accc.tar.gz libimobiledevice-aa25d87ae9b166919cf2ac273e673ac35333accc.tar.bz2 | |
sbservices: allow passing formatVersion when requesting icon state
Diffstat (limited to 'src')
| -rw-r--r-- | src/sbservices.c | 9 |
1 files changed, 8 insertions, 1 deletions
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 | */ |
| 147 | sbservices_error_t sbservices_get_icon_state(sbservices_client_t client, plist_t *state) | 151 | sbservices_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 | ||
