diff options
| author | 2010-03-15 18:13:00 +0100 | |
|---|---|---|
| committer | 2010-03-15 19:13:07 +0100 | |
| commit | 2bde7add91ea63f0c2f2e3f090cf872168b504f9 (patch) | |
| tree | de70bf1a34ec58501c851394cd8c54ce999c102b /src/device_link_service.c | |
| parent | d74b7217c374198ae79c1690f6f3234ed023021d (diff) | |
| download | libimobiledevice-2bde7add91ea63f0c2f2e3f090cf872168b504f9.tar.gz libimobiledevice-2bde7add91ea63f0c2f2e3f090cf872168b504f9.tar.bz2 | |
Add device_link_service_send_ping function.
Diffstat (limited to 'src/device_link_service.c')
| -rw-r--r-- | src/device_link_service.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/device_link_service.c b/src/device_link_service.c index 7baef02..430b1db 100644 --- a/src/device_link_service.c +++ b/src/device_link_service.c | |||
| @@ -254,6 +254,34 @@ device_link_service_error_t device_link_service_disconnect(device_link_service_c | |||
| 254 | } | 254 | } |
| 255 | 255 | ||
| 256 | /** | 256 | /** |
| 257 | * Sends a DLMessagePing plist. | ||
| 258 | * | ||
| 259 | * @param client The device link service client to use. | ||
| 260 | * @param message String to send as ping message. | ||
| 261 | * | ||
| 262 | * @return DEVICE_LINK_SERVICE_E_SUCCESS on success, | ||
| 263 | * DEVICE_LINK_SERVICE_E_INVALID_ARG if client or message is invalid, | ||
| 264 | * or DEVICE_LINK_SERVICE_E_MUX_ERROR if the DLMessagePing plist could | ||
| 265 | * not be sent. | ||
| 266 | */ | ||
| 267 | device_link_service_error_t device_link_service_send_ping(device_link_service_client_t client, const char *message) | ||
| 268 | { | ||
| 269 | if (!client || !client->parent || !message) | ||
| 270 | return DEVICE_LINK_SERVICE_E_INVALID_ARG; | ||
| 271 | |||
| 272 | plist_t array = plist_new_array(); | ||
| 273 | plist_array_append_item(array, plist_new_string("DLMessagePing")); | ||
| 274 | plist_array_append_item(array, plist_new_string(message)); | ||
| 275 | |||
| 276 | device_link_service_error_t err = DEVICE_LINK_SERVICE_E_SUCCESS; | ||
| 277 | if (property_list_service_send_binary_plist(client->parent, array) != PROPERTY_LIST_SERVICE_E_SUCCESS) { | ||
| 278 | err = DEVICE_LINK_SERVICE_E_MUX_ERROR; | ||
| 279 | } | ||
| 280 | plist_free(array); | ||
| 281 | return err; | ||
| 282 | } | ||
| 283 | |||
| 284 | /** | ||
| 257 | * Sends a DLMessageProcessMessage plist. | 285 | * Sends a DLMessageProcessMessage plist. |
| 258 | * | 286 | * |
| 259 | * @param client The device link service client to use. | 287 | * @param client The device link service client to use. |
