diff options
| author | 2011-04-28 21:01:27 +0200 | |
|---|---|---|
| committer | 2011-04-28 21:01:27 +0200 | |
| commit | fa40b4ad59bce6b9d8c3a0763b09530e8cf2a006 (patch) | |
| tree | b3c3409dac86c2d0ee90e1b620763bb37ac3b527 /src/device_link_service.c | |
| parent | d81887cf6a0d067d8b345d8077027ccd634c1c17 (diff) | |
| download | libimobiledevice-fa40b4ad59bce6b9d8c3a0763b09530e8cf2a006.tar.gz libimobiledevice-fa40b4ad59bce6b9d8c3a0763b09530e8cf2a006.tar.bz2 | |
device_link_service: Allow passing a reason message upon disconnecting
Diffstat (limited to 'src/device_link_service.c')
| -rw-r--r-- | src/device_link_service.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/device_link_service.c b/src/device_link_service.c index 6083d80..5825f0c 100644 --- a/src/device_link_service.c +++ b/src/device_link_service.c | |||
| @@ -235,20 +235,24 @@ leave: | |||
| 235 | * Performs a disconnect with the connected device link service client. | 235 | * Performs a disconnect with the connected device link service client. |
| 236 | * | 236 | * |
| 237 | * @param client The device link service client to disconnect. | 237 | * @param client The device link service client to disconnect. |
| 238 | * @param message Optional message to send send to the device or NULL. | ||
| 238 | * | 239 | * |
| 239 | * @return DEVICE_LINK_SERVICE_E_SUCCESS on success, | 240 | * @return DEVICE_LINK_SERVICE_E_SUCCESS on success, |
| 240 | * DEVICE_LINK_SERVICE_E_INVALID_ARG if client is NULL, | 241 | * DEVICE_LINK_SERVICE_E_INVALID_ARG if client is NULL, |
| 241 | * or DEVICE_LINK_SERVICE_E_MUX_ERROR when there's an error when sending | 242 | * or DEVICE_LINK_SERVICE_E_MUX_ERROR when there's an error when sending |
| 242 | * the the disconnect message. | 243 | * the the disconnect message. |
| 243 | */ | 244 | */ |
| 244 | device_link_service_error_t device_link_service_disconnect(device_link_service_client_t client) | 245 | device_link_service_error_t device_link_service_disconnect(device_link_service_client_t client, const char *message) |
| 245 | { | 246 | { |
| 246 | if (!client) | 247 | if (!client) |
| 247 | return DEVICE_LINK_SERVICE_E_INVALID_ARG; | 248 | return DEVICE_LINK_SERVICE_E_INVALID_ARG; |
| 248 | 249 | ||
| 249 | plist_t array = plist_new_array(); | 250 | plist_t array = plist_new_array(); |
| 250 | plist_array_append_item(array, plist_new_string("DLMessageDisconnect")); | 251 | plist_array_append_item(array, plist_new_string("DLMessageDisconnect")); |
| 251 | plist_array_append_item(array, plist_new_string("All done, thanks for the memories")); | 252 | if (message) |
| 253 | plist_array_append_item(array, plist_new_string(message)); | ||
| 254 | else | ||
| 255 | plist_array_append_item(array, plist_new_string("___EmptyParameterString___")); | ||
| 252 | 256 | ||
| 253 | device_link_service_error_t err = DEVICE_LINK_SERVICE_E_SUCCESS; | 257 | device_link_service_error_t err = DEVICE_LINK_SERVICE_E_SUCCESS; |
| 254 | if (property_list_service_send_binary_plist(client->parent, array) != PROPERTY_LIST_SERVICE_E_SUCCESS) { | 258 | if (property_list_service_send_binary_plist(client->parent, array) != PROPERTY_LIST_SERVICE_E_SUCCESS) { |
