From fa40b4ad59bce6b9d8c3a0763b09530e8cf2a006 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Thu, 28 Apr 2011 21:01:27 +0200 Subject: device_link_service: Allow passing a reason message upon disconnecting --- src/device_link_service.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/device_link_service.c') 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) { -- cgit v1.1-32-gdbae