summaryrefslogtreecommitdiffstats
path: root/src/device_link_service.c
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2011-04-28 21:01:27 +0200
committerGravatar Martin Szulecki2011-04-28 21:01:27 +0200
commitfa40b4ad59bce6b9d8c3a0763b09530e8cf2a006 (patch)
treeb3c3409dac86c2d0ee90e1b620763bb37ac3b527 /src/device_link_service.c
parentd81887cf6a0d067d8b345d8077027ccd634c1c17 (diff)
downloadlibimobiledevice-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.c8
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:
* Performs a disconnect with the connected device link service client.
*
* @param client The device link service client to disconnect.
+ * @param message Optional message to send send to the device or NULL.
*
* @return DEVICE_LINK_SERVICE_E_SUCCESS on success,
* DEVICE_LINK_SERVICE_E_INVALID_ARG if client is NULL,
* or DEVICE_LINK_SERVICE_E_MUX_ERROR when there's an error when sending
* the the disconnect message.
*/
-device_link_service_error_t device_link_service_disconnect(device_link_service_client_t client)
+device_link_service_error_t device_link_service_disconnect(device_link_service_client_t client, const char *message)
{
if (!client)
return DEVICE_LINK_SERVICE_E_INVALID_ARG;
plist_t array = plist_new_array();
plist_array_append_item(array, plist_new_string("DLMessageDisconnect"));
- plist_array_append_item(array, plist_new_string("All done, thanks for the memories"));
+ if (message)
+ plist_array_append_item(array, plist_new_string(message));
+ else
+ plist_array_append_item(array, plist_new_string("___EmptyParameterString___"));
device_link_service_error_t err = DEVICE_LINK_SERVICE_E_SUCCESS;
if (property_list_service_send_binary_plist(client->parent, array) != PROPERTY_LIST_SERVICE_E_SUCCESS) {