summaryrefslogtreecommitdiffstats
path: root/src/misagent.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/misagent.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/misagent.c')
-rw-r--r--src/misagent.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/misagent.c b/src/misagent.c
index 331fc6c..750cf52 100644
--- a/src/misagent.c
+++ b/src/misagent.c
@@ -115,6 +115,26 @@ misagent_error_t misagent_client_new(idevice_t device, lockdownd_service_descrip
115} 115}
116 116
117/** 117/**
118 * Starts a new misagent service on the specified device and connects to it.
119 *
120 * @param device The device to connect to.
121 * @param client Pointer that will point to a newly allocated
122 * misagent_client_t upon successful return. Must be freed using
123 * misagent_client_free() after use.
124 * @param label The label to use for communication. Usually the program name.
125 * Pass NULL to disable sending the label in requests to lockdownd.
126 *
127 * @return MISAGENT_E_SUCCESS on success, or an MISAGENT_E_* error
128 * code otherwise.
129 */
130misagent_error_t misagent_client_start_service(idevice_t device, misagent_client_t * client, const char* label)
131{
132 misagent_error_t err = MISAGENT_E_UNKNOWN_ERROR;
133 service_client_factory_start_service(device, MISAGENT_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(misagent_client_new), &err);
134 return err;
135}
136
137/**
118 * Disconnects an misagent client from the device and frees up the 138 * Disconnects an misagent client from the device and frees up the
119 * misagent client data. 139 * misagent client data.
120 * 140 *