summaryrefslogtreecommitdiffstats
path: root/src/installation_proxy.c
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2013-08-05 20:07:04 +0200
committerGravatar Martin Szulecki2013-08-05 20:07:04 +0200
commit3604756139b1a2dde383122745d37fe9d1c95f88 (patch)
tree84f7a312bfc539abc8c7e78d99fcd9c8608f6a9c /src/installation_proxy.c
parentd0635a7dc686e21d3eea6bf1c030657d6d575562 (diff)
downloadlibimobiledevice-3604756139b1a2dde383122745d37fe9d1c95f88.tar.gz
libimobiledevice-3604756139b1a2dde383122745d37fe9d1c95f88.tar.bz2
Implement *_start_service() helper to simplify creation of service clients
Diffstat (limited to 'src/installation_proxy.c')
-rw-r--r--src/installation_proxy.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/installation_proxy.c b/src/installation_proxy.c
index 6873f26..cffadd9 100644
--- a/src/installation_proxy.c
+++ b/src/installation_proxy.c
@@ -112,6 +112,26 @@ instproxy_error_t instproxy_client_new(idevice_t device, lockdownd_service_descr
112} 112}
113 113
114/** 114/**
115 * Starts a new installation_proxy service on the specified device and connects to it.
116 *
117 * @param device The device to connect to.
118 * @param client Pointer that will point to a newly allocated
119 * instproxy_client_t upon successful return. Must be freed using
120 * instproxy_client_free() after use.
121 * @param label The label to use for communication. Usually the program name.
122 * Pass NULL to disable sending the label in requests to lockdownd.
123 *
124 * @return INSTPROXY_E_SUCCESS on success, or an INSTPROXY_E_* error
125 * code otherwise.
126 */
127instproxy_error_t instproxy_client_start_service(idevice_t device, instproxy_client_t * client, const char* label)
128{
129 instproxy_error_t err = INSTPROXY_E_UNKNOWN_ERROR;
130 service_client_factory_start_service(device, INSTPROXY_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(instproxy_client_new), &err);
131 return err;
132}
133
134/**
115 * Disconnects an installation_proxy client from the device and frees up the 135 * Disconnects an installation_proxy client from the device and frees up the
116 * installation_proxy client data. 136 * installation_proxy client data.
117 * 137 *