summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2010-01-24 02:46:38 +0100
committerGravatar Martin Szulecki2010-01-24 02:46:38 +0100
commit9a6fa170d226d1557e89f5e5252d1e0c61158ff5 (patch)
tree70243c3e2b8d758111b14f8aa20994f30d56c02c
parent4ded564cbc58bd513ece9ff9f8c5a6948759bfb7 (diff)
downloadlibimobiledevice-9a6fa170d226d1557e89f5e5252d1e0c61158ff5.tar.gz
libimobiledevice-9a6fa170d226d1557e89f5e5252d1e0c61158ff5.tar.bz2
Add function to handle the ProcessMessage in the DeviceLink service
-rw-r--r--src/device_link_service.c20
-rw-r--r--src/device_link_service.h1
2 files changed, 21 insertions, 0 deletions
diff --git a/src/device_link_service.c b/src/device_link_service.c
index e1155a5..c791b03 100644
--- a/src/device_link_service.c
+++ b/src/device_link_service.c
@@ -252,6 +252,26 @@ device_link_service_error_t device_link_service_disconnect(device_link_service_c
return err;
}
+device_link_service_error_t device_link_service_process_message(device_link_service_client_t client, plist_t message)
+{
+ if (!client || !message)
+ return DEVICE_LINK_SERVICE_E_INVALID_ARG;
+
+ if (plist_get_node_type(message) != PLIST_DICT)
+ return DEVICE_LINK_SERVICE_E_INVALID_ARG;
+
+ plist_t array = plist_new_array();
+ plist_array_append_item(array, plist_new_string("DLMessageProcessMessage"));
+ plist_array_append_item(array, message);
+
+ 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) {
+ err = DEVICE_LINK_SERVICE_E_MUX_ERROR;
+ }
+ plist_free(array);
+ return err;
+}
+
/**
* Generic device link service send function.
*
diff --git a/src/device_link_service.h b/src/device_link_service.h
index e14d897..8345d57 100644
--- a/src/device_link_service.h
+++ b/src/device_link_service.h
@@ -44,6 +44,7 @@ typedef int16_t device_link_service_error_t;
device_link_service_error_t device_link_service_client_new(iphone_device_t device, uint16_t port, device_link_service_client_t *client);
device_link_service_error_t device_link_service_client_free(device_link_service_client_t client);
device_link_service_error_t device_link_service_version_exchange(device_link_service_client_t client, uint64_t version_major, uint64_t version_minor);
+device_link_service_error_t device_link_service_process_message(device_link_service_client_t client, plist_t message);
device_link_service_error_t device_link_service_disconnect(device_link_service_client_t client);
device_link_service_error_t device_link_service_send(device_link_service_client_t client, plist_t plist);
device_link_service_error_t device_link_service_receive(device_link_service_client_t client, plist_t *plist);